monologue 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +28 -6
  4. data/app/assets/images/monologue/admin/select2.png +0 -0
  5. data/app/assets/javascripts/monologue/admin/application.js +6 -2
  6. data/app/assets/javascripts/monologue/admin/ckeditor-config.js +21 -0
  7. data/app/assets/javascripts/monologue/admin/posts.js +62 -0
  8. data/app/assets/stylesheets/monologue/admin/application.css +2 -1
  9. data/app/assets/stylesheets/monologue/admin/posts.sass +21 -0
  10. data/app/assets/stylesheets/monologue/blog/application.css +1 -1
  11. data/app/assets/stylesheets/monologue/blog/monologue.css +12 -1
  12. data/app/controllers/monologue/admin/base_controller.rb +2 -2
  13. data/app/controllers/monologue/admin/posts_controller.rb +31 -44
  14. data/app/controllers/monologue/admin/sessions_controller.rb +2 -2
  15. data/app/controllers/monologue/admin/users_controller.rb +39 -3
  16. data/app/controllers/monologue/application_controller.rb +7 -7
  17. data/app/controllers/monologue/posts_controller.rb +5 -7
  18. data/app/controllers/monologue/tags_controller.rb +8 -3
  19. data/app/form_builders/monologue_admin_form_builder.rb +12 -8
  20. data/app/helpers/monologue/application_helper.rb +9 -39
  21. data/app/helpers/monologue/html_helper.rb +35 -0
  22. data/app/helpers/monologue/tags_helper.rb +25 -0
  23. data/app/models/monologue/post.rb +38 -23
  24. data/app/models/monologue/tag.rb +3 -4
  25. data/app/models/monologue/tagging.rb +2 -0
  26. data/app/models/monologue/user.rb +13 -2
  27. data/app/sweepers/monologue/posts_sweeper.rb +2 -5
  28. data/app/views/layouts/monologue/admin.html.erb +2 -2
  29. data/app/views/layouts/monologue/admin/_nav_bar.html.erb +8 -16
  30. data/app/views/layouts/monologue/application.html.erb +1 -1
  31. data/app/views/layouts/monologue/application/_fb_open_graph.html.erb +2 -2
  32. data/app/views/layouts/monologue/application/_sidebar.html.erb +3 -1
  33. data/app/views/layouts/monologue/application/_twitter_cards.html.erb +2 -2
  34. data/app/views/monologue/admin/cache/_config.html.erb +1 -1
  35. data/app/views/monologue/admin/cache/show.html.erb +1 -1
  36. data/app/views/monologue/admin/posts/_form.html.erb +23 -9
  37. data/app/views/monologue/admin/posts/edit.html.erb +3 -3
  38. data/app/views/monologue/admin/posts/index.html.erb +5 -3
  39. data/app/views/monologue/admin/posts/new.html.erb +1 -1
  40. data/app/views/monologue/admin/sessions/new.html.erb +1 -1
  41. data/app/views/monologue/admin/users/_form.html.erb +5 -0
  42. data/app/views/monologue/admin/users/edit.html.erb +3 -7
  43. data/app/views/monologue/admin/users/index.html.erb +28 -0
  44. data/app/views/monologue/admin/users/new.html.erb +5 -0
  45. data/app/views/monologue/posts/_pagination.html.erb +2 -2
  46. data/app/views/monologue/posts/_post.html.erb +6 -8
  47. data/app/views/monologue/posts/_post_header.html.erb +16 -0
  48. data/app/views/monologue/posts/_social_sharing.html.erb +6 -6
  49. data/app/views/monologue/posts/feed.rss.builder +7 -8
  50. data/app/views/monologue/posts/index.html.erb +1 -1
  51. data/app/views/monologue/posts/show.html.erb +8 -8
  52. data/app/views/monologue/sidebar/_latest_posts.html.erb +1 -1
  53. data/app/views/monologue/sidebar/_latest_tweets.html.erb +1 -1
  54. data/app/views/monologue/sidebar/_tag_cloud.html.erb +1 -1
  55. data/config/locales/en.yml +81 -112
  56. data/config/locales/es.yml +148 -0
  57. data/config/locales/fr.yml +76 -110
  58. data/config/locales/it.yml +147 -0
  59. data/config/locales/pt.yml +147 -0
  60. data/config/locales/ro.yml +78 -110
  61. data/config/routes.rb +12 -10
  62. data/db/migrate/20120120193858_create_monologue_posts_revisions.rb +1 -1
  63. data/db/migrate/20120514194459_join_posts_and_tags.rb +1 -1
  64. data/db/migrate/20120526131841_migrate_old_urls.rb +3 -0
  65. data/db/migrate/20120612015727_delete_join_posts_tags.rb +1 -1
  66. data/db/migrate/20130108123111_move_user_id_to_post.rb +31 -0
  67. data/db/migrate/20130509015400_merge_revisions_into_posts.rb +40 -0
  68. data/db/seeds.rb +1 -1
  69. data/lib/monologue/engine.rb +6 -6
  70. data/lib/monologue/version.rb +1 -1
  71. data/lib/tasks/monologue_cache.rake +1 -1
  72. data/vendor/assets/javascripts/monologue/bootstrap/bootstrap-datepicker-es.js +7 -0
  73. data/vendor/assets/javascripts/monologue/bootstrap/bootstrap-datepicker-it.js +9 -0
  74. data/vendor/assets/javascripts/monologue/bootstrap/bootstrap-datepicker-pt.js +9 -0
  75. metadata +88 -78
  76. data/app/assets/javascripts/monologue/admin/tinymce-config.js +0 -21
  77. data/app/models/monologue/posts_revision.rb +0 -61
  78. data/app/views/monologue/posts/_revision_header.html.erb +0 -9
