From 324ed57f63139d6599ff23fe9916fc2ee4f6a475 Mon Sep 17 00:00:00 2001 From: TFG Date: Wed, 27 Apr 2011 13:18:02 +0800 Subject: [PATCH] Adjustments to other views to use the new yield :submenu and yield :actions --- .../admin/asset_collections/edit.html.haml | 3 + .../admin/asset_collections/index.html.haml | 3 + .../admin/asset_collections/new.html.haml | 3 + app/views/admin/assets/edit.html.haml | 3 + app/views/admin/assets/new.html.haml | 3 + app/views/admin/content_types/edit.html.haml | 3 + app/views/admin/content_types/new.html.haml | 3 + app/views/admin/contents/edit.html.haml | 5 +- app/views/admin/contents/index.html.haml | 5 +- app/views/admin/contents/new.html.haml | 3 + app/views/admin/layouts/application.html.haml | 7 ++- app/views/admin/pages/edit.html.haml | 3 + app/views/admin/pages/index.html.haml | 3 + app/views/admin/pages/new.html.haml | 3 + app/views/admin/shared/menu/_assets.html.haml | 10 +--- .../admin/shared/menu/_contents.html.haml | 56 +++++++++---------- .../admin/shared/menu/_settings.html.haml | 9 ++- 17 files changed, 80 insertions(+), 45 deletions(-) diff --git a/app/views/admin/asset_collections/edit.html.haml b/app/views/admin/asset_collections/edit.html.haml index abc2ffe7..e033c8d4 100644 --- a/app/views/admin/asset_collections/edit.html.haml +++ b/app/views/admin/asset_collections/edit.html.haml @@ -6,6 +6,9 @@ - content_for :submenu do = render 'admin/shared/menu/assets' + +- content_for :actions do + = render 'admin/shared/actions/assets' %p!= t('.help') diff --git a/app/views/admin/asset_collections/index.html.haml b/app/views/admin/asset_collections/index.html.haml index 3c862d50..5be0af5c 100644 --- a/app/views/admin/asset_collections/index.html.haml +++ b/app/views/admin/asset_collections/index.html.haml @@ -2,6 +2,9 @@ - content_for :submenu do = render 'admin/shared/menu/assets' + +- content_for :actions do + = render 'admin/shared/actions/assets' %p!= t('.help') diff --git a/app/views/admin/asset_collections/new.html.haml b/app/views/admin/asset_collections/new.html.haml index d27e15b8..32a360b8 100644 --- a/app/views/admin/asset_collections/new.html.haml +++ b/app/views/admin/asset_collections/new.html.haml @@ -5,6 +5,9 @@ - content_for :submenu do = render 'admin/shared/menu/assets' + +- content_for :actions do + = render 'admin/shared/actions/assets' %p!= t('.help') diff --git a/app/views/admin/assets/edit.html.haml b/app/views/admin/assets/edit.html.haml index 1c14b240..26aeef17 100644 --- a/app/views/admin/assets/edit.html.haml +++ b/app/views/admin/assets/edit.html.haml @@ -2,6 +2,9 @@ - content_for :submenu do = render 'admin/shared/menu/assets' + +- content_for :actions do + = render 'admin/shared/actions/assets' - content_for :buttons do = admin_button_tag t('admin.asset_collections.edit.add_asset'), new_admin_asset_url(@asset_collection), :class => 'new' diff --git a/app/views/admin/assets/new.html.haml b/app/views/admin/assets/new.html.haml index 0e5fb586..c6292abd 100644 --- a/app/views/admin/assets/new.html.haml +++ b/app/views/admin/assets/new.html.haml @@ -2,6 +2,9 @@ - content_for :submenu do = render 'admin/shared/menu/assets' + +- content_for :actions do + = render 'admin/shared/actions/assets' %p!= t('.help') diff --git a/app/views/admin/content_types/edit.html.haml b/app/views/admin/content_types/edit.html.haml index fe5466c8..485a87d6 100644 --- a/app/views/admin/content_types/edit.html.haml +++ b/app/views/admin/content_types/edit.html.haml @@ -2,6 +2,9 @@ - content_for :submenu do = render 'admin/shared/menu/contents' + +- content_for :actions do + = render 'admin/shared/actions/contents' - content_for :buttons do = admin_button_tag :show_items, admin_contents_url(@content_type.slug), :class => 'show' diff --git a/app/views/admin/content_types/new.html.haml b/app/views/admin/content_types/new.html.haml index 955e938a..3fb7a16e 100644 --- a/app/views/admin/content_types/new.html.haml +++ b/app/views/admin/content_types/new.html.haml @@ -2,6 +2,9 @@ - content_for :submenu do = render 'admin/shared/menu/contents' + +- content_for :actions do + = render 'admin/shared/actions/contents' %p!= t('.help') diff --git a/app/views/admin/contents/edit.html.haml b/app/views/admin/contents/edit.html.haml index d1cde807..39a45487 100644 --- a/app/views/admin/contents/edit.html.haml +++ b/app/views/admin/contents/edit.html.haml @@ -1,7 +1,10 @@ - title t('.title', :type => @content_type.name.capitalize) - + - content_for :submenu do = render 'admin/shared/menu/contents' + +- content_for :actions do + = render 'admin/shared/actions/contents' - content_for :buttons do = admin_button_tag t('admin.contents.index.edit'), edit_admin_content_type_url(@content_type), :class => 'edit' diff --git a/app/views/admin/contents/index.html.haml b/app/views/admin/contents/index.html.haml index 4c666bc2..320a4f47 100644 --- a/app/views/admin/contents/index.html.haml +++ b/app/views/admin/contents/index.html.haml @@ -1,7 +1,10 @@ -- title t('.title', :type => @content_type.name.capitalize) +- title t('.title', :type => @content_type.name.capitalize) q - content_for :submenu do = render 'admin/shared/menu/contents' + +- content_for :actions do + = render 'admin/shared/actions/contents' - content_for :head do = include_javascripts :contents diff --git a/app/views/admin/contents/new.html.haml b/app/views/admin/contents/new.html.haml index d3befe1d..874d366b 100644 --- a/app/views/admin/contents/new.html.haml +++ b/app/views/admin/contents/new.html.haml @@ -2,6 +2,9 @@ - content_for :submenu do = render 'admin/shared/menu/contents' + +- content_for :actions do + = render 'admin/shared/actions/contents' - content_for :buttons do = admin_button_tag t('admin.contents.index.edit'), edit_admin_content_type_url(@content_type), :class => 'edit' diff --git a/app/views/admin/layouts/application.html.haml b/app/views/admin/layouts/application.html.haml index b9a6d287..028e7d6d 100644 --- a/app/views/admin/layouts/application.html.haml +++ b/app/views/admin/layouts/application.html.haml @@ -11,7 +11,12 @@ = render 'admin/shared/menu' #submenu - = yield :submenu + %ul + = yield :submenu + + - if content_for? :actions + .action + = yield :actions #content .inner diff --git a/app/views/admin/pages/edit.html.haml b/app/views/admin/pages/edit.html.haml index f25197a2..81f866e8 100644 --- a/app/views/admin/pages/edit.html.haml +++ b/app/views/admin/pages/edit.html.haml @@ -2,6 +2,9 @@ - content_for :submenu do = render 'admin/shared/menu/contents' + +- content_for :actions do + = render 'admin/shared/actions/contents' - content_for :buttons do = admin_button_tag :show, "/#{@page.fullpath}", :class => 'show' diff --git a/app/views/admin/pages/index.html.haml b/app/views/admin/pages/index.html.haml index b8a3e626..0e4957d8 100644 --- a/app/views/admin/pages/index.html.haml +++ b/app/views/admin/pages/index.html.haml @@ -5,6 +5,9 @@ - content_for :submenu do = render 'admin/shared/menu/contents' + +- content_for :actions do + = render 'admin/shared/actions/contents' - content_for :buttons do = admin_button_tag :new, new_admin_page_url, :class => 'new' diff --git a/app/views/admin/pages/new.html.haml b/app/views/admin/pages/new.html.haml index c9b21346..6f75a40b 100644 --- a/app/views/admin/pages/new.html.haml +++ b/app/views/admin/pages/new.html.haml @@ -2,6 +2,9 @@ - content_for :submenu do = render 'admin/shared/menu/contents' + +- content_for :actions do + = render 'admin/shared/actions/contents' %p!= t('.help') diff --git a/app/views/admin/shared/menu/_assets.html.haml b/app/views/admin/shared/menu/_assets.html.haml index 472b45f2..6997d55e 100644 --- a/app/views/admin/shared/menu/_assets.html.haml +++ b/app/views/admin/shared/menu/_assets.html.haml @@ -1,7 +1,3 @@ -%ul - - @asset_collections.each do |c| - %li - = link_to content_tag(:span, truncate(c.name, :length => 20)), edit_admin_asset_collection_url(c), :class => "#{'on' if @asset_collection.id == c.id}" - -.action - = link_to content_tag(:span, t('admin.asset_collections.index.new')), new_admin_asset_collection_url \ No newline at end of file +- @asset_collections.each do |c| + %li + = link_to content_tag(:span, truncate(c.name, :length => 20)), edit_admin_asset_collection_url(c), :class => "#{'on' if @asset_collection.id == c.id}" \ No newline at end of file diff --git a/app/views/admin/shared/menu/_contents.html.haml b/app/views/admin/shared/menu/_contents.html.haml index c8337e94..946d23b2 100644 --- a/app/views/admin/shared/menu/_contents.html.haml +++ b/app/views/admin/shared/menu/_contents.html.haml @@ -1,32 +1,28 @@ -%ul - = admin_submenu_item 'pages', admin_pages_url do - .header - %p= link_to t('admin.pages.index.new'), new_admin_page_url - .inner - %h2!= t('admin.pages.index.lastest_items') - %ul - - current_site.pages.latest_updated.minimal_attributes.each do |page| - %li - = link_to truncate(page.title, :length => 25), edit_admin_page_url(page) - %span= time_ago_in_words(page.updated_at) += admin_submenu_item 'pages', admin_pages_url do + .header + %p= link_to t('admin.pages.index.new'), new_admin_page_url + .inner + %h2!= t('admin.pages.index.lastest_items') + %ul + - current_site.pages.latest_updated.minimal_attributes.each do |page| + %li + = link_to truncate(page.title, :length => 25), edit_admin_page_url(page) + %span= time_ago_in_words(page.updated_at) - - each_content_type_menu_item do |content_type| - .header - %p= link_to t('admin.contents.index.new'), new_admin_content_url(content_type.slug) - .inner - %h2!= t('admin.contents.index.lastest_items') - %ul - - content_type.contents.latest_updated.each do |content| - %li - = link_to truncate(content.send(content_type.highlighted_field_name).to_s, :length => 20), edit_admin_content_path(content_type.slug, content) - %span= time_ago_in_words(content.updated_at) +- each_content_type_menu_item do |content_type| + .header + %p= link_to t('admin.contents.index.new'), new_admin_content_url(content_type.slug) + .inner + %h2!= t('admin.contents.index.lastest_items') + %ul + - content_type.contents.latest_updated.each do |content| + %li + = link_to truncate(content.send(content_type.highlighted_field_name).to_s, :length => 20), edit_admin_content_path(content_type.slug, content) + %span= time_ago_in_words(content.updated_at) - - other_content_types do |content_types| - .inner - %ul.big-links - - content_types.each do |content_type| - %li - = link_to truncate(content_type.name, :length => 20), admin_contents_url(content_type.slug) - -.action - = link_to content_tag(:em) + content_tag(:span, t('admin.content_types.index.new')), new_admin_content_type_url \ No newline at end of file +- other_content_types do |content_types| + .inner + %ul.big-links + - content_types.each do |content_type| + %li + = link_to truncate(content_type.name, :length => 20), admin_contents_url(content_type.slug) \ No newline at end of file diff --git a/app/views/admin/shared/menu/_settings.html.haml b/app/views/admin/shared/menu/_settings.html.haml index d929cea6..cf99c43a 100644 --- a/app/views/admin/shared/menu/_settings.html.haml +++ b/app/views/admin/shared/menu/_settings.html.haml @@ -1,5 +1,4 @@ -%ul - = admin_submenu_item 'site', edit_admin_current_site_url - / = admin_submenu_item 'snippets', admin_snippets_url - = admin_submenu_item 'theme_assets', admin_theme_assets_url - = admin_submenu_item 'account', edit_admin_my_account_url \ No newline at end of file += admin_submenu_item 'site', edit_admin_current_site_url +/ = admin_submenu_item 'snippets', admin_snippets_url += admin_submenu_item 'theme_assets', admin_theme_assets_url += admin_submenu_item 'account', edit_admin_my_account_url \ No newline at end of file