Skip to content

Commit

Permalink
Article can be protected by password
Browse files Browse the repository at this point in the history
Fix backoffice field for password,
fix front in bootstrap theme by adding the protect_password partial for
article render
  • Loading branch information
Yannick Francois committed Mar 2, 2014
1 parent 53d29ee commit dbfa4ad
Show file tree
Hide file tree
Showing 19 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/admin/content/_form.html.erb
Expand Up @@ -167,7 +167,7 @@
</p>
<div id='visibility' class='collapse'>
<label for="article_password"><%= t(".password") %></label>
<%= text_field 'article', 'published_at', :class => "form-control" %>
<%= text_field 'article', 'password', :class => "form-control" %>
<p>
<span class="btn btn-mini btn-default">
<%= toggle_element('visibility', t('.ok')) %>
Expand Down
2 changes: 2 additions & 0 deletions config/locales/da.yml
Expand Up @@ -56,6 +56,8 @@ da:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/de.yml
Expand Up @@ -57,6 +57,8 @@ de:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/en.yml
Expand Up @@ -57,6 +57,8 @@ en:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/es-MX.yml
Expand Up @@ -57,6 +57,8 @@ es-MX:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/fr.yml
Expand Up @@ -57,6 +57,8 @@ fr:
helper:
at: "à"
articles:
password_form:
submit: "Envoyer"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/he-IL.yml
Expand Up @@ -57,6 +57,8 @@ he-IL:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/it.yml
Expand Up @@ -57,6 +57,8 @@ it:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ja.yml
Expand Up @@ -57,6 +57,8 @@ ja:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/lt.yml
Expand Up @@ -57,6 +57,8 @@ lt:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/nb-NO.yml
Expand Up @@ -57,6 +57,8 @@ nb-NO:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/nl.yml
Expand Up @@ -57,6 +57,8 @@ nl:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/pl.yml
Expand Up @@ -57,6 +57,8 @@ pl:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/pt-BR.yml
Expand Up @@ -57,6 +57,8 @@ pt-BR:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ro.yml
Expand Up @@ -57,6 +57,8 @@ ro:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ru.yml
Expand Up @@ -57,6 +57,8 @@ ru:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/zh-CN.yml
Expand Up @@ -57,6 +57,8 @@ zh-CN:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/zh-TW.yml
Expand Up @@ -57,6 +57,8 @@ zh-TW:
helper:
at: "at"
articles:
password_form:
submit: "Submit"
index:
next_page: "Next page"
previous_page: "Previous page"
Expand Down
2 changes: 2 additions & 0 deletions themes/bootstrap/views/articles/read.html.erb
@@ -1,8 +1,10 @@
<div class="article" id="article-<%= @article.id %>">
<h1 class='page-header'><%= link_to_permalink(@article,@article.title) %></h1>

<%= @article.html(:body) %>
<%= @article.html(:extended) %>
<%= render 'articles/protected_article_content', { article: @article } %>
<%= render 'articles/meta', article: @article %>
<% if @article.user.twitter.present? %>
Expand Down

0 comments on commit dbfa4ad

Please sign in to comment.