@@ -1,33 +1,25 @@
1
1
  <div class="navbar">
2
2
  <div class="navbar-inner">
3
3
  <div class="container" data-monologue="nav-bar">
4
- <%= link_to "Monologue", admin_path, :class => "brand" %>
4
+ <%= link_to "Monologue", admin_path, class: "brand" %>
5
5
  <ul class="nav pull-left" data-monologue="nav-bar-left">
6
-
7
- <li class="<%= request.fullpath === new_admin_post_path ? "active":"" %>">
8
- <%= link_to t(".add_a_monologue"), new_admin_post_path%>
9
- </li>
10
- <li class="<%= request.fullpath === admin_posts_path || request.fullpath === admin_path ? "active":"" %>">
11
- <%= link_to t(".list_monologues"), admin_posts_path %>
12
- </li>
13
- <li class="<%= request.fullpath === admin_comments_path ? "active":"" %>">
14
- <%= link_to t(".comments"), admin_comments_path %>
15
- </li>
6
+ <%= activable_li_tag_with_link t(".add_a_monologue"), new_admin_post_path %>
7
+ <%= activable_li_tag_with_link t(".list_monologues"), admin_posts_path, admin_path %>
8
+ <%= activable_li_tag_with_link t(".comments"), admin_comments_path %>
16
9
  </ul>
10
+
17
11
  <ul class="nav pull-right" data-monologue="nav-bar-right">
12
+ <%= activable_li_tag_with_link t(".users"), admin_users_path %>
18
13
  <% if ActionController::Base.perform_caching %>
19
- <li class="<%= request.fullpath === admin_cache_path ? "active":"" %>">
20
- <%= link_to t(".cache"), admin_cache_path %>
21
- </li>
14
+ <%= activable_li_tag_with_link t(".cache"), admin_cache_path %>
22
15
  <% end %>
23
16
  <li id="fat-menu" class="dropdown">
24
17
  <a href="#" id="settings" data-toggle="dropdown"><%= t(".settings") %> <b class="caret"></b></a>
25
18
  <ul class="dropdown-menu" role="menu" aria-labelledby="settings">
26
- <li><%= link_to t(".edit_user_info"), edit_admin_user_path(current_user)%></li>
19
+ <li><%= link_to t(".edit_user_info"), edit_admin_user_path(monologue_current_user)%></li>
27
20
  </ul>
28
21
  </li>
29
22
  <li><%= link_to t(".log_out"), admin_logout_path %></li>
30
-
31
23
  </ul>
32
24
 
33
25
  </div>
@@ -12,7 +12,7 @@
12
12
  <%= rss_icon %>
13
13
  <h1><a href="<%= root_path %>"><%=Monologue.site_name%></a></h1>
14
14
  <h2><%=Monologue.site_subtitle%></h2>
15
- <%= render :partial => "layouts/monologue/application/social_icons" %>
15
+ <%= render partial: "layouts/monologue/application/social_icons" %>
16
16
  </header>
17
17
 
18
18
  <div class="content twelve columns">
@@ -1,7 +1,7 @@
1
1
  <meta property="og:title" content="<%= monologue_accurate_title %>"/>
2
2
  <meta property="og:type" content="<%= controller.action_name == "show" ? "article" : "blog" %>"/>
3
- <meta property="og:url" content="http://<%= request.host_with_port %><%= request.path.gsub("//","/") %>"/>
3
+ <meta property="og:url" content="<%= request.protocol %><%= request.host_with_port %><%= request.path.gsub("//","/") %>"/>
4
4
  <meta property="og:site_name" content="<%= Monologue.site_name %>"/>
5
5
  <% if Monologue.facebook_logo%>
6
6
  <meta property="og:image" content="<%= absolute_image_url(image_path(Monologue.facebook_logo)) %>" />
