diff options
author | Philip Arndt <parndt@gmail.com> | 2010-08-09 21:53:34 +1200 |
---|---|---|
committer | Philip Arndt <parndt@gmail.com> | 2010-08-09 21:53:34 +1200 |
commit | 351bdd049e2b6ebad577580d3c186db4a47903a0 (patch) | |
tree | db76e204a5ab994e9a074932b173862713dca021 /app | |
parent | 7ee1410c9689639ead4df51ba21dcb69840a4519 (diff) | |
download | refinerycms-blog-351bdd049e2b6ebad577580d3c186db4a47903a0.tar.gz refinerycms-blog-351bdd049e2b6ebad577580d3c186db4a47903a0.tar.bz2 refinerycms-blog-351bdd049e2b6ebad577580d3c186db4a47903a0.zip |
Animated submenu and hide subsections of categories and settings by default.
Diffstat (limited to 'app')
-rw-r--r-- | app/views/admin/blog/_submenu.html.erb | 46 | ||||
-rw-r--r-- | app/views/admin/blog/comments/index.html.erb | 10 |
2 files changed, 37 insertions, 19 deletions
diff --git a/app/views/admin/blog/_submenu.html.erb b/app/views/admin/blog/_submenu.html.erb index 4c76227..350754f 100644 --- a/app/views/admin/blog/_submenu.html.erb +++ b/app/views/admin/blog/_submenu.html.erb @@ -6,6 +6,12 @@ :url => admin_blog_posts_url } %> </li> + </ul> + + <ul> + <li<%= " class='selected'" if request.path == admin_blog_posts_path %>> + <%= link_to t('.posts.title'), admin_blog_posts_path %> + </li> <li> <%= link_to t('.posts.new'), new_admin_blog_post_url, :class => "add_icon" %> @@ -13,19 +19,19 @@ </ul> <ul> - <li> - <%= link_to t('.comments.new'), admin_blog_comments_url %> + <li<%= " class='selected'" if request.path == admin_blog_comments_path %>> + <%= link_to t('.comments.new'), admin_blog_comments_path %> </li> - <li> - <%= link_to t('.comments.approved'), approved_admin_blog_comments_url %> + <li<%= " class='selected'" if request.path == approved_admin_blog_comments_path %>> + <%= link_to t('.comments.approved'), approved_admin_blog_comments_path %> </li> - <li> - <%= link_to t('.comments.rejected'), rejected_admin_blog_comments_url %> + <li<%= " class='selected'" if request.path == rejected_admin_blog_comments_path %>> + <%= link_to t('.comments.rejected'), rejected_admin_blog_comments_path %> </li> </ul> - <ul> - <li> + <ul class='collapsible_menu'> + <li<%= " class='selected'" if request.path == admin_blog_categories_path %>> <%= link_to t('.categories.title'), admin_blog_categories_url %> </li> <li> @@ -35,10 +41,10 @@ <%= link_to t('.categories.new'), new_admin_blog_category_url(:dialog => true) %> </li> </ul> - - <ul> - <li> - <%= link_to t('.settings.title'), admin_blog_settings_url %> + + <ul class='collapsible_menu'> + <li<%= " class='selected'" if request.path == admin_blog_settings_path %>> + <%= link_to t('.settings.title'), admin_blog_settings_path %> </li> <li> <%= link_to t('.settings.moderation'), moderation_admin_blog_settings_url %> @@ -48,4 +54,18 @@ </li> </ul> -</div>
\ No newline at end of file +</div> +<% content_for :head do %> + <script type='text/javascript'> + $(document).ready(function(){ + $('ul.collapsible_menu').each(function(i, ul) { + (first_li = $(this).children('li:first')).after(div=$("<div style='display: none'></div>")); + $(this).children('li:not(:first)').appendTo(div); + first_li.click(function(e){ + $(this).next('div').animate({opacity: 'toggle', height: 'toggle'}, 250); + e.preventDefault(); + }); + }); + }); + </script> +<% end %>
\ No newline at end of file diff --git a/app/views/admin/blog/comments/index.html.erb b/app/views/admin/blog/comments/index.html.erb index e2835cd..6b5a3e8 100644 --- a/app/views/admin/blog/comments/index.html.erb +++ b/app/views/admin/blog/comments/index.html.erb @@ -20,12 +20,10 @@ :previous_label => '«', :next_label => '»' %> <% else %> - <p> - <strong> - <%= t('.no_items_yet', - :type => (t("admin.blog.submenu.comments.#{action_name}").downcase unless action_name == 'index')) %> - </strong> - </p> + <h3> + <%= t('.no_items_yet', + :type => (t("admin.blog.submenu.comments.#{action_name}").downcase unless action_name == 'index')) %> + </h3> <% end %> <% end %> </div>
\ No newline at end of file |