Update category and tag

This commit is contained in:
manson 2014-05-13 15:05:51 +08:00
parent e0f7d92d7a
commit 2d8d079ba5
4 changed files with 25 additions and 10 deletions

View File

@ -27,7 +27,7 @@
<div class="control-group">
<label class="control-label muted"><%= t(:category) %></label>
<div class="controls">
<%= f.select :category_id, @categories.collect{|t| [ t.title, t.id ]} %>
<%= select_category(f, @module_app) %>
</div>
</div>
@ -61,13 +61,7 @@
<!-- Tag -->
<div class="control-group">
<label class="control-label muted"><%= t(:tags) %></label>
<div class="controls" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %>
<label class="checkbox inline btn <%= 'active' if @link.tags.include?(tag) %>">
<%= check_box_tag 'web_link[tags][]', tag.id, @link.tags.include?(tag) %> <%= tag.name %>
</label>
<% end %>
</div>
<%= select_tag(f, @module_app) %>
</div>
</div>

3
config/locales/en.yml Normal file
View File

@ -0,0 +1,3 @@
en:
web_resource: Web resource
web_link: Web resource

3
config/locales/zh_tw.yml Normal file
View File

@ -0,0 +1,3 @@
zh_tw:
web_resource: 網路資源
web_link: 網路資源

View File

@ -10,7 +10,7 @@ module WebResource
authorizable
side_bar do
head_label_i18n 'link',:icon_class=>"icons-link"
head_label_i18n 'web_resource',:icon_class=>"icons-link"
available_for [:admin,:manager,:sub_manager]
active_for_controllers ({:private=>['web_resource']})
head_link_path "admin_web_resources_path"
@ -21,11 +21,26 @@ module WebResource
:active_for_action=>{'admin/web_resources'=>'index'},
:available_for => [:all]
context_link 'add',
context_link 'new_',
:link_path=>"new_admin_web_resource_path" ,
:priority=>2,
:active_for_action=>{'admin/web_resources'=>'new'},
:available_for => [:sub_manager]
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/web_resources.'=>'categories'},
:active_for_category => 'WebResource',
:available_for => [:manager]
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/web_resources'=>'tags'},
:active_for_tag => 'WebResource',
:available_for => [:manager]
end
end
end