7
- <% end %>
7
+ <% end %>
@@ -1,5 +1,7 @@
1
+ <% if Monologue.sidebar %>
1
2
  <aside class="sidebar four columns">
2
3
  <% Monologue.sidebar.each do |ext| %>
3
- <%= render :partial => "monologue/sidebar/#{ext}" %>
4
+ <%= render partial: "monologue/sidebar/#{ext}" %>
4
5
  <% end %>
5
6
  </aside>
7
+ <% end %>
@@ -2,6 +2,6 @@
2
2
  <% if Monologue.twitter_username %>
3
3
  <meta name="twitter:site" content="<%= Monologue.twitter_username %>">
4
4
  <% end %>
5
- <meta name="twitter:url" content="http://<%= request.host_with_port %><%= request.path.gsub("//","/") %>">
5
+ <meta name="twitter:url" content="<%= request.protocol %><%= request.host_with_port %><%= request.path.gsub("//","/") %>">
6
6
  <meta name="twitter:title" content="<%= monologue_accurate_title %>">
7
- <meta name="twitter:description" content="<%= content_for?(:meta_description) ? yield(:meta_description) : Monologue.meta_description %>">
7
+ <meta name="twitter:description" content="<%= content_for?(:meta_description) ? yield(:meta_description) : Monologue.meta_description %>">
@@ -1,5 +1,5 @@
1
1
  <h1>Current config</h1>
2
- <p>Want to know more about those configs? See here: <%= link_to "Configure Monologue's cache (english only)", "https://github.com/jipiboily/monologue/wiki/Configure-Monologue's-cache", :target => "_blank" %></p>
2
+ <p>Want to know more about those configs? See here: <%= link_to "Configure Monologue's cache (english only)", "https://github.com/jipiboily/monologue/wiki/Configure-Monologue's-cache", target: "_blank" %></p>
3
3
 
4
4
  <div class="alert alert-<%= ActionController::Base.perform_caching ? "success" : "error" %>">
5
5
  ActionController::Base.perform_caching = <%= ActionController::Base.perform_caching %>
@@ -5,7 +5,7 @@
5
5
  <hr>
6
6
 
7
7
  <h2><%= t(".delete") %></h2>
8
- <%= link_to t(".delete"), admin_cache_path, :data => {:confirm => t(".confirm")}, :method => :delete, :class => "btn btn-large btn-danger" %>
8
+ <%= link_to t(".delete"), admin_cache_path, data: {confirm: t(".confirm")}, method: :delete, class: "btn btn-large btn-danger" %>
9
9
 
10
10
  <hr>
11
11
 
@@ -1,17 +1,31 @@
1
1
  <%= post.error_messages %>
2
- <%= post.fields_for @revision do |revision| %>
3
- <%= revision.text_field :title, :label => t(".title"), :class => "span6" %>
4
- <%= revision.text_area :content, :label => t(".content"), :class => "span12 ckeditor" %>
5
- <%= revision.text_field :url, :label => raw(sprintf(t(".url.caption"), "#{DateTime.now.year}/#{t(".url.generated_title")}",monologue.root_path)) %>
6
- <%= revision.text_field :published_at, :label => t(".published_at"), :data => {:datepicker => "datepicker"}, :value => revision.object.published_at.nil? ? "" : revision.object.published_at.strftime("%Y-%m-%d") %>
7
- <% end %>
2
+ <%= post.text_field :title, label: t(".title"), class: "span6" %>
3
+ <%= post.text_area :content, label: t(".content"), class: "span12 ckeditor", id: "post_content" %>
4
+ <%= post.text_field :url, label: raw(t(".url.caption", default_url: "#{DateTime.now.year}/#{t(".url.generated_title")}", root: monologue.root_path)) %>
5
+ <%= post.text_field :published_at, label: t(".published_at"), data: {datepicker: "datepicker"}, value: post.object.published_at.nil? ? "" : post.object.published_at.strftime("%Y-%m-%d") %>
6
+ <%= post.text_field :tag_list, label: raw(t(".tags")) %>
7
+ <%= post.check_box :published, label: t(".published") %>
8
8
 
9
- <%= post.text_field :tag_list, :label => raw(t(".tags")), :value => tag_list_for(post.object.tags)%>
10
- <%= post.check_box :published, :label => t(".published") %>
11
- <%= post.submit t(".save"), :class => "btn btn-large btn-primary" %> <a href="<%= @revision.full_url %>" target="_blank" class="btn btn-large"><%= t(".preview") %></a>
9
+ <div class="form-actions">
10
+ <%= post.button t(".save"), class: "btn btn-large btn-primary" %>
11
+ <%= post.button t(".preview"), class: "btn btn-large", type: "button", value: "preview"%>
12
+ </div>
13
+
14
+ <div class="post-preview modal-backdrop hide" data-url="<%=admin_post_preview_url%>" data-toggle="post-preview" data-trigger="button[value='preview']">
15
+ <div class="post-preview-inner">
16
+ <div class="navbar pull-right">
17
+ <div class="navbar-inner">
18
+ <span class="brand"><%=t(".preview")%></span>
19
+ <a class="btn btn-primary pull-right" data-dismiss="post-preview"><%=t(".close")%></a>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ <iframe src="" name="preview"></iframe>
24
+ </div>
12
25
 
