Update category and tag

This commit is contained in:
manson 2014-05-13 15:40:35 +08:00
parent 15d297ffff
commit c171e4c00c
2 changed files with 22 additions and 15 deletions

View File

@ -15,13 +15,13 @@
<div class="input-area">
<!-- Module Tabs -->
<div class="nav-name"><strong>Module</strong></div>
<div class="nav-name"><strong><%= t(:module) %></strong></div>
<ul class="nav nav-pills module-nav">
<li class="active">
<a href="#basic" data-toggle="tab">Basic</a>
<a href="#basic" data-toggle="tab"><%= t(:basic) %></a>
</li>
<li>
<a href="#tag" data-toggle="tab">Tags</a>
<a href="#tag" data-toggle="tab"><%= t(:tags) %></a>
</li>
</ul>
@ -33,9 +33,9 @@
<!-- Category -->
<div class="control-group">
<label class="control-label muted">Category</label>
<label class="control-label muted"><%= t(:category) %></label>
<div class="controls">
<%= f.select(:category_id, @categories.collect {|p| [ p.title, p.id ] }) %>
<%= select_category(f, @module_app) %>
</div>
</div>
@ -45,21 +45,14 @@
<!-- Tag -->
<div class="control-group">
<label class="control-label muted">Tag</label>
<div class="controls" data-toggle="buttons-checkbox">
<%@tags.each do |tag|%>
<label class="checkbox inline btn <%= 'active' if @album.tags.include?(tag) %>">
<%= check_box_tag 'album[tags][]', tag.id, @album.tags.include?(tag)%>
<%= tag.name %>
</label>
<%end %>
</div>
<label class="control-label muted"><%= t(:tags) %></label>
<%= select_tag(f, @module_app) %>
</div>
</div>
</div>
<div class="nav-name"><strong>Language</strong></div>
<div class="nav-name"><strong><%= t(:language) %></strong></div>
<ul class="nav nav-pills language-nav">
<% I18n.available_locales.each_with_index do |locale, i| %>
<li <%= (i == 0 ? 'class=active' : '') %>>

View File

@ -23,6 +23,20 @@ module Gallery
:link_path=>"new_admin_gallery_path" ,
:priority=>2,
:active_for_action=>{'admin/galleries'=>"new"}
context_link 'categories',
:link_path=>"admin_module_app_categories_path" ,
:link_arg=>{:module_app_id=>get_module_app.id},
:priority=>3,
:active_for_action=>{'admin/galleries'=>'categories'},
:active_for_category => 'Gallery'
context_link 'tags',
:link_path=>"admin_module_app_tags_path" ,
:link_arg=>{:module_app_id=>get_module_app.id},
:priority=>4,
:active_for_action=>{'admin/galleries'=>'tags'},
:active_for_tag => 'Gallery'
end
end
end