summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-15 20:44:45 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-15 20:44:45 +0100
commitfefbc85c45fdb3b8353fc9011ef74010242b73d4 (patch)
tree7b24d6792d946d8327570a9212a0f7c121192fed
parent4fbda07c7b593dcc22b90f571d1b85b1bdc47528 (diff)
parent907d081bf1b45e876f9d5833bfe1f4d6319aeb81 (diff)
Merge branch 'fix_breadcrumbs' into develop
-rw-r--r--app/controllers/gs_parameters_controller.rb13
-rw-r--r--app/controllers/gui_functions_controller.rb12
-rw-r--r--app/views/gs_parameters/_index_core.html.haml6
-rw-r--r--app/views/gs_parameters/index.html.haml2
4 files changed, 21 insertions, 12 deletions
diff --git a/app/controllers/gs_parameters_controller.rb b/app/controllers/gs_parameters_controller.rb
index a7813dc..7ca4e8e 100644
--- a/app/controllers/gs_parameters_controller.rb
+++ b/app/controllers/gs_parameters_controller.rb
@@ -1,6 +1,10 @@
class GsParametersController < ApplicationController
+ load_resource :gs_parameter
+
+ before_filter :spread_breadcrumbs
+
def index
- @ps_parameters_unordered = GsParameter.scoped
+ @gs_parameters_unordered = GsParameter.scoped
@gs_parameters = GsParameter.order([:section, :name])
@sections = @gs_parameters.pluck(:section).uniq.sort
end
@@ -30,4 +34,11 @@ class GsParametersController < ApplicationController
def gs_parameter_params
params.require(:gs_parameter).permit(:value, :class_type, :description)
end
+
+ def spread_breadcrumbs
+ add_breadcrumb t("gs_parameters.index.page_title"), gs_parameters_path
+ if @gs_parameter && !@gs_parameter.new_record?
+ add_breadcrumb @gs_parameter, gs_parameter_path(@gs_parameter)
+ end
+ end
end
diff --git a/app/controllers/gui_functions_controller.rb b/app/controllers/gui_functions_controller.rb
index 2ab2c5e..0cb7898 100644
--- a/app/controllers/gui_functions_controller.rb
+++ b/app/controllers/gui_functions_controller.rb
@@ -1,4 +1,6 @@
class GuiFunctionsController < ApplicationController
+ load_resource :gui_function
+
before_filter :load_user_groups
before_filter :spread_breadcrumbs
@@ -60,14 +62,10 @@ class GuiFunctionsController < ApplicationController
end
def spread_breadcrumbs
- if @tenant
- add_breadcrumb t("user_groups.index.page_title"), tenant_user_groups_path(@tenant)
- if @user_group && !@user_group.new_record?
- add_breadcrumb @user_group, tenant_user_group_path(@tenant, @user_group)
- end
- end
-
add_breadcrumb t("gui_functions.index.page_title"), gui_functions_path
+ if @gui_function && !@gui_function.new_record?
+ add_breadcrumb @gui_function, gui_function_path(@gui_function)
+ end
end
end
diff --git a/app/views/gs_parameters/_index_core.html.haml b/app/views/gs_parameters/_index_core.html.haml
index 0c36560..a3f8e1c 100644
--- a/app/views/gs_parameters/_index_core.html.haml
+++ b/app/views/gs_parameters/_index_core.html.haml
@@ -1,4 +1,4 @@
-- cache([gs_parameters.first.section, gs_parameters.reorder(:updated_at).last, gs_parameters.pluck(:id)]) do
+- cache(['gs_parameters_table_section', gs_parameters.first.section, gs_parameters.reorder(:updated_at).last, gs_parameters.pluck(:id)]) do
%tr
%th= t('gs_parameters.index.name')
- if !@sections
@@ -7,10 +7,10 @@
- reset_cycle
- for gs_parameter in gs_parameters
- - cache(gs_parameter) do
+ - cache(['gs_parameters_table_single_row', gs_parameter]) do
%tr{:class => cycle('odd', 'even')}
%td= gs_parameter.name
- if !@sections
%td= gs_parameter.section
- %td= gs_parameter.value
+ %td= truncate(gs_parameter.value, :length => 50)
=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 b4a53e8..c7a6b70 100644
--- a/app/views/gs_parameters/index.html.haml
+++ b/app/views/gs_parameters/index.html.haml
@@ -1,7 +1,7 @@
- title t("gs_parameters.index.page_title")
- if @gs_parameters && @gs_parameters.count > 0
- - cache([@ps_parameters_unordered.order(:updated_at).last, @ps_parameters_unordered.count]) do
+ - cache(['gs_parameters_table', @gs_parameters_unordered.order(:updated_at).last, @gs_parameters_unordered.count]) do
- if @sections
%table
- @sections.each do |section|