13
26
  <script>
14
27
  if($.fn.datepicker.defaults_<%= I18n.locale %>){
15
28
  $.fn.datepicker.defaults = $.fn.datepicker.defaults_<%= I18n.locale %>;
16
29
  }
30
+ $("#post_tag_list").select2({tags: <%= Monologue::Tag.all.map{|t| t.name }.to_json.html_safe %> });
17
31
  </script>
@@ -1,4 +1,4 @@
1
- <h1><%= t(".header") %> "<%= @post.active_revision.title %>"</h1>
2
- <%= monologue_admin_form_for ["admin", @post], :method => :put do |post| %>
3
- <%= render :partial => 'form', :locals => {:post => post} %>
1
+ <h1><%= t(".header") %> "<%= @post.title %>"</h1>
2
+ <%= monologue_admin_form_for ["admin", @post], method: :put do |post| %>
3
+ <%= render partial: 'form', locals: {post: post} %>
4
4
  <% end %>
@@ -3,6 +3,7 @@
3
3
  <tr>
4
4
  <th><%= t(".title")%></th>
5
5
  <th><%= t(".status")%></th>
6
+ <th><%= t(".author")%></th>
6
7
  <th></th>
7
8
  <th></th>
8
9
  </tr>
@@ -10,10 +11,11 @@
10
11
  <tbody>
11
12
  <% @posts.each do |post|%>
12
13
  <tr>
13
- <td><%= link_to post.posts_revisions.last.title, edit_admin_post_path(post) %></td>
14
+ <td><%= link_to post.title, edit_admin_post_path(post) %></td>
14
15
  <td><span class="label label-<%= post.published ? "success" : "important" %>"><%= post.published ? t(".published") : t(".not_published") %></span></td>
15
- <td><%= link_to t(".edit"), edit_admin_post_path(post), :class => "btn btn-small" %></td>
16
- <td><%= link_to t(".delete"), ["admin", post],:data => {:confirm => 'Are you sure?'}, :method => :delete, :class => "btn btn-small btn-danger" %></td>
16
+ <td><span><%= post.user.name %></span> </td>
17
+ <td><%= link_to t(".edit"), edit_admin_post_path(post), class: "btn btn-small" %></td>
18
+ <td><%= link_to t(".delete"), [:admin, post],data: {confirm: 'Are you sure?'}, method: :delete, class: "btn btn-small btn-danger" %></td>
17
19
  </tr>
18
20
  <% end %>
19
21
  </tbody>
@@ -1,4 +1,4 @@
1
1
  <h1><%= t(".header") %></h1>
2
2
  <%= monologue_admin_form_for ["admin", @post] do |post| %>
3
- <%= render :partial => 'form', :locals => {:post => post} %>
3
+ <%= render partial: 'form', locals: {post: post} %>
4
4
  <% end %>
@@ -9,5 +9,5 @@
9
9
  <%= label_tag :password, t(".password") %>
10
10
  <%= password_field_tag :password %>
11
11
  </div>
12
- <div class="actions"><%= submit_tag t(".button"), :class => "btn btn-large btn-primary" %></div>
12
+ <div class="actions"><%= submit_tag t(".button"), class: "btn btn-large btn-primary" %></div>
13
13
  <% end %>
@@ -0,0 +1,5 @@
1
+ <%= user.error_messages %>
2
+ <%= user.text_field :name, label: t(".name"), class: "span6" %>
3
+ <%= user.text_field :email, label: t(".email"), class: "span6" %>
4
+ <%= user.password_field :password, label: t(".password"), class: "span6" %>
5
+ <%= user.password_field :password_confirmation, label: t(".password_confirmation"), class: "span6" %>
@@ -1,9 +1,5 @@
1
1
  <h1><%= t(".header") %></h1>
2
- <%= monologue_admin_form_for ["admin", @user], :method => :put do |user| %>
3
- <%= user.error_messages %>
4
- <%= user.text_field :name, :label => t(".name"), :class => "span6" %>
5
- <%= user.text_field :email, :label => t(".email"), :class => "span6" %>
6
- <%= user.password_field :password, :label => t(".password"), :class => "span6" %>
7
- <%= user.password_field :password_confirmation, :label => t(".password_confirmation"), :class => "span6" %>
8
- <%= user.submit t(".save"), :class => "btn btn-large btn-primary" %>
2
+ <%= monologue_admin_form_for [:admin, @user], method: :put do |user| %>
3
+ <%= render :partial => 'form', :locals => { :user => user } %>
4
+ <%= user.submit t(".save"), class: "btn btn-large btn-primary" %>
9
5
  <% end %>
