forked from saurabh/orbit4-5
Display enabled categories only
This commit is contained in:
parent
0f0e17ef00
commit
48f3f96528
|
@ -80,11 +80,11 @@ module OrbitBackendHelper
|
|||
end
|
||||
|
||||
def select_category(f, module_app)
|
||||
render :partial => '/admin/categories/select_form', :locals => {:f=> f, :module_app=>module_app }
|
||||
render :partial => '/admin/categories/select_form', :locals => {:f=> f, :module_app=>module_app, :categories=>module_app.categories.enabled }
|
||||
end
|
||||
|
||||
def select_tag(f, module_app, object)
|
||||
render :partial => '/admin/tags/tag_form', :locals => {:f=> f, :module_app=>module_app, :object=>object }
|
||||
render :partial => '/admin/tags/tag_form', :locals => {:f=> f, :module_app=>module_app, :object=>object, :tags=>module_app.tags }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<span id="select_categories">
|
||||
<%= f.select :category_id, module_app.categories.collect{|t| [ t.title, t.id ]} %>
|
||||
<%= f.select :category_id, categories.collect{|t| [ t.title, t.id ]} %>
|
||||
</span>
|
||||
<button class="btn" data-toggle="modal" data-target="#categoryModal">
|
||||
<i class='icon-plus'></i> <%= t(:new_category) %>
|
||||
|
@ -30,7 +30,7 @@
|
|||
<script type="text/javascript">
|
||||
$("#categoryModal").hide();
|
||||
|
||||
$('#categoryModal').modal('<%= module_app.categories.blank? ? "show" : "hide" %>');
|
||||
$('#categoryModal').modal('<%= categories.blank? ? "show" : "hide" %>');
|
||||
|
||||
$("#add_category").click(function(){
|
||||
createCategory();
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<div class="controls" data-toggle="buttons-checkbox">
|
||||
<span id="select_tags">
|
||||
<% module_app.tags.each do |tag| %>
|
||||
<% tags.each do |tag| %>
|
||||
<label class="checkbox inline btn <%= 'active' if object.tags.include?(tag) %>">
|
||||
<%= check_box_tag "#{object.class.name.camelize(:lower)}[tags][]", tag.id, object.tags.include?(tag) %> <%= tag.name %>
|
||||
</label>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<button id="add_tag_btn" class="btn" data-toggle="modal" data-target="#tagModal" style="margin-left: <%= module_app.tags.blank? ? "10" : "180" %>px">
|
||||
<button id="add_tag_btn" class="btn" data-toggle="modal" data-target="#tagModal" style="margin-left: <%= tags.blank? ? "10" : "180" %>px">
|
||||
<i class='icon-plus'></i> <%= t(:new_tag) %>
|
||||
</button>
|
||||
|
||||
|
|
Loading…
Reference in New Issue