diff options
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin/blog/_submenu.html.erb | 65 | ||||
-rw-r--r-- | app/views/admin/blog/posts/_form.html.erb | 6 | ||||
-rw-r--r-- | app/views/admin/blog/posts/_post.html.erb | 2 | ||||
-rw-r--r-- | app/views/admin/blog/posts/index.html.erb | 6 | ||||
-rw-r--r-- | app/views/admin/blog/posts/uncategorized.html.erb | 26 | ||||
-rw-r--r-- | app/views/blog/posts/_post.html.erb | 2 | ||||
-rw-r--r-- | app/views/blog/posts/archive.html.erb | 3 | ||||
-rw-r--r-- | app/views/blog/posts/index.html.erb | 6 | ||||
-rw-r--r-- | app/views/blog/posts/show.html.erb | 8 | ||||
-rw-r--r-- | app/views/blog/posts/tagged.html.erb | 22 | ||||
-rw-r--r-- | app/views/blog/shared/_categories.html.erb | 18 | ||||
-rw-r--r-- | app/views/blog/shared/_post.html.erb | 23 | ||||
-rw-r--r-- | app/views/blog/shared/_posts.html.erb | 18 | ||||
-rw-r--r-- | app/views/blog/shared/_tags.html.erb | 8 |
14 files changed, 149 insertions, 64 deletions
diff --git a/app/views/admin/blog/_submenu.html.erb b/app/views/admin/blog/_submenu.html.erb index ab662e7..b93e30d 100644 --- a/app/views/admin/blog/_submenu.html.erb +++ b/app/views/admin/blog/_submenu.html.erb @@ -1,6 +1,6 @@ <nav id='actions' class='multilist'> <ul class='search_list'> - <li> + <li class='not_a_link'> <%= render :partial => "/shared/admin/search", :locals => { :url => admin_blog_posts_url @@ -9,7 +9,7 @@ </ul> <ul class='collapsible_menu'> - <li> + <li class='not_a_link'> <%= link_to t('.posts.title'), '#', :class => 'page_copy_icon' %> </li> @@ -18,37 +18,42 @@ :class => 'page_icon' %> </li> <li> - <%= link_to t('.posts.new'), new_admin_blog_post_url, - :class => 'page_add_icon' %> - </li> - </ul> - - <ul class='collapsible_menu'> - <li> - <% if BlogComment.unmoderated.any? %> - <% title = t('.comments.title_with_count', :new_count => BlogComment.unmoderated.size) %> - <% else %> - <% title = t('.comments.title') %> - <% end %> - <%= link_to title, '#', - :class => 'comments_icon' %> - </li> - <li> - <%= link_to t('.comments.new'), admin_blog_comments_path, - :class => 'comment_icon' %> - </li> - <li> - <%= link_to t('.comments.approved'), approved_admin_blog_comments_path, - :class => 'comment_tick_icon' %> + <%= link_to t('.posts.uncategorized'), uncategorized_admin_blog_posts_url, + :class => 'page_icon' %> </li> <li> - <%= link_to t('.comments.rejected'), rejected_admin_blog_comments_path, - :class => 'comment_cross_icon' %> + <%= link_to t('.posts.new'), new_admin_blog_post_url, + :class => 'page_add_icon' %> </li> </ul> + <% if BlogPost.comments_allowed? %> + <ul class='collapsible_menu'> + <li class='not_a_link'> + <% if BlogComment.unmoderated.any? %> + <% title = t('.comments.title_with_count', :new_count => BlogComment.unmoderated.size) %> + <% else %> + <% title = t('.comments.title') %> + <% end %> + <%= link_to title, '#', + :class => 'comments_icon' %> + </li> + <li> + <%= link_to t('.comments.new'), admin_blog_comments_path, + :class => 'comment_icon' %> + </li> + <li> + <%= link_to t('.comments.approved'), approved_admin_blog_comments_path, + :class => 'comment_tick_icon' %> + </li> + <li> + <%= link_to t('.comments.rejected'), rejected_admin_blog_comments_path, + :class => 'comment_cross_icon' %> + </li> + </ul> + <% end %> <ul class='collapsible_menu'> - <li> + <li class='not_a_link'> <%= link_to t('.categories.title'), '#', :class => 'folder_icon' %> </li> @@ -63,11 +68,15 @@ </ul> <ul class='collapsible_menu'> - <li> + <li class='not_a_link'> <%= link_to t('.settings.title'), admin_blog_settings_path, :class => 'settings_icon' %> </li> <li> + <%= link_to t('.settings.comments'), comments_admin_blog_settings_url, + :class => "#{BlogPost.comments_allowed? ? 'success' : 'failure'}_icon" %> + </li> + <li> <%= link_to t('.settings.moderation'), moderation_admin_blog_settings_url, :class => "#{BlogComment::Moderation.enabled? ? 'success' : 'failure'}_icon" %> </li> diff --git a/app/views/admin/blog/posts/_form.html.erb b/app/views/admin/blog/posts/_form.html.erb index 0dc6e9b..3c0a351 100644 --- a/app/views/admin/blog/posts/_form.html.erb +++ b/app/views/admin/blog/posts/_form.html.erb @@ -14,6 +14,12 @@ <%= f.label :body -%> <%= f.text_area :body, :rows => 20, :class => 'wymeditor widest' -%> </div> + + <div class='field'> + <%= f.label :tag_list, "Tags" -%> + <%= f.text_field :tag_list, :class => 'larger' -%> + </div> + <div id='more_options_field'> <p> <%= link_to t('.advanced_options'), "#", diff --git a/app/views/admin/blog/posts/_post.html.erb b/app/views/admin/blog/posts/_post.html.erb index 1f51932..1226082 100644 --- a/app/views/admin/blog/posts/_post.html.erb +++ b/app/views/admin/blog/posts/_post.html.erb @@ -1,7 +1,7 @@ <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(post) -%>"> <span class='title'> <%= post.title %> - <span class="preview"> </span> + <span class="preview"><%= post.published_at.try(:strftime, '%b %d, %Y') || 'draft' %><%= " by #{post.author.username}" if post.author.present? %></span> </span> <span class='actions'> <%= link_to refinery_icon_tag("application_go.png"), blog_post_url(post), diff --git a/app/views/admin/blog/posts/index.html.erb b/app/views/admin/blog/posts/index.html.erb index 888daab..f9baaac 100644 --- a/app/views/admin/blog/posts/index.html.erb +++ b/app/views/admin/blog/posts/index.html.erb @@ -3,10 +3,12 @@ <% if searching? %> <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2> <% if @blog_posts.any? %> - <%= render :partial => "blog_posts", + <ul> + <%= render :partial => "post", :collection => @blog_posts %> + </ul> <% else %> - <p><%= t('admin.search_no_results') %></p> + <p><%= t('shared.admin.search.no_results') %></p> <% end %> <% else %> <% if @blog_posts.any? %> diff --git a/app/views/admin/blog/posts/uncategorized.html.erb b/app/views/admin/blog/posts/uncategorized.html.erb new file mode 100644 index 0000000..888daab --- /dev/null +++ b/app/views/admin/blog/posts/uncategorized.html.erb @@ -0,0 +1,26 @@ +<%= render :partial => '/admin/blog/submenu' %> +<div id='records'> + <% if searching? %> + <h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2> + <% if @blog_posts.any? %> + <%= render :partial => "blog_posts", + :collection => @blog_posts %> + <% else %> + <p><%= t('admin.search_no_results') %></p> + <% end %> + <% else %> + <% if @blog_posts.any? %> + <%= will_paginate @blog_posts %> + + <%= render :partial => "sortable_list" %> + + <%= will_paginate @blog_posts %> + <% else %> + <p> + <strong> + <%= t('.no_items_yet', :create => t('admin.blog.submenu.posts.new')) %> + </strong> + </p> + <% end %> + <% end %> +</div> diff --git a/app/views/blog/posts/_post.html.erb b/app/views/blog/posts/_post.html.erb index 6a16631..d1c204e 100644 --- a/app/views/blog/posts/_post.html.erb +++ b/app/views/blog/posts/_post.html.erb @@ -9,7 +9,7 @@ <details> <time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'> <%= t('blog.shared.posts.created_at', :when => l(@blog_post.published_at.to_date, :format => :short)) %>. - </time> + </time><%= " by #{@blog_post.author.username}" if @blog_post.author.present? %> <% if (categories = @blog_post.categories).any? %> <aside class='filed_in'> <%= t('blog.posts.show.filed_in') %> diff --git a/app/views/blog/posts/archive.html.erb b/app/views/blog/posts/archive.html.erb index d44aa7f..a2044e8 100644 --- a/app/views/blog/posts/archive.html.erb +++ b/app/views/blog/posts/archive.html.erb @@ -1,5 +1,4 @@ <% content_for :body_content_left do %> - <%= @page[Page.default_parts.first.to_sym] %> <h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1> <% if @blog_posts.any? %> <section id="blog_posts"> @@ -11,8 +10,8 @@ <% end %> <% content_for :body_content_right do %> - <%= @page[Page.default_parts.second.to_sym] %> <%= render :partial => "/blog/shared/categories" %> + <%= render :partial => "/blog/shared/tags" %> <%= render :partial => "/blog/shared/rss_feed" %> <%= blog_archive_list %> <% end %> diff --git a/app/views/blog/posts/index.html.erb b/app/views/blog/posts/index.html.erb index 766d689..8c3801a 100644 --- a/app/views/blog/posts/index.html.erb +++ b/app/views/blog/posts/index.html.erb @@ -1,9 +1,10 @@ <% content_for :body_content_left do %> - <%= @page[Page.default_parts.first.to_sym].html_safe if Page.default_parts.any? %> + <%=raw @page[Page.default_parts.first.to_sym] if Page.default_parts.any? %> <% if @blog_posts.any? %> <section id="blog_posts"> <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> + <%= will_paginate @blog_posts %> </section> <% else %> <p><%= t('.no_blog_articles_yet') %></p> @@ -11,9 +12,10 @@ <% end %> <% content_for :body_content_right do %> - <%= @page[Page.default_parts.second.to_sym].html_safe if Page.default_parts.many? %> + <%=raw @page[Page.default_parts.second.to_sym] if Page.default_parts.many? %> <%= render :partial => "/blog/shared/categories" %> + <%= render :partial => "/blog/shared/tags" %> <%= render :partial => "/blog/shared/rss_feed" %> <%= blog_archive_list %> <% end %> diff --git a/app/views/blog/posts/show.html.erb b/app/views/blog/posts/show.html.erb index 5ac4c76..92898a4 100644 --- a/app/views/blog/posts/show.html.erb +++ b/app/views/blog/posts/show.html.erb @@ -6,7 +6,6 @@ <% if BlogPost.comments_allowed? %> <aside id="comments"> <h2><%= t('.comments.title') %></h2> - <% if (comments = @blog_post.comments.approved).any? %> <%= render :partial => "comment", :collection => comments %> <% else %> @@ -50,6 +49,7 @@ <% content_for :body_content_right do %> <%= render :partial => "/blog/shared/categories" %> + <%= render :partial => "/blog/shared/tags" %> <%= render :partial => "/blog/shared/posts" %> <%= render :partial => "/blog/shared/rss_feed" %> <%= blog_archive_list %> @@ -61,7 +61,8 @@ <% content_for :head_libraries, jquery_include_tags(:jquery_ui => false) %> <% content_for :head do %> <%= stylesheet_link_tag 'refinerycms-blog' %> - <%= javascript_include_tag('refinerycms-blog') %> + <%# enable AJAX'd post nav at your own risk until html5 history API implemented. %> + <%#= javascript_include_tag('refinerycms-blog') %> <% if BlogPost::ShareThis.enabled? %> <script src="http://w.sharethis.com/button/buttons.js"></script> <script>stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});</script> @@ -71,7 +72,8 @@ <% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> <% content_for :before_javascript_libraries, jquery_include_tags(:jquery_ui => false) %> <% content_for :javascripts do %> - <%= javascript_include_tag 'refinerycms-blog' %> + <%# enable AJAX'd post nav at your own risk until html5 history API implemented. %> + <%#= javascript_include_tag('refinerycms-blog') %> <script src="http://w.sharethis.com/button/buttons.js"></script> <script>stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});</script> <% end if BlogPost::ShareThis.enabled? %> diff --git a/app/views/blog/posts/tagged.html.erb b/app/views/blog/posts/tagged.html.erb new file mode 100644 index 0000000..29de791 --- /dev/null +++ b/app/views/blog/posts/tagged.html.erb @@ -0,0 +1,22 @@ +<% content_for :body_content_title, "Posts tagged “#{@tag_name.titleize}”".html_safe -%> + +<% content_for :body_content_left do %> + <% if @blog_posts.any? %> + <section id="blog_posts"> + <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> + <%= will_paginate @blog_posts %> + </section> + <% else %> + <p><%= t('.no_blog_articles_yet') %></p> + <% end %> +<% end %> + +<% content_for :body_content_right do %> + <%= render :partial => "/blog/shared/categories" %> + <%= render :partial => "/blog/shared/tags" %> + <%= render :partial => "/blog/shared/rss_feed" %> + <%= blog_archive_list %> +<% end %> + +<%= render :partial => "/shared/content_page" %> +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/blog/shared/_categories.html.erb b/app/views/blog/shared/_categories.html.erb index 675271c..05cc53f 100644 --- a/app/views/blog/shared/_categories.html.erb +++ b/app/views/blog/shared/_categories.html.erb @@ -1,8 +1,10 @@ -<h2><%= t('.title') %></h2> -<ul id='categories'> - <% @blog_categories.each do |category| %> - <li<%= " class='selected'" if @category.present? and @category.id == category.id %>> - <%= link_to "#{category.title} (#{category.post_count})", blog_category_url(category) %> - </li> - <% end %> -</ul> +<% if @blog_categories.any? %> + <h2><%= t('.title') %></h2> + <ul id='categories'> + <% @blog_categories.each do |category| %> + <li<%= " class='selected'" if @category.present? and @category.id == category.id %>> + <%= link_to "#{category.title} (#{category.post_count})", blog_category_url(category) %> + </li> + <% end %> + </ul> +<% end %>
\ No newline at end of file diff --git a/app/views/blog/shared/_post.html.erb b/app/views/blog/shared/_post.html.erb index 16483a5..716c1ad 100644 --- a/app/views/blog/shared/_post.html.erb +++ b/app/views/blog/shared/_post.html.erb @@ -5,13 +5,17 @@ <details> <time datetime="<%=l post.published_at.to_date, :format => :default %>" class='posted_at'> <%= t('blog.shared.posts.created_at', :when => l(post.published_at.to_date, :format => :short)) %>. - </time> + </time><%= " by #{post.author.username}" if post.author.present? %> <% if (categories = post.categories).any? %> <aside class='filed_in'> <%= t('filed_in', :scope => 'blog.posts.show') %> - <% categories.each_with_index do |category, index| %> - <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %> - <% end %> + <%=raw categories.collect { |category| link_to category.title, blog_category_url(category) }.to_sentence %> + </aside> + <% end %> + <% if (tags = post.tag_list).any? %> + <aside class='tagged'> + <%= t('tagged', :scope => 'blog.posts.show') %> + <%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.parameterize) }.to_sentence %> </aside> <% end %> </details> @@ -24,15 +28,16 @@ <footer> <p> <%= link_to t('blog.shared.posts.read_more'), blog_post_url(post) %> - - <aside class='comment_count'> + </p> + <aside class='comment_count'> + <% if BlogPost.comments_allowed? %> <% if post.comments.any? %> (<%= pluralize(post.comments.approved.count, t('blog.shared.comments.singular')) %>) <% else %> - (<%= t('blog.shared.comments.none') %>) + (<%= t('blog.shared.comments.none') %>) <% end %> - </aside> - </p> + <% end %> + </aside> </footer> </article> <% end %> diff --git a/app/views/blog/shared/_posts.html.erb b/app/views/blog/shared/_posts.html.erb index cbf865f..24a8199 100644 --- a/app/views/blog/shared/_posts.html.erb +++ b/app/views/blog/shared/_posts.html.erb @@ -1,8 +1,10 @@ -<h2><%= t('.other') %></h2> -<ul id="blog_posts"> - <% @blog_posts.each do |blog_post| %> - <li class='clearfix'> - <%= link_to blog_post.title, blog_post_url(blog_post) %> - </li> - <% end %> -</ul> +<% if @blog_posts.many? %> + <h2><%= t('.other') %></h2> + <ul id="blog_posts"> + <% @blog_posts.each do |blog_post| %> + <li class='clearfix'> + <%= link_to blog_post.title, blog_post_url(blog_post) %> + </li> + <% end %> + </ul> +<% end %>
\ No newline at end of file diff --git a/app/views/blog/shared/_tags.html.erb b/app/views/blog/shared/_tags.html.erb new file mode 100644 index 0000000..f8833f1 --- /dev/null +++ b/app/views/blog/shared/_tags.html.erb @@ -0,0 +1,8 @@ +<% unless @tags.nil? %> + <h2><%= t('.title') %></h2> + <nav id='tags'> + <% tag_cloud(@tags, %w(tag1 tag2 tag3 tag4)) do |tag, css_class| %> + <%= link_to tag.name, tagged_posts_path(tag.name.parameterize), :class => css_class %> + <% end %> + </nav> +<% end %>
\ No newline at end of file |