@@ -0,0 +1,28 @@
1
+ <h2><%= link_to t(".create"), new_admin_user_path, class: "btn btn-success" %></h2>
2
+
3
+ <table class="table table-striped table-bordered">
4
+ <thead>
5
+ <tr>
6
+ <th><%= t(".name") %></th>
7
+ <th><%= t(".email") %></th>
8
+ <th></th>
9
+ <th></th>
10
+ </tr>
11
+ </thead>
12
+ <tbody>
13
+ <% @users.each do |user| %>
14
+ <tr>
15
+ <td><%= user.name %></td>
16
+ <td><%= user.email %></td>
17
+ <td><%= link_to t(".edit"), edit_admin_user_path(user), class: "btn btn-small" %></td>
18
+ <td>
19
+ <% if monologue_current_user.can_delete?(user) %>
20
+ <%= link_to t(".delete"), [:admin, user], data: { confirm: 'Are you sure?' }, method: :delete, class: "btn btn-small btn-danger" %>
21
+ <% else %>
22
+ <a href="#" class="btn btn-small btn-danger disabled"><%= t(".delete") %></a>
23
+ <% end %>
24
+ </td>
25
+ </tr>
26
+ <% end %>
27
+ </tbody>
28
+ </table>
@@ -0,0 +1,5 @@
1
+ <h1><%= t(".header") %></h1>
2
+ <%= monologue_admin_form_for [:admin, @user], method: :post do |user| %>
3
+ <%= render :partial => 'form', :locals => { :user => user } %>
4
+ <%= user.submit t(".create"), class: "btn btn-large btn-primary" %>
5
+ <% end %>
@@ -1,9 +1,9 @@
1
1
  <div id="pagination">
2
2
  <% if @posts.total_pages > 1 && @posts.total_pages != @page.to_i %>
3
- <%= link_to t(".older_posts"), posts_page_path(@page.to_i+1), :class => "older_posts" %>
3
+ <%= link_to t(".older_posts"), posts_page_path(@page.to_i+1), class: "older_posts" %>
4
4
  <% end %>
5
5
 
6
6
  <% if @posts.total_pages > 1 && @page.to_i > 1 %>
7
- <%= link_to t(".newer_posts"), posts_page_path(@page.to_i-1), :class => "newer_posts" %>
7
+ <%= link_to t(".newer_posts"), posts_page_path(@page.to_i-1), class: "newer_posts" %>
8
8
  <% end %>
9
9
  </div>
@@ -1,14 +1,12 @@
1
- <% revision = post.active_revision %>
2
1
  <section>
3
- <%= render :partial => 'monologue/posts/revision_header', :locals => {:revision=>revision} %>
2
+ <%= render partial: 'monologue/posts/post_header', locals: {post: post} %>
4
3
 
5
- <div id="content" data-monologue="content">
6
- <%= truncate_html(revision.content, :length => 1000, :omission => '...') %>
4
+ <div class="content" data-monologue="content">
5
+ <%= truncate_html(post.content, length: 1000, omission: '...') %>
7
6
  </div>
8
7
 
9
- <div id="tags" data-monologue="tags">
8
+ <div class="tags" data-monologue="tags">
10
9
  <%= render post.tags %>
11
10
  </div>
12
- <%= link_to t(".readmore"), revision.full_url, :class => "button" %>
13
- </section>
14
-
11
+ <%= link_to t(".readmore"), post.full_url, class: "button" %>
12
+ </section>
@@ -0,0 +1,16 @@
1
+ <header class="post-header">
2
+ <h1><%= link_to post.title, post.full_url %></h1>
3
+ <div class="posted">
4
+ <span data-monologue="time">
5
+ <time datetime="<%= post.published_at %>">
6
+ <%= I18n.localize(post.published_at.to_date, format: :long) %>
7
+ </time>
8
+ </span>
9
+ <span data-monologue="user">
10
+ <%= post.user.name %>
11
+ </span>
12
+ <span data-monologue="disqus">
13
+ <a href="<%= post.full_url + "#disqus_thread" %>"></a>
14
+ </span>
15
+ </div>
16
+ </header>
@@ -2,7 +2,7 @@
2
2
  <span class="social-tagline"><%= t(".tagline") %></span>
3
3
  <div id="social-share">
4
4
  <div id="google-plus">
5
- <!-- GOOGLE +1 -->
5
+ <!-- GOOGLE +1 -->
6
6
  <!-- Placez cette balise là où vous souhaitez positionner le bouton +1. -->
