diff options
author | spag <spag@golwen.net> | 2013-01-10 13:37:55 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-01-10 13:37:55 +0100 |
commit | 490e3f9bcda2943d1bff77ec5cfaa0a9b7d13458 (patch) | |
tree | 9d9e2a1e5b1da7e301675e2767acfa5ca954ea38 /app | |
parent | 6ce81a29e0918b3494a08fa47190b2cea59d1a84 (diff) | |
parent | ae296748501982bac71525507ff9c1fdfefb8ad2 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/gs_parameters_controller.rb | 1 | ||||
-rw-r--r-- | app/views/gs_parameters/_index_core.html.haml | 28 | ||||
-rw-r--r-- | app/views/gs_parameters/index.html.haml | 24 | ||||
-rw-r--r-- | app/views/gs_parameters/show.html.haml | 35 |
4 files changed, 46 insertions, 42 deletions
diff --git a/app/controllers/gs_parameters_controller.rb b/app/controllers/gs_parameters_controller.rb index a35e373..a7813dc 100644 --- a/app/controllers/gs_parameters_controller.rb +++ b/app/controllers/gs_parameters_controller.rb @@ -1,5 +1,6 @@ class GsParametersController < ApplicationController def index + @ps_parameters_unordered = GsParameter.scoped @gs_parameters = GsParameter.order([:section, :name]) @sections = @gs_parameters.pluck(:section).uniq.sort end diff --git a/app/views/gs_parameters/_index_core.html.haml b/app/views/gs_parameters/_index_core.html.haml index 57fd85f..0c36560 100644 --- a/app/views/gs_parameters/_index_core.html.haml +++ b/app/views/gs_parameters/_index_core.html.haml @@ -1,14 +1,16 @@ -%tr - %th= t('gs_parameters.index.name') - - if !@sections - %th= t('gs_parameters.index.section') - %th= t('gs_parameters.index.value') - -- reset_cycle -- for gs_parameter in gs_parameters - %tr{:class => cycle('odd', 'even')} - %td= gs_parameter.name +- cache([gs_parameters.first.section, gs_parameters.reorder(:updated_at).last, gs_parameters.pluck(:id)]) do + %tr + %th= t('gs_parameters.index.name') - if !@sections - %td= gs_parameter.section - %td= gs_parameter.value - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => gs_parameter}
\ No newline at end of file + %th= t('gs_parameters.index.section') + %th= t('gs_parameters.index.value') + + - reset_cycle + - for gs_parameter in gs_parameters + - cache(gs_parameter) do + %tr{:class => cycle('odd', 'even')} + %td= gs_parameter.name + - if !@sections + %td= gs_parameter.section + %td= gs_parameter.value + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => gs_parameter}
\ No newline at end of file diff --git a/app/views/gs_parameters/index.html.haml b/app/views/gs_parameters/index.html.haml index 753e64b..3c16806 100644 --- a/app/views/gs_parameters/index.html.haml +++ b/app/views/gs_parameters/index.html.haml @@ -1,15 +1,15 @@ - title t("gs_parameters.index.page_title") - if @gs_parameters && @gs_parameters.count > 0 - - if @sections - %table - - @sections.each do |section| - %tr - %td{:colspan => 3} - %h3= section - = render "index_core", :gs_parameters => @gs_parameters.where(:section => section) - - else - %table - = render "index_core", :gs_parameters => @gs_parameters - -= render :partial => 'shared/create_link', :locals => {:child_class => GsParameter}
\ No newline at end of file + - cache([@ps_parameters_unordered.order(:updated_at).last, @ps_parameters_unordered.pluck(:id)]) do + - if @sections + %table + - @sections.each do |section| + %tr + %td{:colspan => 3} + %h3= section + -# Template Dependency: gs_parameters/_index_core + = render "index_core", :gs_parameters => @gs_parameters.where(:section => section) + - else + %table + = render "index_core", :gs_parameters => @gs_parameters diff --git a/app/views/gs_parameters/show.html.haml b/app/views/gs_parameters/show.html.haml index 185641d..7919f8c 100644 --- a/app/views/gs_parameters/show.html.haml +++ b/app/views/gs_parameters/show.html.haml @@ -1,19 +1,20 @@ -- title t("gs_parameters.show.page_title") +- cache(@gs_parameter) do + - title t("gs_parameters.show.page_title") -%p - %strong= t('gs_parameters.show.name') + ":" - = @gs_parameter.name -%p - %strong= t('gs_parameters.show.section') + ":" - = @gs_parameter.section -%p - %strong= t('gs_parameters.show.value') + ":" - = @gs_parameter.value -%p - %strong= t('gs_parameters.show.class_type') + ":" - = @gs_parameter.class_type -%p - %strong= t('gs_parameters.show.description') + ":" - = @gs_parameter.description + %p + %strong= t('gs_parameters.show.name') + ":" + = @gs_parameter.name + %p + %strong= t('gs_parameters.show.section') + ":" + = @gs_parameter.section + %p + %strong= t('gs_parameters.show.value') + ":" + = @gs_parameter.value + %p + %strong= t('gs_parameters.show.class_type') + ":" + = @gs_parameter.class_type + %p + %strong= t('gs_parameters.show.description') + ":" + = @gs_parameter.description -= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @gs_parameter }
\ No newline at end of file + = render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @gs_parameter }
\ No newline at end of file |