added enabling and disabling feature of widget count in module init

This commit is contained in:
harrybomrah authored and saurabhbhatia committed 2013-12-10 17:43:31 +08:00
1 parent 2a41e90bc1
commit 800f108be3
5 files changed
+17 -4

No files matched your search

@@ -39,7 +39,6 @@ class Admin::PagePartsController < OrbitBackendController
else
@tag_objects = @r_tag.classify.constantize.all rescue nil
end
@html_class = "page-parts"
end
+5
View File
@@ -30,6 +30,7 @@ class ModuleApp
self[:enable_frontend] = reg.get_enable_frontend
self[:get_widget_style] = reg.get_widgets
self[:using_default_widget] = !reg.get_default_widget.blank?
self[:enable_widget_data_count] = reg.get_enable_widget_data_count
self[:widgets] = reg.get_widgets
self[:has_tag] = reg.get_has_tags
self[:has_category] = reg.get_has_category
@@ -59,6 +60,10 @@ class ModuleApp
get_registration.get_default_widget
end
def get_enable_widget_data_count
get_registration.get_enable_widget_data_count
end
def get_widget_for_select
widgets = get_widget_style
+1 -1
View File
@@ -129,7 +129,7 @@
<div class="display-mode">
<%= render @partial if @partial %>
</div>
<div class="control-group input-content <%= 'hide' if @module_app.blank? %>">
<div class="control-group input-content <%= 'hide' if @module_app.blank? || !@module_app.enable_widget_data_count %>">
<%= f.label :widget_data_count, t(:widget_data_count), class: "control-label muted" %>
<div class="controls">
<%= f.select :widget_data_count, options_for_select(@data_count, @part.widget_data_count), {}, class: "input-mini", id: "page_count" %>