7
7
  <g:plusone size="medium"></g:plusone>
8
8
 
@@ -16,15 +16,15 @@
16
16
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
17
17
  })();
18
18
  </script>
19
- <!-- /GOOGLE +1 -->
19
+ <!-- /GOOGLE +1 -->
20
20
  </div>
21
21
  <div id="twitter">
22
22
  <!-- TWITTER -->
23
23
  <a href="https://twitter.com/share" class="twitter-share-button"
24
24
  data-lang="<%= Monologue.twitter_locale || "en" %>"
25
- data-url="http://<%= request.host_with_port %><%= request.path.gsub("//","/") %>"
25
+ data-url="<%= request.protocol %><%= request.host_with_port %><%= request.path.gsub("//","/") %>"
26
26
  data-via="<%=Monologue.twitter_username%>"
27
- data-text="<%=@revision.title%>"
27
+ data-text="<%=@post.title%>"
28
28
  data-count="horizontal">Tweet</a>
29
29
 
30
30
  <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
@@ -34,7 +34,7 @@
34
34
 
35
35
  <div id="facebook">
36
36
  <!-- FACEBOOK LIKE -->
37
- <div id="fb-root"></div>
37
+ <div id="fb-root"></div>
38
38
  <script>(function(d, s, id) {
39
39
  var js, fjs = d.getElementsByTagName(s)[0];
40
40
  if (d.getElementById(id)) return;
@@ -48,4 +48,4 @@
48
48
 
49
49
 
50
50
  </div>
51
- </footer>
51
+ </footer>
@@ -1,18 +1,17 @@
1
- xml.instruct! :xml, :version => "1.0"
2
- xml.rss :version => "2.0" do
1
+ xml.instruct! :xml, version: "1.0"
2
+ xml.rss version: "2.0" do
3
3
  xml.channel do
4
4
  xml.title Monologue.site_name
5
5
  xml.description Monologue.meta_description
6
6
  xml.link root_url
7
7
 
8
8
  for post in @posts
9
- revision = post.posts_revisions.last
10
9
  xml.item do
11
- xml.title revision.title
12
- xml.description raw(revision.content)
13
- xml.pubDate revision.published_at.to_s(:rfc822)
14
- xml.link Monologue.site_url + revision.full_url
15
- xml.guid Monologue.site_url + revision.full_url
10
+ xml.title post.title
11
+ xml.description raw(post.content)
12
+ xml.pubDate post.published_at.to_s(:rfc822)
13
+ xml.link Monologue.site_url + post.full_url
14
+ xml.guid Monologue.site_url + post.full_url
16
15
  end
17
16
  end
18
17
  end
@@ -1,5 +1,5 @@
1
1
  <%= render @posts %>
2
2
 
3
3
  <% if @page %>
4
- <%= render :partial => "pagination" %>
4
+ <%= render partial: "pagination" %>
5
5
  <% end %>
@@ -1,22 +1,22 @@
1
1
  <% content_for :title do %>
2
- <%= @revision.title %>
2
+ <%= @post.title %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :meta_description do %>
6
- <%= truncate(strip_tags(@revision.content), :length => 155) %>
6
+ <%= truncate(strip_tags(@post.content), length: 155) %>
7
7
  <% end %>
8
8
 
9
9
  <article>
10
- <%= render :partial => 'monologue/posts/revision_header', :locals => {:revision=>@revision}%>
11
- <div id="content" data-monologue="content">
12
- <%= raw @revision.content %>
10
+ <%= render partial: 'monologue/posts/post_header', locals: {post: @post }%>
11
+ <div class="content" data-monologue="content">
12
+ <%= raw @post.content %>
13
13
  </div>
14
14
 
15
- <div id="tags" data-monologue="tags">
16
- <%= render @revision.post.tags %>
15
+ <div class="tags" data-monologue="tags">
16
+ <%= render @post.tags %>
17
17
  </div>
18
18
 
19
- <%= render "social_sharing" %>
19
+ <%= render "monologue/posts/social_sharing" %>
20
20
 
21
21
  <div id="disqus_thread"></div>
22
22
  <%= render 'layouts/monologue/application/disqus_embed' %>
@@ -1,7 +1,7 @@
1
1
  <%= sidebar_section_for(t(".title")) do %>
2
2
  <ul>
3
3
  <% @recent_posts.each do |post| %>
4
- <li><%= link_to post.active_revision.title, post.active_revision.full_url %></li>
4
+ <li><%= link_to post.title, post.full_url %></li>
5
5
  <% end %>
6
6
  </ul>
7
7
  <% end %>
@@ -3,6 +3,6 @@
3
3
  <ul id="latest_tweets">
4
4
  <li id="tweet_template" style="display:none;">{{text}}</li>
5
5
  </ul>
6
- <script type="text/javascript" src="http://twitter.com/statuses/user_timeline/<%= Monologue.twitter_username %>.json?callback=TwitterWidget.callback&amp;count=5"></script>
6
+ <script type="text/javascript" src="https://api.twitter.com/1/statuses/user_timeline/<%= Monologue.twitter_username %>.json?callback=TwitterWidget.callback&amp;count=5"></script>
7
7
  <% end %>
8
8
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <%= sidebar_section_for(t(".title")) do %>
2
2
  <% @tags.each do |tag| %>
3
- <%=link_to tag.name, tag_url(tag), :class =>label_for_tag(tag,@tags_frequency_min,@tags_frequency_max) %>
3
+ <%=link_to tag.name, tag_url(tag), class:label_for_tag(tag,@tags_frequency_min,@tags_frequency_max) %>
4
4
  <% end %>
5
5
  <% end %>
@@ -2,111 +2,90 @@ en:
2
2
  monologue:
3
3
  posts:
4
4
  pagination:
5
- older_posts:
6
- "Older posts"
7
- newer_posts:
8
- "Newer posts"
5
+ older_posts: "Older posts"
6
+ newer_posts: "Newer posts"
9
7
  social_sharing:
10
- tagline:
11
- "Loved what you just read? Share it!"
8
+ tagline: "Loved what you just read? Share it!"
12
9
  post:
13
- readmore:
14
- "Read more"
10
+ readmore: "Read more"
15
11
  "404":
16
- title:
17
- "The page you were looking for doesn't exist."
18
- message:
19
- "You may have mistyped the address or the page may have moved."
12
+ title: "The page you were looking for doesn't exist."
13
+ message: "You may have mistyped the address or the page may have moved."
20
14
  sidebar:
21
15
  categories:
22
- title:
23
- "Categories"
16
+ title: "Categories"
24
17
  latest_posts:
25
- title:
26
- "Latest posts"
18
+ title: "Latest posts"
27
19
  latest_tweets:
28
- title:
29
- "Latest tweets"
20
+ title: "Latest tweets"
30
21
  tag_cloud:
31
- title:
32
- "Tags"
22
+ title: "Tags"
33
23
  tags:
34
24
  show:
35
- showing_post_with_tag:
36
- "Showing posts with label"
37
- show_all_posts:
38
- "Show all posts"
25
+ showing_post_with_tag: "Showing posts with label"
26
+ show_all_posts: "Show all posts"
39
27
  admin:
40
28
  login:
41
- need_auth:
42
- "You must first log in to access admin section."
29
+ need_auth: "You must first log in to access admin section."
43
30
  users:
44
- edit:
45
- header: "Edit your account"
31
+ form:
46
32
  email: "Email"
47
33
  name: "Name"
48
34
  password: "Password"
49
- confirmation: "Password confirmation"
35
+ password_confirmation: "Password confirmation"
36
+ edit:
37
+ header: "Edit your account"
50
38
  save: "Save"
39
+ new:
40
+ create: "Create"
41
+ header: "Add a user"
42
+ create:
43
+ success: "User created"
44
+ delete:
45
+ removed: "User '%{user}' removed successfully"
46
+ failed: "Could not remove user '%{user}'"
47
+ index:
48
+ email: "Email"
49
+ name: "Name"
50
+ edit: "Edit"
51
+ delete: "Delete"
52
+ create: "Create"
51
53
  posts:
52
54
  index:
53
- title:
54
- "Title"
55
- edit:
56
- "Edit"
57
- delete:
58
- "Delete"
59
- published:
60
- "Yes"
61
- not_published:
62
- "Not published"
63
- status:
64
- "Published ?"
55
+ title: "Title"
56
+ edit: "Edit"
57
+ delete: "Delete"
58
+ published: "Yes"
59
+ not_published: "Not published"
60
+ status: "Published ?"
65
61
  new:
66
- header:
67
- "New monologue"
62
+ header: "New monologue"
68
63
  create:
69
- created:
70
- "Monologue created"
71
- created_with_future_date_and_cache:
72
- "Monologue created: posts with a future publication date will not be shown unless cache is cleared on that same day. Cache will most probably be generated before that and won't be refreshed automatically."
64
+ saved: "Monologue created"
65
+ saved_with_future_date_and_cache: "Monologue created: posts with a future publication date will not be shown unless cache is cleared on that same day. Cache will most probably be generated before that and won't be refreshed automatically."
73
66
  edit:
74
- header:
75
- "Edit"
67
+ header: "Edit"
76
68
  update:
77
- saved_with_future_date_and_cache:
78
- "Monologue saved: posts with a future publication date will not be shown unless cache is cleared on that same day. Cache will most probably be generated before that and won't be refreshed automatically."
79
- saved:
80
- "Monologue saved"
69
+ saved_with_future_date_and_cache: "Monologue saved: posts with a future publication date will not be shown unless cache is cleared on that same day. Cache will most probably be generated before that and won't be refreshed automatically."
70
+ saved: "Monologue saved"
81
71
  delete:
82
- removed:
83
- "Monologue removed"
84
- fail:
85
- "Failed to remove monologue!"
72
+ removed: "Monologue removed"
73
+ fail: "Failed to remove monologue!"
86
74
  form:
87
- title:
88
- "Title"
89
- content:
90
- "Content"
75
+ title: "Title"
76
+ content: "Content"
91
77
  url:
92
- caption:
93
- "URL<br/><i> This will be filled by default with '%s'. You can choose your own URL. Do not add '%s' at the beginning of your URL.</i>"
94
- generated_title:
95
- "your-post-title"
96
- published_at:
97
- "Published at"
98
- published:
99
- "Published"
100
- save:
101
- "Save"
102
- preview:
103
- "Preview"
104
- tags:
105
- "Tags <br/><i>Separate tags by commas</i>"
78
+ caption: "URL<br/><i> This will be filled by default with '%{default_url}'. You can choose your own URL. Do not add '%{root}' at the beginning of your URL.</i>"
79
+ generated_title: "your-post-title"
80
+ published_at: "Published at"
81
+ published: "Published"
82
+ save: "Save"
83
+ preview: "Preview"
84
+ close: "Close"
85
+ tags: "Tags"
106
86
  comments:
107
87
  show:
108
- recent_comments:
109
- "Recent comments"
88
+ recent_comments: "Recent comments"
110
89
  cache:
111
90
  show:
112
91
  title: "Manage cache"
@@ -114,44 +93,37 @@ en:
114
93
  files_in_cache: "Here are the files actually cached:"
115
94
  no_files_are_cached: "There are actually no file in cache."
116
95
  delete: "Completely wipe cache?"
117
- confirm: 'Are you sure you want to competely clear cache?'
96
+ confirm: 'Are you sure you want to completely clear cache?'
118
97
  cache_wiped: "Cache was wiped!"
119
98
  how_to_enable:
120
99
  warning: "You can't manage cache!"
121
100
  explanations: "There are certain settings that are not set correctly to be able to use Monologue's basic cache. Please review configuration documentation."
122
101
  sessions:
123
102
  new:
124
- title:
125
- "Sign in"
126
- email:
127
- "Email"
128
- password:
129
- "Password"
130
- button:
131
- "Log in"
103
+ title: "Sign in"
104
+ email: "Email"
105
+ password: "Password"
106
+ button: "Log in"
132
107
  messages:
133
- invalid:
134
- "Invalid email or password"
135
- logged_in:
136
- "Logged in!"
137
- logged_out:
138
- "Logged out!"
108
+ invalid: "Invalid email or password"
109
+ logged_in: "Logged in!"
110
+ logged_out: "Logged out!"
139
111
  layouts:
140
112
  monologue:
141
113
  admin:
142
114
  nav_bar:
143
- add_a_monologue:
144
- "Add a monologue"
145
- list_monologues:
146
- "List of monologues"
147
- comments:
148
- "Comments"
115
+ add_a_monologue: "Add a monologue"
116
+ list_monologues: "List of monologues"
117
+ comments: "Comments"
149
118
  cache: "Manage cache"
150
119
  edit_user_info: "My account"
151
120
  settings: "Settings"
152
- log_out:
153
- "Log out"
121
+ log_out: "Log out"
122
+ users: "Users"
154
123
  activerecord:
124
+ attributes:
125
+ monologue/user:
126
+ password_digest: "Password confirmation"
155
127
  errors:
156
128
  format: "%{message}"
157
129
  errors:
@@ -159,21 +131,18 @@ en:
159
131
  errors:
160
132
  models:
161
133
  full_messages: "%{message}"
162
- monologue/posts_revision:
163
- blank:
164
- "%{attribute} is required"
134
+ monologue/post:
135
+ blank: "%{attribute} is required"
136
+ taken: "%{attribute} is already used by another post"
165
137
  attributes:
166
138
  published_at:
167
- blank:
168
- "'Published at' is required"
139
+ blank: "'Published at' is required"
169
140
  url:
170
- start_with_slash:
171
- "URL can't start with a slash ('/')"
172
- unique:
173
- "URL is already used by another post"
141
+ start_with_slash: "URL can't start with a slash ('/')"
142
+
174
143
  monologue/user:
175
- blank:
176
- "%{attribute} is required"
144
+ blank: "%{attribute} is required"
145
+ taken: "%{attribute} has already been taken"
177
146
  attributes:
178
147
  password:
179
- confirmation: "Password and confirmation doesn't match."
148
+ confirmation: "Password and confirmation doesn't match."