Compare commits

..
Author SHA1 Message Date
Matt K. Fu caf0426bd4 bulletin search 2013-05-01 12:16:28 +08:00
Matt K. Fu 7d077a92a5 system preference 2013-04-29 15:23:15 +08:00
Matt K. Fu 64101109dd disable all sorted_tags 2013-04-26 18:07:59 +08:00
Matt K. Fu 3e567223e3 fix for Spen's translation and Chris's tag error 2013-04-26 15:37:27 +08:00
Spen 79ef86f2c9 member translation fix 2013-04-26 11:26:11 +08:00
Matthew K. Fu JuYuan d047a3d62a chris tags update 2013-04-26 11:26:10 +08:00
150 changed files with 439 additions and 692 deletions

No files matched your search

+5 -19
View File
@@ -2,16 +2,10 @@ class Admin::TagsController < OrbitBackendController
before_filter :force_order_for_visitor,:only=>[:index] before_filter :force_order_for_visitor,:only=>[:index]
before_filter :force_order_for_user,:except => [:index] before_filter :force_order_for_user,:except => [:index]
before_filter :for_app_sub_manager,:except => [:index] before_filter :for_app_sub_manager,:except => [:index]
# layout 'new_admin'
# before_filter :authenticate_user!
# before_filter :is_admin?
# before_filter :set_module_app # before_filter :set_module_app
def index def index
get_tags @tags = get_tags
@module_app_id = @module_app.id rescue nil
end end
def new def new
@@ -23,12 +17,7 @@ class Admin::TagsController < OrbitBackendController
end end
def create def create
if params[:tag][:module_app_id].blank? @tag = @module_app ? @module_app.tags.create(params[:tag]) : Tag.create(params[:tag])
@tag = Tag.create(params[:tag])
else
module_app = ModuleApp.find(params[:tag][:module_app_id])
@tag = eval("#{module_app.key.camelize}Tag").create(params[:tag])
end
end end
def update def update
@@ -47,15 +36,12 @@ class Admin::TagsController < OrbitBackendController
protected protected
def get_tags def get_tags
@tags = (@module_app ? @module_app.tags : Tag.all) @tags = @module_app.blank? ? Tag.all : @module_app.tags
end end
def setup_vars def setup_vars
@app_key = request.env['HTTP_REFERER'].split('/')[4] @module_app = ModuleApp.find(params[:module_app_id]) if params[:module_app_id]
if @app_key @module_app_id = @module_app.id rescue nil
@app_key.gsub!(/[?].*/, '')
@module_app = ModuleApp.first(conditions: {:key => @app_key})
end
end end
end end
@@ -1,6 +1,7 @@
class OrbitBackendController < ApplicationController class OrbitBackendController < ApplicationController
include OrbitCoreLib::AppBackendUtility include OrbitCoreLib::AppBackendUtility
include OrbitCoreLib::PermissionUtility include OrbitCoreLib::PermissionUtility
include OrbitTag::Tagging
include AdminHelper include AdminHelper
include ApplicationHelper include ApplicationHelper
@@ -60,6 +61,20 @@ class OrbitBackendController < ApplicationController
when :referenced_in when :referenced_in
objects = get_objects_from_referenced_objects(object_class.relations[option].class_name.constantize, objects, "#{option}_id") objects = get_objects_from_referenced_objects(object_class.relations[option].class_name.constantize, objects, "#{option}_id")
end end
elsif option.eql?('tags')
tag_array = @module_app.tags.inject([]){ |result, value|
result << [value.name, value]
}
params[:direction].eql?('asc') ? tag_array.sort : tag_array.sort.reverse!
sorted_objects = Array.new
tag_array.each do |x|
taggings = x[1].taggings
taggings.each {|tagging| sorted_objects << tagging.taggable }
end
# debugger
sorted_objects.flatten!
sorted_objects.uniq!
objects = get_with_nil(objects, option, sorted_objects)
end end
end end
end end
@@ -4,7 +4,7 @@ protected
def get_categories_and_tags def get_categories_and_tags
unless @selected[:module_app].nil? unless @selected[:module_app].nil?
@categories = @selected[:module_app].get_categories @categories = @selected[:module_app].get_categories
@tags = @selected[:module_app].get_tags @tags = @selected[:module_app].tags
end end
end end
@@ -55,4 +55,4 @@ protected
end end
end end
+2 -1
View File
@@ -21,7 +21,8 @@ class Asset
before_save :clean_tags before_save :clean_tags
def sorted_tags def sorted_tags
tags.order_by(I18n.locale, :asc) #tags.order_by(I18n.locale, :asc)
tags
end end
protected protected
+6 -4
View File
@@ -8,6 +8,8 @@ class ModuleApp
field :title field :title
field :sidebar_order,type: Integer,default: 0 field :sidebar_order,type: Integer,default: 0
has_many :tags, as: :module_tag, dependent: :destroy
def refetch_setting!(reg) def refetch_setting!(reg)
# %w{module_label category base_url version organization author intro update_info create_date}.each do |field| # %w{module_label category base_url version organization author intro update_info create_date}.each do |field|
# self[field.to_sym] = reg.send field # self[field.to_sym] = reg.send field
@@ -118,10 +120,6 @@ class ModuleApp
has_one :app_auth,dependent: :delete has_one :app_auth,dependent: :delete
def get_tags
get_registration.get_tags
end
def get_categories def get_categories
get_registration.get_categories get_registration.get_categories
end end
@@ -133,5 +131,9 @@ class ModuleApp
def get_registration def get_registration
OrbitApp::Module::Registration.find_by_key(key) OrbitApp::Module::Registration.find_by_key(key)
end end
def self.find_by_key(key)
self.where(key: key)[0] rescue nil
end
end end
-1
View File
@@ -1,4 +1,3 @@
class SubRoleTag < ProtoTag class SubRoleTag < ProtoTag
has_and_belongs_to_many :sub_roles has_and_belongs_to_many :sub_roles
end end
+4 -1
View File
@@ -10,10 +10,13 @@ class Tag
is_impressionable :counter_cache => { :column_name => :view_count } is_impressionable :counter_cache => { :column_name => :view_count }
field :key field :name, localize: true
field :view_count, :type => Integer, :default => 0 field :view_count, :type => Integer, :default => 0
field :cloud_view_count, :type => Integer, :default => 0 field :cloud_view_count, :type => Integer, :default => 0
belongs_to :module_tag, polymorphic: true
has_many :taggings, dependent: :destroy
#field :cloud_amper,:type: Integer,:default=> 0 #field :cloud_amper,:type: Integer,:default=> 0
def self.sorted_for_cloud def self.sorted_for_cloud
+9
View File
@@ -0,0 +1,9 @@
class Tagging
include Mongoid::Document
include Mongoid::Timestamps
field :to_destroy, default: false
belongs_to :tag
belongs_to :taggable, polymorphic: true
end
+1 -1
View File
@@ -17,7 +17,7 @@
<div class="label-group"> <div class="label-group">
<div class="label-td"> <div class="label-td">
<% asset.sorted_tags.each do |tag| %> <% asset.sorted_tags.each do |tag| %>
<span class="label label-tags"><%= tag[I18n.locale] %></span> <span class="label label-tags"><%= tag.name %></span>
<% end %> <% end %>
</div> </div>
</div> </div>
+1 -1
View File
@@ -25,7 +25,7 @@
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<%= content_tag :label, :class => "checkbox inline" do -%> <%= content_tag :label, :class => "checkbox inline" do -%>
<%= check_box_tag 'asset[tag_ids][]', tag.id, @asset.tag_ids.include?(tag.id) %> <%= check_box_tag 'asset[tag_ids][]', tag.id, @asset.tag_ids.include?(tag.id) %>
<%= tag[I18n.locale] %> <%= tag.name %>
<%= hidden_field_tag 'asset[tag_ids][]', '' %> <%= hidden_field_tag 'asset[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <% end %>
+1 -1
View File
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %> <%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
+1 -1
View File
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
+1 -1
View File
@@ -40,7 +40,7 @@
</div> </div>
</div> </div>
<!-- <div class="item element"> <!-- <div class="item element">
<h3><i class="icons-"></i><a href=""><%= t(:member) %></a></h3> <h3><i class="icons-"></i><a href=""><%= t(:member_) %></a></h3>
<div class="detail w-a h-a"> <div class="detail w-a h-a">
<p class="totle"><span><%= t(:all_member) %></span>2,217</p> <p class="totle"><span><%= t(:all_member) %></span>2,217</p>
<table class="table table-striped"> <table class="table table-striped">
@@ -13,7 +13,7 @@
<%= nil_checkbox_button(object,:tag) %> <%= nil_checkbox_button(object,:tag) %>
<%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%> <%= content_tag_for(:label, @tags,:class=>"radio inline") do |tag|%>
<%= check_box_tag("#{field_name}[tag][]", tag.id, tag_checked_value(object,tag.id),:class=>'select_option' ) %> <%= check_box_tag("#{field_name}[tag][]", tag.id, tag_checked_value(object,tag.id),:class=>'select_option' ) %>
<%= tag[I18n.locale]%> <%= tag.name%>
<% end if @tags%> <% end if @tags%>
</fieldset> </fieldset>
<% else %> <% else %>
+1 -1
View File
@@ -1,6 +1,6 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<div class="subnav"> <div class="subnav">
+1 -1
View File
@@ -1,6 +1,6 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
+1 -1
View File
@@ -1,6 +1,6 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
+1 -1
View File
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %> <%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
+1 -1
View File
@@ -1,7 +1,7 @@
<% # encoding: utf-8 %> <% # encoding: utf-8 %>
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-group', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %> <%= form_for @attribute,:url => eval("admin_#{@attribute_type}_path(@attribute)") ,:class=> "form-horizontal" do |f| %>
@@ -9,7 +9,7 @@
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane active in" id="summary"> <div class="tab-pane active in" id="summary">
<h2><%= I18n.t("site.system_preference_.summary.disk_space") %>:</h2> <h2><%= I18n.t("site.system_preference_.summary.disk_space") %>:</h2>
<%= content_tag :p,@site.disk_space %> <%= content_tag :p,@site.disk_space.gsub(/\n/,"<br />").html_safe if @site.disk_space %>
<h2><%= I18n.t("site.system_preference_.summary.code_update_at") %>: </h2> <h2><%= I18n.t("site.system_preference_.summary.code_update_at") %>: </h2>
<% @site.system_package_info.each do |index,value| %> <% @site.system_package_info.each do |index,value| %>
<h2><%= index.titleize %> <%= I18n.t("site.system_preference_.summary.version") %>:</h2> <h2><%= index.titleize %> <%= I18n.t("site.system_preference_.summary.version") %>:</h2>
@@ -20,7 +20,7 @@
<div class="tab-pane" id="commits"> <div class="tab-pane" id="commits">
<% if @git_commit_list_file %> <% if @git_commit_list_file %>
<% @git_commit_list_file.lines do |line|%> <% @git_commit_list_file.lines do |line|%>
<%= (line + "<br/>").html_safe %> <%= line %><br/>
<% end%> <% end%>
<% else %> <% else %>
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div> <div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
@@ -29,7 +29,7 @@
<div class="tab-pane" id="backups"> <div class="tab-pane" id="backups">
<%if @db_backup_list_file %> <%if @db_backup_list_file %>
<% @db_backup_list_file.lines do |line|%> <% @db_backup_list_file.lines do |line|%>
<%=(line + "<br/>").html_safe %> <%=line %><br/>
<% end %> <% end %>
<% else %> <% else %>
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div> <div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
@@ -38,7 +38,7 @@
<div class="tab-pane" id="resque_logs"> <div class="tab-pane" id="resque_logs">
<%if @db_backup_list_file %> <%if @db_backup_list_file %>
<% @resque_logs_file.lines do |line|%> <% @resque_logs_file.lines do |line|%>
<%=(line + "<br/>").html_safe %> <%=line %><br/>
<% end if @resque_logs_file%> <% end if @resque_logs_file%>
<%else %> <%else %>
<div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div> <div class="well"><%= I18n.t("site.system_preference_.summary.no_data") %></div>
+6 -4
View File
@@ -1,7 +1,9 @@
<%= form_for :tag, :url => admin_tags_path, :remote => true, :html => {:id => 'tag_form'} do |f| %> <%= form_for :tag, :url => admin_tags_path, :remote => true, :html => {:id => 'tag_form'} do |f| %>
<% @site_valid_locales.each do |locale| %> <%= f.fields_for :name_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %> <% @site_valid_locales.each do |locale| %>
<% end %> <%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %>
<%= f.hidden_field :module_app_id, :value => @module_app_id %> <% end %>
<% end %>
<%= hidden_field_tag :module_app_id, @module_app_id %>
<%= f.submit t(:add) %> <%= f.submit t(:add) %>
<% end %> <% end %>
+6 -4
View File
@@ -1,7 +1,9 @@
<%= form_for :tag, :url => admin_tag_path(tag), :method => :put, :remote => true do |f| %> <%= form_for :tag, :url => admin_tag_path(tag), :method => :put, :remote => true do |f| %>
<% @site_valid_locales.each do |locale| %> <%= f.fields_for :name_translations do |f| %>
<%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale %> <% @site_valid_locales.each do |locale| %>
<% end %> <%= I18nVariable.from_locale(locale) %>:<%= f.text_field locale, value: @tag.name_translations[locale] %>
<%= f.hidden_field :module_app_id, :value => tag.module_app_id %> <% end %>
<% end %>
<%= hidden_field_tag :module_app_id, @module_app_id %>
<%= f.submit t(:update_) %> <%= f.submit t(:update_) %>
<% end %> <% end %>
+2 -2
View File
@@ -3,11 +3,11 @@
<i class="icons-tag"></i> <i class="icons-tag"></i>
<% @site_valid_locales.each do |locale| %> <% @site_valid_locales.each do |locale| %>
<%#= I18nVariable.from_locale(locale) %> <%#= I18nVariable.from_locale(locale) %>
<%= tag[locale] %> <%= tag.name_translations[locale] %>
<% end %> <% end %>
</div> </div>
<div class="action"> <div class="action">
<%= link_to t(:edit), edit_admin_tag_path(tag), :remote => true %> <%= link_to t(:edit), edit_admin_tag_path(tag, :module_app_id => @module_app_id), :remote => true %>
<%= link_to t(:delete_), admin_tag_path(tag), :confirm => t('sure?'), :method => :delete, :remote => true %> <%= link_to t(:delete_), admin_tag_path(tag), :confirm => t('sure?'), :method => :delete, :remote => true %>
</div> </div>
</div> </div>
@@ -1,5 +1,5 @@
<%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%> <%= content_tag :li, :class => active_for_controllers('users_new_interface') do -%>
<%= link_to content_tag(:i, nil, :class => 'icons-user')+ content_tag(:span, t(:member)), admin_users_new_interface_index_path %> <%= link_to content_tag(:i, nil, :class => 'icons-user')+ content_tag(:span, t(:member_)), admin_users_new_interface_index_path %>
<%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface')) do -%> <%= content_tag :ul, :class => ("nav nav-list " + visible_for_controllers('users_new_interface')) do -%>
<%= content_tag :li, link_to((t(:all_member) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, admin_users_new_interface_index_path), :class => active_for_action('users_new_interface', 'index') %> <%= content_tag :li, link_to((t(:all_member) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, admin_users_new_interface_index_path), :class => active_for_action('users_new_interface', 'index') %>
<%= content_tag :li, link_to((t(:add_member) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_admin_users_new_interface_path), :class => active_for_action('users_new_interface', 'new') if (is_admin? rescue nil) %> <%= content_tag :li, link_to((t(:add_member) + content_tag(:i, nil, :class => 'icon-chevron-right')).html_safe, new_admin_users_new_interface_path), :class => active_for_action('users_new_interface', 'new') if (is_admin? rescue nil) %>
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<div class="member-plugin"> <div class="member-plugin">
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<%= render :partial => "js_and_css"%> <%= render :partial => "js_and_css"%>
@@ -1,5 +1,5 @@
<% content_for :side_bar do %> <% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t(:member_), :link_url => admin_site_site_info_path(@site), :icon => 'icons-users', :side_bar_content => 'admin/users_new_interface/side_bar'} %>
<% end %> <% end %>
<% content_for :page_specific_css do -%> <% content_for :page_specific_css do -%>
+2 -2
View File
@@ -11,8 +11,8 @@
<p class="alert hide">You need to sign in or sign up before continuing.</p> <p class="alert hide">You need to sign in or sign up before continuing.</p>
<div class="main"> <div class="main">
<div class="control-group clear"> <div class="control-group clear">
<%= f.label :user_id ,t(:user_id)%> <%= f.label :user_id ,t("users.user_id")%>
<%= f.text_field :user_id, :placeholder => t(:email), :style => "width: 330px;" %> <%= f.text_field :user_id, :placeholder => t("users.user_id"), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span> <span class="help-inline">Please correct the error</span>
</div> </div>
<div class="control-group clear"> <div class="control-group clear">
+1 -1
View File
@@ -4,6 +4,6 @@
<li><%= link_to t(:template), admin_designs_path, :class => 'orblink' %></li> <li><%= link_to t(:template), admin_designs_path, :class => 'orblink' %></li>
<li><%= link_to t(:purchase), admin_purchases_path, :class => 'orblink' %></li> <li><%= link_to t(:purchase), admin_purchases_path, :class => 'orblink' %></li>
<li><%= link_to t(:asset), admin_assets_path, :class => 'orblink' %></li> <li><%= link_to t(:asset), admin_assets_path, :class => 'orblink' %></li>
<li><%= link_to t(:member), admin_users_path, :class => 'orblink' %></li> <li><%= link_to t(:member_), admin_users_path, :class => 'orblink' %></li>
<li><%= link_to t(:site_), admin_sites_path, :class => 'orblink' %></li> <li><%= link_to t(:site_), admin_sites_path, :class => 'orblink' %></li>
</ul> </ul>
+1 -1
View File
@@ -2,7 +2,7 @@
<% if Me.backend_openness_on %> <% if Me.backend_openness_on %>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><%= link_to content_tag(:i, nil, :class => 'icons-gauge') + t(:dashboard_), admin_dashboards_path %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-gauge') + t(:dashboard_), admin_dashboards_path %></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-users') + t(:member), admin_users_new_interface_index_path %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-users') + t(:member_), admin_users_new_interface_index_path %></li>
</ul> </ul>
<% end %> <% end %>
+2 -2
View File
@@ -1,10 +1,10 @@
<a class="brand dropdown-toggle" data-toggle="dropdown" href="#">Orbit</a> <a class="brand dropdown-toggle" data-toggle="dropdown" href="#">Orbit</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><%= link_to content_tag(:i, nil, :class => 'icons-gauge') + t(:dashboard_), admin_dashboards_path %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-gauge') + t(:dashboard_), admin_dashboards_path %></li>
<li><%= link_to content_tag(:i, nil, :class => 'icons-users') + t(:member), admin_users_new_interface_index_path %></li> <li><%= link_to content_tag(:i, nil, :class => 'icons-users') + t(:member_), admin_users_new_interface_index_path %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-content') + t(:content) %></li> <li><%#= link_to content_tag(:i, nil, :class => 'icons-content') + t(:content) %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-member') + t(:member), admin_users_path %></li> <li><%#= link_to content_tag(:i, nil, :class => 'icons-member') + t(:member_), admin_users_path %></li>
<li><%#= link_to content_tag(:i, nil, :class => 'icons-asset') + t(:asset), admin_assets_path %></li> <li><%#= link_to content_tag(:i, nil, :class => 'icons-asset') + t(:asset), admin_assets_path %></li>
<%if (is_admin? rescue false)%> <%if (is_admin? rescue false)%>
<li class="divider"></li> <li class="divider"></li>
+1 -1
View File
@@ -74,7 +74,7 @@
<li> <li>
<div class="input-prepend"> <div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span> <span class="add-on"><i class="icon-user"></i></span>
<%= f.text_field :user_id, :class => 'span2', :placeholder => t(:email), :size => 16 %> <%= f.text_field :user_id, :class => 'span2', :placeholder => t("users.user_id"), :size => 16 %>
</div> </div>
</li> </li>
<li> <li>
@@ -7,7 +7,7 @@ module OrbitSystemPreference
DefaultDiskSpaceLimit = 3 #in GB DefaultDiskSpaceLimit = 3 #in GB
module SystemPackage module SystemPackage
MongodbVersion = "mongod --version" MongodbVersion = "mongod --version"
NginxVersion = "nginx -V" NginxVersion = "nginx -V 2>&1"
SystemVersion = "uname -a" SystemVersion = "uname -a"
end end
end end
+1 -1
View File
@@ -13,7 +13,7 @@ en:
ldap_connection_failed: 'LDAP connection failed' ldap_connection_failed: 'LDAP connection failed'
ldap_pass_but_account_not_in_orbit: 'LDAP account is not supported to sign up this site.' ldap_pass_but_account_not_in_orbit: 'LDAP account is not supported to sign up this site.'
locked: 'Your account is locked.' locked: 'Your account is locked.'
invalid: 'Invalid email or password.' invalid: 'Invalid user account or password.'
invalid_token: 'Invalid authentication token.' invalid_token: 'Invalid authentication token.'
timeout: 'Your session expired, please sign in again to continue.' timeout: 'Your session expired, please sign in again to continue.'
inactive: 'Your account was not activated yet.' inactive: 'Your account was not activated yet.'
+1 -1
View File
@@ -6,7 +6,7 @@ zh_tw:
failure: failure:
already_authenticated: 你已經登入。 already_authenticated: 你已經登入。
inactive: 您的帳號尚未被啟用。 inactive: 您的帳號尚未被啟用。
invalid: Email 或密碼是無效的。 invalid: 帳號或密碼是無效的。
invalid_token: 無效的認證代碼。 invalid_token: 無效的認證代碼。
locked: 您的帳號已被鎖定。 locked: 您的帳號已被鎖定。
timeout: 您的登入時效過期,請重新登入,才能繼續。 timeout: 您的登入時效過期,請重新登入,才能繼續。
+2 -2
View File
@@ -277,7 +277,7 @@ en:
markup_options: Markup options markup_options: Markup options
markup_value: Markup value markup_value: Markup value
me: Me me: Me
member: Member member_: Member
member_authorization: Authorizations member_authorization: Authorizations
member_info: Profile Form member_info: Profile Form
member_registration: Registration Approval member_registration: Registration Approval
@@ -428,7 +428,7 @@ en:
module_page_lang_not_support: "We are sorry, this page is not available for English" module_page_lang_not_support: "We are sorry, this page is not available for English"
not_previewable: "Preview not support" not_previewable: "Preview not support"
preview_only_for_img: "Preview only supprt with file type: jpg, png, gif, bmp" preview_only_for_img: "Preview only supprt with file type: jpg, png, gif, bmp"
sys_basic_form: System Default Basic Field sys_basic_form: System Required Info.
sys_basic_id_form: System Account Info. sys_basic_id_form: System Account Info.
system_info: System information system_info: System information
tag_cloud: Tag cloud tag_cloud: Tag cloud
+3 -2
View File
@@ -277,7 +277,8 @@ zh_tw:
markup_options: 標註選項 markup_options: 標註選項
markup_value: 標註值 markup_value: 標註值
me: 我 me: 我
member: 成員 # member: 成員
member_: 成員
member_authorization: 成員權限 member_authorization: 成員權限
member_info: 基本資料表 member_info: 基本資料表
member_registration: 註冊審核 member_registration: 註冊審核
@@ -395,7 +396,7 @@ zh_tw:
tab_backups: 備份記錄 tab_backups: 備份記錄
tab_commits: 程式版本 tab_commits: 程式版本
tab_summary: 總覽 tab_summary: 總覽
tab_logs: 登錄檔 tab_logs: 排程工作日誌
summary: summary:
code_update_at: 程式更新紀錄 code_update_at: 程式更新紀錄
disk_space: 硬碟空間 disk_space: 硬碟空間
+3
View File
@@ -0,0 +1,3 @@
# require "action_view"
require "orbit_tag/taggable"
+77
View File
@@ -0,0 +1,77 @@
module OrbitTag
module Taggable
extend ActiveSupport::Concern
module ClassMethods
def taggable
init_tag
end
private
def init_tag
class_eval do
field :tags_to_destroy, type: Array, default: []
has_many :taggings, as: :taggable, autosave: true, dependent: :destroy
accepts_nested_attributes_for :taggings, allow_destroy: true
after_save :remove_taggings, unless: Proc.new{self.tags_to_destroy.blank?}
def tags
self.taggings.blank? ? [] : self.taggings.map{|t| t.tag}
end
def tags=(tag_ids)
tag_ids = [tag_ids].flatten
tag_ids.delete('')
ids = self.taggings.blank? ? [] : self.taggings.map{|t| t.tag.id}
tag_ids.each do |tag_id|
unless ids.include? tag_id
self.taggings.build(tag_id: tag_id)
end
end
self.tags_to_destroy = self.taggings.where(:tag_id.in => (ids - tag_ids)).map{|t| t.id}
end
def tag_ids
self.taggings.blank? ? [] : self.taggings.map{|t| t.tag.id}
end
def tag_ids=(ids)
self.tags = ids
end
def sorted_tags
if tags.blank?
[]
else
tag_array = tags.inject([]){ |result, value|
result << [value.name, value]
}
tag_array.sort.map{|x| x[1] }
end
end
private
def remove_taggings
self.taggings.where(:_id.in => self.tags_to_destroy).destroy
self.class.without_callback(:save, :after, :remove_taggings) do
self.update_attribute(:tags_to_destroy, [])
end
end
end
end
end
end
module Tagging
extend OrbitCoreLib::AppBackendUtility
def get_tags
@module_app ? @module_app.tags : Tag.all
end
end
end
@@ -25,7 +25,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# @bulletins = Bulletin.all # @bulletins = Bulletin.all
# @bulletins = Bulletin.desc("postdate desc") # @bulletins = Bulletin.desc("postdate desc")
get_categorys('BulletinCategory',params[:bulletin_category_id]) get_categorys('BulletinCategory',params[:bulletin_category_id])
get_tags @tags = get_tags
@filter = params[:filter] @filter = params[:filter]
new_filter = params[:new_filter] new_filter = params[:new_filter]
@@ -66,7 +66,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# GET /bulletins/1.xml # GET /bulletins/1.xml
def show def show
@bulletin = Bulletin.find(params[:id]) @bulletin = Bulletin.find(params[:id])
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb
@@ -85,7 +85,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
end end
@link_url = panel_announcement_back_end_bulletins_path @link_url = panel_announcement_back_end_bulletins_path
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb
format.xml { render :xml => @bulletin } format.xml { render :xml => @bulletin }
@@ -102,14 +102,14 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@link_url = panel_announcement_back_end_bulletin_path(@bulletin) @link_url = panel_announcement_back_end_bulletin_path(@bulletin)
get_tags @tags = get_tags
end end
end end
# POST /bulletins # POST /bulletins
# POST /bulletins.xml # POST /bulletins.xml
def create def create
get_tags @tags = get_tags
if params[:bulletin_link] if params[:bulletin_link]
@bulletin_link = BulletinLink.new(params[:bulletin_link]) @bulletin_link = BulletinLink.new(params[:bulletin_link])
@@ -240,7 +240,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
format.js { render 'toggle_enable' } format.js { render 'toggle_enable' }
format.xml { head :ok } format.xml { head :ok }
else else
get_tags @tags = get_tags
format.html { render :action => "edit" } format.html { render :action => "edit" }
format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity } format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity }
end end
@@ -280,7 +280,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
@bulletin_categories = BulletinCategory.all @bulletin_categories = BulletinCategory.all
#TODO 需要做 manager ,admin 才可以 all. 其他 available就好 #TODO 需要做 manager ,admin 才可以 all. 其他 available就好
get_tags @tags = get_tags
end end
def delete def delete
@@ -327,11 +327,6 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# end # end
# end # end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'announcement'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id}).order_by(I18n.locale, :asc) rescue []
end
def clean_values def clean_values
if params[:bulletin] if params[:bulletin]
params[:bulletin][:bulletin_links_attributes].each_with_index do |link, index| params[:bulletin][:bulletin_links_attributes].each_with_index do |link, index|
@@ -13,6 +13,18 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
render :index render :index
end end
def search_result
@search = Bulletin.solr_search do
fulltext params[:search_query]
with(:frontend_search,true)
with(:available_lang).any_of([I18n.locale.to_s])
end
search_result = @search.results.collect{|result| result.id}
@bulletins = Bulletin.all.available_for_lang(I18n.locale).can_display.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
render 'index'
end
def index def index
@item = Page.find(params[:page_id]) rescue nil @item = Page.find(params[:page_id]) rescue nil
if @item if @item
@@ -86,7 +86,7 @@ class Panel::Announcement::Widget::BulletinsController < OrbitWidgetController
end end
def bulletins_search_block def bulletins_search_block
@part = PagePart.find params[:part_id]
end end
protected protected
+15 -11
View File
@@ -11,13 +11,16 @@ class Bulletin
include OrbitCoreLib::BelongsToCategoryMayDisable include OrbitCoreLib::BelongsToCategoryMayDisable
include OrbitCoreLib::Preview include OrbitCoreLib::Preview
include OrbitTag::Taggable
taggable
is_impressionable :counter_cache => { :column_name => :view_count } is_impressionable :counter_cache => { :column_name => :view_count }
field :title, localize: true field :title, localize: true
field :subtitle, localize: true field :subtitle, localize: true
field :text, localize: true field :text, localize: true
has_and_belongs_to_many :tags, :class_name => "AnnouncementTag" # has_and_belongs_to_many :tags, :class_name => "AnnouncementTag"
field :postdate , :type => DateTime field :postdate , :type => DateTime
field :deadline , :type => DateTime field :deadline , :type => DateTime
@@ -51,7 +54,7 @@ class Bulletin
validates :title, :at_least_one => true validates :title, :at_least_one => true
before_save :check_deadline, :update_avliable_language, :clean_values#, :save_bulletin_links, :save_bulletin_files before_save :check_deadline, :update_avliable_language#, :clean_values#, :save_bulletin_links, :save_bulletin_files
searchable do searchable do
text :titles do text :titles do
@@ -196,9 +199,10 @@ class Bulletin
return nil return nil
end end
def sorted_tags # def sorted_tags
tags.order_by(I18n.locale, :asc) # #tags.order_by(I18n.locale, :asc)
end # tags
# end
def to_preview def to_preview
@@ -236,12 +240,12 @@ class Bulletin
end end
end end
def clean_values # def clean_values
self.bulletin_links.each do |link| # self.bulletin_links.each do |link|
link.delete if link.url.blank? && link.title.blank? # link.delete if link.url.blank? && link.title.blank?
end # end
self.tag_ids.delete('') # self.tag_ids.delete('')
end # end
end end
@@ -67,7 +67,7 @@
<div class="label-group"> <div class="label-group">
<div class="label-td"> <div class="label-td">
<% bulletin.sorted_tags.each do |tag| %> <% bulletin.sorted_tags.each do |tag| %>
<span class="label label-tags"><%= tag[I18n.locale] %></span> <span class="label label-tags"><%= tag.name %></span>
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -1,6 +1,6 @@
<div class="accordion-inner" data-toggle="buttons-checkbox"> <div class="accordion-inner" data-toggle="buttons-checkbox">
<% @tags.each do |tag| -%> <% @tags.each do |tag| -%>
<%= link_to tag[I18n.locale], panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'tags', :id => tag.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('tags', tag.id)}" %> <%= link_to tag.name, panel_announcement_back_end_bulletins_path(:filter => @filter, :new_filter => {:type => 'tags', :id => tag.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('tags', tag.id)}" %>
<% end -%> <% end -%>
</div> </div>
<%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %> <%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %>
@@ -99,7 +99,7 @@
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%> <%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'bulletin[tag_ids][]', tag.id, @bulletin.tag_ids.include?(tag.id) %> <%= check_box_tag 'bulletin[tag_ids][]', tag.id, @bulletin.tag_ids.include?(tag.id) %>
<%= tag[I18n.locale] %> <%= tag.name %>
<%= hidden_field_tag 'bulletin[tag_ids][]', '' %> <%= hidden_field_tag 'bulletin[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <% end %>
@@ -5,7 +5,7 @@
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<label class="checkbox inline"> <label class="checkbox inline">
<%= check_box_tag 'bulletin[tag_ids][]', tag.id, bulletin.tag_ids.include?(tag.id) %> <%= check_box_tag 'bulletin[tag_ids][]', tag.id, bulletin.tag_ids.include?(tag.id) %>
<%= tag[I18n.locale] %> <%= tag.name %>
</label> </label>
<%= hidden_field_tag 'bulletin[tag_ids][]', '' %> <%= hidden_field_tag 'bulletin[tag_ids][]', '' %>
<% end %> <% end %>
@@ -4,269 +4,26 @@
<h1 class="h1"><%= @page.title rescue nil %></h1> <h1 class="h1"><%= @page.title rescue nil %></h1>
<% if !@item.frontend_field.blank? %>
<% if @frontend_style == '1' %>
<div class="news news1">
<table class="newstb" border="0" cellpadding="0" cellspacing="0" >
<thead>
<tr>
<% @item.frontend_field.each do |ff| %>
<th><span class="<%= ff[1] %>"><%= t("announcement.bulletin.#{ff[0]}") if !ff[0].blank? %></span></th>
<% end %>
</tr>
</thead>
<% @bulletins.each do |post| %>
<tr class="<%= cycle('odd', '')%>">
<% @item.frontend_field.each do |ff| %>
<td>
<span class="<%= ff[1] %>">
<% if ff[1] == 'title' %>
<%= link_to post.send("#{ff[0]}"), panel_announcement_front_end_bulletin_path(post, :category_id => post.send("#{post.class.to_s.underscore}_category_id")) %>
<% elsif ff[1] == 'date' %>
<%= display_date(post.send(ff[0])) %>
<% elsif ff[1] == 'category' %>
<%= post.send(ff[0]).title rescue nil %>
<% elsif ff[1] == 'img' %>
<div class="img app-pic"><%= image_tag(post.send(wf[0]).url) %></div>
<% elsif ff[1] == 'text' %>
<%#= post.send("#{ff[0]}[#{I18n.locale}]").html_safe %>
<%= post.send("#{ff[0]}").html_safe %>
<% elsif ff[1] == 'status' %>
<% if post.is_top? %>
<span class="top"><%= t(:top) %></span>
<% end %>
<% if post.is_hot? %>
<span class="hot"><%= t(:hot) %></span>
<% end %>
<% elsif ff[1] == 'link' %>
<% elsif ff[1] == 'file' %>
<% elsif ff[1] == 'tag' %>
<% elsif ff[1] == 'viewcount' %>
<%= dislpay_view_count(post) %>
<% elsif ff[1] == 'poster' %>
<%= User.from_id(post.update_user_id).name rescue ''%>
<% end %>
</span>
</td>
<% end %>
</tr>
<% end %>
</table>
</div>
<% elsif @frontend_style == '2' %>
<div class="news news2">
<ul class="newslist">
<% @bulletins.each do |post| %>
<li class="<%= cycle('odd', '')%>">
<div class="img app-pic"><%= image_tag(post.image.url) %></div>
<% @item.frontend_field.each do |ff| %>
<span class="<%= ff[1] %>">
<% if ff[1] == 'title' %>
<%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
<% elsif ff[1] == 'date' %>
<%= display_date(post.send(ff[0])) %>
<% elsif ff[1] == 'category' %>
<%= post.send("#{post.class.to_s.underscore}_#{ff[0]}").title rescue nil %>
<% elsif ff[1] == 'text' %>
<%#= post.send("#{ff[0]}[#{I18n.locale}]").html_safe %>
<%= post.send("#{ff[0]}").html_safe %>
<% elsif ff[1] == 'status' %>
<% if post.is_top? %>
<span class="top"><%= t(:top) %></span>
<% end %>
<% if post.is_hot? %>
<span class="hot"><%= t(:hot) %></span>
<% end %>
<% elsif ff[1] == 'link' %>
<% elsif ff[1] == 'file' %>
<% elsif ff[1] == 'tag' %>
<% elsif ff[1] == 'viewcount' %>
<%= dislpay_view_count(post) %>
<% elsif ff[1] == 'poster' %>
<%= User.from_id(post.update_user_id).name rescue ''%>
<% end %>
</span>
<% end %>
</li>
<% end %>
</ul>
</div>
<% elsif @frontend_style == '3' %>
<div class="news news3">
<ul class="newslist">
<% @bulletins.each do |post| %>
<li class="<%= cycle('odd', '')%>">
<div class="img app-pic"><%= image_tag(post.image.url) %></div>
<div class="wrap">
<% @item.frontend_field.each do |ff| %>
<span class="<%= ff[1] %>">
<% if ff[1] == 'title' %>
<%= link_to post.send("#{ff[0]}"), panel_announcement_front_end_bulletin_path(post, :category_id => post.send("#{post.class.to_s.underscore}_category_id")) %>
<% elsif ff[1] == 'date' %>
<%= display_date(post.send(ff[0])) %>
<% elsif ff[1] == 'category' %>
<%= post.send("#{post.class.to_s.underscore}_#{ff[0]}").title rescue nil %>
<% elsif ff[1] == 'text' %>
<%#= post.send("#{ff[0]}[#{I18n.locale}]").html_safe %>
<%= post.send("#{ff[0]}").html_safe %>
<% elsif ff[1] == 'status' %>
<% if post.is_top? %>
<span class="top"><%= t(:top) %></span>
<% end %>
<% if post.is_hot? %>
<span class="hot"><%= t(:hot) %></span>
<% end %>
<% elsif ff[1] == 'link' %>
<% elsif ff[1] == 'file' %>
<% elsif ff[1] == 'tag' %>
<% elsif ff[1] == 'viewcount' %>
<%= dislpay_view_count(post) %>
<% elsif ff[1] == 'poster' %>
<%= User.from_id(post.update_user_id).name rescue ''%>
<% end %>
</span>
<% end %>
</div>
</li>
<% end %>
</ul>
</div>
<% elsif @frontend_style == '4' %>
<div class="news news4">
<ul class="newslist">
<% @bulletins.each do |post| %>
<li class="<%= cycle('odd', '')%>">
<div class="img app-pic"><%= image_tag(post.image.url) %></div>
<div class="wrap">
<% @item.frontend_field.each do |ff| %>
<span class="<%= ff[1] %>">
<% if ff[1] == 'title' %>
<%= link_to post.send("#{ff[0]}"), panel_announcement_front_end_bulletin_path(post, :category_id => post.send("#{post.class.to_s.underscore}_category_id")) %>
<% elsif ff[1] == 'date' %>
<%= display_date(post.send(ff[0])) %>
<% elsif ff[1] == 'category' %>
<%= post.send("#{post.class.to_s.underscore}_#{ff[0]}").title rescue nil %>
<% elsif ff[1] == 'text' %>
<%#= post.send("#{ff[0]}[#{I18n.locale}]").html_safe %>
<%= post.send("#{ff[0]}").html_safe %>
<% elsif ff[1] == 'status' %>
<% if post.is_top? %>
<span class="top"><%= t(:top) %></span>
<% end %>
<% if post.is_hot? %>
<span class="hot"><%= t(:hot) %></span>
<% end %>
<% elsif ff[1] == 'link' %>
<% elsif ff[1] == 'file' %>
<% elsif ff[1] == 'tag' %>
<% elsif ff[1] == 'viewcount' %>
<%= dislpay_view_count(post) %>
<% elsif ff[1] == 'poster' %>
<%= User.from_id(post.update_user_id).name rescue ''%>
<% end %>
</span>
<% end %>
</div>
</li>
<% end %>
</ul>
</div>
<% elsif @frontend_style == '5' %>
<div class="news news5">
<div class="img app-pic"><%= image_tag(@bulletins.first.image.url) %></div>
<ul class="newslist">
<% @bulletins.each do |post| %>
<li class="<%= cycle('odd', '')%>">
<% @item.frontend_field.each do |ff| %>
<span class="<%= ff[1] %>">
<% if ff[1] == 'title' %>
<%= link_to post.send("#{ff[0]}"), panel_announcement_front_end_bulletin_path(post, :category_id => post.send("#{post.class.to_s.underscore}_category_id")) %>
<% elsif ff[1] == 'date' %>
<%= display_date(post.send(ff[0])) %>
<% elsif ff[1] == 'category' %>
<%= post.send("#{post.class.to_s.underscore}_#{ff[0]}").title rescue nil %>
<% elsif ff[1] == 'text' %>
<%#= post.send("#{ff[0]}[#{I18n.locale}]").html_safe %>
<%= post.send("#{ff[0]}").html_safe %>
<% elsif ff[1] == 'status' %>
<% if post.is_top? %>
<span class="top"><%= t(:top) %></span>
<% end %>
<% if post.is_hot? %>
<span class="hot"><%= t(:hot) %></span>
<% end %>
<% elsif ff[1] == 'link' %>
<% elsif ff[1] == 'file' %>
<% elsif ff[1] == 'tag' %>
<% elsif ff[1] == 'viewcount' %>
<%= dislpay_view_count(post) %>
<% elsif ff[1] == 'poster' %>
<%= User.from_id(post.update_user_id).name rescue ''%>
<% end %>
</span>
<% end %>
</li>
<% end %>
</ul>
</div>
<table class="table table-bordered"> <table class="table table-bordered">
<tr> <tr>
<%= content_tag (:th) do %> <%= content_tag (:th) do %>
<%= t(:category) %> <%= t('announcement.bulletin.category') %>
<% end if (!params[:search_query].blank? or params[:category_id].blank?)-%> <% end if (!params[:search_query].blank? or params[:category_id].blank?)-%>
<th><%= t(:title) %></th>
<th><%= t(:postdate) %></th>
</tr>
<% if !params[:name].blank?%>
<%= t("search.unit_get",:unit_name => params[:name],:item_num=>@bulletins.count) %>
<% end %>
<% if @bulletins.blank? and !params[:search_query].blank? %>
<%=render :partial => 'shared/search_not_found' %>
<% elsif !params[:search_query].blank? %>
<%= t("search.result_get",:search_word => params[:search_query],:item_num=>@bulletins.count) unless (@bulletins.count == 30) %>
<%= t("search.too_many",:search_word => params[:search_query],:exceed_num=>@bulletins.count) if (@bulletins.count ==30) %>
<% end %>
<% @bulletins.each do |post| %>
<tr class=<%= cycle('odd', '') %>>
<%= content_tag(:th) do%>
<td><%= (post.bulletin_category.title rescue nil ) %></td>
<% end if(!params[:search_query].blank? or params[:category_id].blank?) %>
<td><%= link_to post.title, panel_announcement_front_end_bulletin_path(post, :category_id => post.bulletin_category_id) %>
<%#= link_to post.title, panel_announcement_back_end_bulletin_path(post) %>
</td>
<td class="date"><%= display_date_time(post.postdate) %></td>
</tr>
<% end %>
</table>
<% end %>
<% else %>
<table class="table table-bordered">
<tr>
<th><%= t('announcement.bulletin.category') %></th>
<th><%= t('announcement.bulletin.title') %></th> <th><%= t('announcement.bulletin.title') %></th>
<th><%= t('announcement.bulletin.postdate') %></th> <th><%= t('announcement.bulletin.postdate') %></th>
</tr> </tr>
<% if !params[:name].blank?%>
<%= t("search.unit_get",:unit_name => params[:name],:item_num=>@bulletins.count) %>
<% end %>
<% if @bulletins.blank? and !params[:search_query].blank? %>
<%=render :partial => 'shared/search_not_found' %>
<% elsif !params[:search_query].blank? %>
<%= t("search.result_get",:search_word => params[:search_query],:item_num=>@bulletins.count) unless (@bulletins.count == 30) %>
<%= t("search.too_many",:search_word => params[:search_query],:exceed_num=>@bulletins.count) if (@bulletins.count ==30) %>
<% end %>
<% @bulletins.each do |post| %> <% @bulletins.each do |post| %>
<tr> <tr>
<td><%= post.bulletin_category.title rescue nil %></td> <td><%= post.bulletin_category.title rescue nil %></td>
@@ -280,7 +37,5 @@
</table> </table>
<% end %>
<%= paginate @bulletins, :param_name => :page_main, :params => {:inner => 'false'} %> <%= paginate @bulletins, :param_name => :page_main, :params => {:inner => 'false'} %>
@@ -40,7 +40,7 @@
<td> <td>
<div class="label-group"> <div class="label-group">
<% bulletin.sorted_tags.each do |tag| %> <% bulletin.sorted_tags.each do |tag| %>
<span class="label label-tags"><%= tag[I18n.locale] %></span> <span class="label label-tags"><%= tag.name %></span>
<% end %> <% end %>
</div> </div>
</td> </td>
@@ -1,3 +1,3 @@
<li> <li>
<%= link_to tag[I18n.locale], panel_announcement_widget_bulletins_and_web_links_path(:id => tag.id), :remote => true, :class => ('active' if tag.eql?(@selected_tag)) %> <%= link_to tag.name, panel_announcement_widget_bulletins_and_web_links_path(:id => tag.id), :remote => true, :class => ('active' if tag.eql?(@selected_tag)) %>
</li> </li>
@@ -5,7 +5,7 @@
<div class="tag_block"> <div class="tag_block">
<ul class="tag_list"> <ul class="tag_list">
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<li><%= tag[I18n.locale] %></li> <li><%= tag.name %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
@@ -1,8 +1,8 @@
<%= form_tag panel_announcement_front_end_bulletins_path, method: :get do %> <%= form_tag panel_announcement_front_end_announcement_search_path, method: :get do %>
<%= hidden_field_tag :category_id, params[:category_id] %> <%= hidden_field_tag :category_id, params[:category_id] %>
<%= hidden_field_tag :tag_id, params[:tag_id] %> <%= hidden_field_tag :tag_id, params[:tag_id] %>
<p> <p>
<%= text_field_tag :search_query, params[:search_query],{:value => (params[:search_query].blank?? '' : params[:search_query]),:placeholder => t("announcement.search") }%> <%= text_field_tag :search_query, params[:search_query],{:value => (params[:search_query].blank?? '' : params[:search_query]),:placeholder => t("announcement.search") }%>
<%= submit_tag "Search", name: nil %> <%= submit_tag t("search_"), name: nil %>
</p> </p>
<% end %> <% end %>
+2 -1
View File
@@ -34,4 +34,5 @@ en:
url: URL url: URL
widget: widget:
bulletins_and_web_links: Bulletins and Web Resources bulletins_and_web_links: Bulletins and Web Resources
index: Index index: Index
search: Search
@@ -34,4 +34,5 @@ zh_tw:
url: 連結位置 url: 連結位置
widget: widget:
bulletins_and_web_links: 索引 bulletins_and_web_links: 索引
index: 索引 index: 索引
search: 搜尋
+1
View File
@@ -46,6 +46,7 @@ Rails.application.routes.draw do
end end
namespace :front_end do namespace :front_end do
match "index_by_unit" => "bulletins#index_bulletins_by_unit",:as => :index_bulletins_by_unit match "index_by_unit" => "bulletins#index_bulletins_by_unit",:as => :index_bulletins_by_unit
match "search_result" => "bulletins#search_result",:as=>:announcement_search
resources :bulletins # do resources :bulletins # do
# match "preview" => "bulletins#preview_content",:as => :get_preview_content # match "preview" => "bulletins#preview_content",:as => :get_preview_content
# end # end
+6 -1
View File
@@ -39,6 +39,11 @@ module Announcement
widget_i18n "announcement.widget.index" widget_i18n "announcement.widget.index"
style ["1","2"] style ["1","2"]
end end
customize_widget "bulletins_search_block" do
widget_i18n "announcement.widget.search"
end
# item "index","announcement.widget.index",:default_template=>true,:fields=>["title","category","postdate"] # item "index","announcement.widget.index",:default_template=>true,:fields=>["title","category","postdate"]
# item "bulletins_and_web_links","announcement.widget.bulletins_and_web_links" # item "bulletins_and_web_links","announcement.widget.bulletins_and_web_links"
end end
@@ -70,7 +75,7 @@ module Announcement
context_link 'tags', context_link 'tags',
:link_path=>"panel_announcement_back_end_tags_path" , :link_path=>"admin_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Announcement'}))" ,
:priority=>4, :priority=>4,
# :active_for_action=>{:bulletin_categorys=>:index}, # :active_for_action=>{:bulletin_categorys=>:index},
:available_for => [:manager] :available_for => [:manager]
@@ -34,7 +34,7 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController
@archive_files = (params[:sort] || @filter) ? get_sorted_and_filtered("archive_file",:archive_file_category_id.in => @archive_file_category_ids) : get_viewable("archive_file",:archive_file_category_id.in => @archive_file_category_ids) @archive_files = (params[:sort] || @filter) ? get_sorted_and_filtered("archive_file",:archive_file_category_id.in => @archive_file_category_ids) : get_viewable("archive_file",:archive_file_category_id.in => @archive_file_category_ids)
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
@@ -59,7 +59,7 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController
def new def new
@archive_file = ArchiveFile.new @archive_file = ArchiveFile.new
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb
@@ -71,7 +71,7 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController
def edit def edit
@archive_file = ArchiveFile.find(params[:id]) @archive_file = ArchiveFile.find(params[:id])
get_tags @tags = get_tags
end end
# POST /archive_files # POST /archive_files
@@ -86,7 +86,7 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController
format.html { redirect_to(panel_archive_back_end_archive_files_url) } format.html { redirect_to(panel_archive_back_end_archive_files_url) }
format.xml { render :xml => @archive_file, :status => :created, :location => @archive_file } format.xml { render :xml => @archive_file, :status => :created, :location => @archive_file }
else else
get_tags @tags = get_tags
format.html { render :action => "new" } format.html { render :action => "new" }
format.xml { render :xml => @archive_file.errors, :status => :unprocessable_entity } format.xml { render :xml => @archive_file.errors, :status => :unprocessable_entity }
end end
@@ -139,9 +139,4 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController
# @archive_file_categorys = (id ? ArchiveFileCategory.find(id).to_a : ArchiveFileCategory.excludes('disabled' => true)) # @archive_file_categorys = (id ? ArchiveFileCategory.find(id).to_a : ArchiveFileCategory.excludes('disabled' => true))
# end # end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'archive'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end end
+6 -2
View File
@@ -10,9 +10,12 @@ class ArchiveFile
PAYMENT_TYPES = @site_valid_locales PAYMENT_TYPES = @site_valid_locales
include OrbitTag::Taggable
taggable
field :title, localize: true field :title, localize: true
has_and_belongs_to_many :tags, :class_name => "ArchiveTag" # has_and_belongs_to_many :tags, :class_name => "ArchiveTag"
field :create_user_id field :create_user_id
field :update_user_id field :update_user_id
@@ -59,7 +62,8 @@ class ArchiveFile
end end
def sorted_tags def sorted_tags
tags.order_by(I18n.locale, :asc) #tags.order_by(I18n.locale, :asc)
tags
end end
@@ -36,7 +36,7 @@
<div class="label-group"> <div class="label-group">
<div class="label-td"> <div class="label-td">
<% archive_file.sorted_tags.each do |tag| %> <% archive_file.sorted_tags.each do |tag| %>
<span class="label label-tags"><%= tag[I18n.locale] %></span> <span class="label label-tags"><%= tag.name %></span>
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -1,6 +1,6 @@
<div class="accordion-inner" data-toggle="buttons-checkbox"> <div class="accordion-inner" data-toggle="buttons-checkbox">
<% @tags.each do |tag| -%> <% @tags.each do |tag| -%>
<%= link_to tag[I18n.locale], panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'tags', :id => tag.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('tags', tag.id)}" %> <%= link_to tag.name, panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'tags', :id => tag.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('tags', tag.id)}" %>
<% end -%> <% end -%>
</div> </div>
<%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %> <%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %>
@@ -28,7 +28,7 @@
<div class="widget-content clear form-horizontal"> <div class="widget-content clear form-horizontal">
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<%= check_box_tag 'archive_file[tag_ids][]', tag.id, @archive_file.tag_ids.include?(tag.id)%> <%= check_box_tag 'archive_file[tag_ids][]', tag.id, @archive_file.tag_ids.include?(tag.id)%>
<%= tag[I18n.locale] %> <%= tag.name %>
<% end %> <% end %>
</div> </div>
</div> </div>
@@ -1,3 +1,3 @@
<li> <li>
<%= link_to tag[I18n.locale], panel_announcement_widget_bulletins_and_web_links_path(:id => tag.id), :remote => true, :class => ('active' if tag.eql?(@selected_tag)) %> <%= link_to tag.name, panel_announcement_widget_bulletins_and_web_links_path(:id => tag.id), :remote => true, :class => ('active' if tag.eql?(@selected_tag)) %>
</li> </li>
@@ -5,7 +5,7 @@
<div class="tag_block"> <div class="tag_block">
<ul class="tag_list"> <ul class="tag_list">
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<li><%= tag[I18n.locale] %></li> <li><%= tag.name %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
+1 -1
View File
@@ -66,7 +66,7 @@ module Archive
:available_for => [:manager] :available_for => [:manager]
context_link 'tags', context_link 'tags',
:link_path=>"panel_archive_back_end_tags_path" , :link_path=>"admin_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Archive'}))" ,
:priority=>4, :priority=>4,
# :active_for_action=>{:bulletin_categorys=>:index}, # :active_for_action=>{:bulletin_categorys=>:index},
:available_for => [:admin] :available_for => [:admin]
+3
View File
@@ -2,6 +2,9 @@ class Cal
include Mongoid::Document include Mongoid::Document
include Mongoid::Timestamps include Mongoid::Timestamps
include OrbitTag::Taggable
taggable
field :name, localize: true field :name, localize: true
field :color field :color
has_many :events, :autosave => true, :dependent => :destroy has_many :events, :autosave => true, :dependent => :destroy
+1 -1
View File
@@ -25,7 +25,7 @@ module Calendar
:available_for => [:manager] :available_for => [:manager]
context_link 'tags', context_link 'tags',
:link_path=>"panel_calendar_back_end_tags_path" , :link_path=>"admin_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Calendar'}))" ,
:priority=>4, :priority=>4,
# :active_for_action=>{:bulletin_categorys=>:index}, # :active_for_action=>{:bulletin_categorys=>:index},
:available_for => [:manager] :available_for => [:manager]
@@ -37,7 +37,7 @@ class Panel::Faq::BackEnd::QasController < OrbitBackendController
#@qas = (params[:sort] || @filter) ? get_sorted_and_filtered_qas : Qa.all.page(params[:page]).per(10) #@qas = (params[:sort] || @filter) ? get_sorted_and_filtered_qas : Qa.all.page(params[:page]).per(10)
@qas = (params[:sort] || @filter) ? get_sorted_and_filtered("qa",:qa_category_id.in => @qa_category_ids) : get_viewable("qa",:qa_category_id.in => @qa_category_ids) @qas = (params[:sort] || @filter) ? get_sorted_and_filtered("qa",:qa_category_id.in => @qa_category_ids) : get_viewable("qa",:qa_category_id.in => @qa_category_ids)
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
@@ -60,7 +60,7 @@ class Panel::Faq::BackEnd::QasController < OrbitBackendController
# GET /qas/new.xml # GET /qas/new.xml
def new def new
@qa = Qa.new @qa = Qa.new
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb
@@ -71,14 +71,14 @@ class Panel::Faq::BackEnd::QasController < OrbitBackendController
# GET /qas/1/edit # GET /qas/1/edit
def edit def edit
@qa = Qa.find(params[:id]) @qa = Qa.find(params[:id])
get_tags @tags = get_tags
end end
# POST /qas # POST /qas
# POST /qas.xml # POST /qas.xml
def create def create
@qa = Qa.new(params[:qa]) @qa = Qa.new(params[:qa])
get_tags @tags = get_tags
@qa.create_user_id = current_user.id @qa.create_user_id = current_user.id
@qa.update_user_id = current_user.id @qa.update_user_id = current_user.id
@@ -134,11 +134,4 @@ class Panel::Faq::BackEnd::QasController < OrbitBackendController
redirect_to panel_faq_back_end_qas_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) redirect_to panel_faq_back_end_qas_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end end
protected
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'faq'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id}) rescue []
end
end end
+6 -3
View File
@@ -4,13 +4,15 @@ class Qa
include Mongoid::Document include Mongoid::Document
include Mongoid::Timestamps include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes include Mongoid::MultiParameterAttributes
include OrbitTag::Taggable
taggable
scope :available_for_lang, ->(locale){ where("available_for_#{locale}".to_sym => true) } scope :available_for_lang, ->(locale){ where("available_for_#{locale}".to_sym => true) }
field :title, localize: true field :title, localize: true
field :answer, localize: true field :answer, localize: true
has_and_belongs_to_many :tags, :class_name => "FaqTag" #has_and_belongs_to_many :tags, :class_name => "FaqTag"
field :create_user_id field :create_user_id
@@ -61,7 +63,8 @@ class Qa
end end
def sorted_tags def sorted_tags
tags.order_by(I18n.locale, :asc) #tags.order_by(I18n.locale, :asc)
tags
end end
def update_avliable_language def update_avliable_language
@@ -1,6 +1,6 @@
<div class="accordion-inner" data-toggle="buttons-checkbox"> <div class="accordion-inner" data-toggle="buttons-checkbox">
<% @tags.each do |tag| -%> <% @tags.each do |tag| -%>
<%= link_to tag[I18n.locale], panel_faq_back_end_qas_path(:filter => @filter, :new_filter => {:type => 'tags', :id => tag.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('tags', tag.id)}" %> <%= link_to tag.name, panel_faq_back_end_qas_path(:filter => @filter, :new_filter => {:type => 'tags', :id => tag.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('tags', tag.id)}" %>
<% end -%> <% end -%>
</div> </div>
<%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %> <%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %>
@@ -39,7 +39,7 @@
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%> <%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'qa[tag_ids][]', tag.id, @qa.tag_ids.include?(tag.id)%> <%= check_box_tag 'qa[tag_ids][]', tag.id, @qa.tag_ids.include?(tag.id)%>
<%= tag[I18n.locale] %> <%= tag.name %>
<%= hidden_field_tag 'qa[tag_ids][]', '' %> <%= hidden_field_tag 'qa[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <% end %>
@@ -35,7 +35,7 @@
<div class="label-group"> <div class="label-group">
<div class="label-td"> <div class="label-td">
<% qa.sorted_tags.each do |tag| %> <% qa.sorted_tags.each do |tag| %>
<span class="label label-tags"><%= tag[I18n.locale] %></span> <span class="label label-tags"><%= tag.name %></span>
<% end %> <% end %>
</div> </div>
</div> </div>
+1 -1
View File
@@ -64,7 +64,7 @@ module Faq
:available_for => [:manager] :available_for => [:manager]
context_link 'tags', context_link 'tags',
:link_path=>"panel_faq_back_end_tags_path" , :link_path=>"admin_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Faq'}))" ,
:priority=>4, :priority=>4,
# :active_for_action=>{:bulletin_categorys=>:index}, # :active_for_action=>{:bulletin_categorys=>:index},
:available_for => [:manager] :available_for => [:manager]
@@ -2,6 +2,9 @@ class GalleryAlbum
include Mongoid::Document include Mongoid::Document
include Mongoid::Timestamps include Mongoid::Timestamps
include OrbitTag::Taggable
taggable
field :name, localize: true field :name, localize: true
field :description, localize: true field :description, localize: true
field :cover, default: "default" field :cover, default: "default"
@@ -9,7 +12,7 @@ class GalleryAlbum
field :tag_names field :tag_names
belongs_to :gallery_category belongs_to :gallery_category
has_and_belongs_to_many :tags, :class_name => "GalleryTag" # has_and_belongs_to_many :tags, :class_name => "GalleryTag"
has_many :gallery_images, :autosave => true, :dependent => :destroy has_many :gallery_images, :autosave => true, :dependent => :destroy
accepts_nested_attributes_for :gallery_images, :allow_destroy => true accepts_nested_attributes_for :gallery_images, :allow_destroy => true
@@ -53,7 +53,7 @@
<ul class="tag_list" id="gallery_tag_list"> <ul class="tag_list" id="gallery_tag_list">
<%# if @authenticated %> <%# if @authenticated %>
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag[I18n.locale] %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li> <li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag.name %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li>
<% end %> <% end %>
<%# end %> <%# end %>
</ul> </ul>
@@ -98,7 +98,7 @@
<div class="overview"> <div class="overview">
<ul class="tag_list" id="gallery_tag_list"> <ul class="tag_list" id="gallery_tag_list">
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag[I18n.locale] %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li> <li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag.name %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
@@ -27,7 +27,7 @@
<div class="accordion-body collapse" id="collapse-tags"> <div class="accordion-body collapse" id="collapse-tags">
<div class="accordion-inner filter_btns tags" data-toggle="buttons-checkbox"> <div class="accordion-inner filter_btns tags" data-toggle="buttons-checkbox">
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<a href="tag=<%= tag.id %>" class="btn" onclick="return false;"><%= tag[I18n.locale] %></a> <a href="tag=<%= tag.id %>" class="btn" onclick="return false;"><%= tag.name %></a>
<% end %> <% end %>
</div> </div>
<div class="filter-clear"> <div class="filter-clear">
@@ -29,7 +29,7 @@
<div class="overview"> <div class="overview">
<ul class="tag_list" id="gallery_tag_list"> <ul class="tag_list" id="gallery_tag_list">
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag[I18n.locale] %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li> <li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag.name %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
@@ -33,7 +33,7 @@
<div class="overview"> <div class="overview">
<ul class="tag_list" id="gallery_tag_list"> <ul class="tag_list" id="gallery_tag_list">
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag[I18n.locale] %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li> <li data-content="<%= tag.id %>"><input id="tag_<%= tag.id %>" type="checkbox"><label for="tag_<%= tag.id %>"><%= tag.name %></label><span style="display:none;"><%= tag[@locales[1]] %> <%= tag[@locales[0]] %></span></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>
+1 -1
View File
@@ -55,7 +55,7 @@ module Gallery
:available_for => [:manager] :available_for => [:manager]
context_link 'tags', context_link 'tags',
:link_path=>"panel_gallery_back_end_tags_path" , :link_path=>"admin_tags_path(:module_app_id => ModuleApp.first(conditions: {title: 'Gallery'}))" ,
:priority=>4, :priority=>4,
# :active_for_action=>{:bulletin_categorys=>:index}, # :active_for_action=>{:bulletin_categorys=>:index},
:available_for => [:manager] :available_for => [:manager]
@@ -41,7 +41,7 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
@writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_book",:book_paper_type_id.in => @paper_type_ids) : get_viewable("writing_book",:book_paper_type_id.in => @paper_type_ids) @writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_book",:book_paper_type_id.in => @paper_type_ids) : get_viewable("writing_book",:book_paper_type_id.in => @paper_type_ids)
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
@@ -57,7 +57,7 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
@author_types = BookAuthorType.all @author_types = BookAuthorType.all
@paper_types = BookPaperType.all @paper_types = BookPaperType.all
get_tags @tags = get_tags
@set_author_type = BookAuthorType.new(:display => 'List') @set_author_type = BookAuthorType.new(:display => 'List')
@author_type_url = panel_personal_book_back_end_writing_books_path @author_type_url = panel_personal_book_back_end_writing_books_path
@@ -132,7 +132,7 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
@author_types = BookAuthorType.all @author_types = BookAuthorType.all
@paper_types = BookPaperType.all @paper_types = BookPaperType.all
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb
@@ -151,7 +151,7 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
@author_types = BookAuthorType.all @author_types = BookAuthorType.all
@paper_types = BookPaperType.all @paper_types = BookPaperType.all
get_tags @tags = get_tags
end end
# POST /writing_books # POST /writing_books
@@ -184,7 +184,7 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
# @level_types = BookLevelType.all # @level_types = BookLevelType.all
@author_types = BookAuthorType.all @author_types = BookAuthorType.all
@paper_types = BookPaperType.all @paper_types = BookPaperType.all
get_tags @tags = get_tags
@writing_book = WritingBook.new(params[:writing_book]) @writing_book = WritingBook.new(params[:writing_book])
@@ -316,9 +316,4 @@ class Panel::PersonalBook::BackEnd::WritingBooksController < OrbitBackendControl
@plugins = OrbitApp::Plugin::Registration.all @plugins = OrbitApp::Plugin::Registration.all
end end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_book'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end end
@@ -21,10 +21,4 @@ class Panel::PersonalBook::FrontEnd::WritingBooksController < OrbitWidgetControl
end end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_book'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end end
@@ -37,7 +37,7 @@ class Panel::PersonalBook::Plugin::WritingBooksController < OrbitBackendControll
#@writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_books : WritingBook.all.page(params[:page]).per(10) #@writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_books : WritingBook.all.page(params[:page]).per(10)
@writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_book",:create_user_id => current_user.id) : get_viewable("writing_book", :create_user_id => current_user.id) @writing_books = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_book",:create_user_id => current_user.id) : get_viewable("writing_book", :create_user_id => current_user.id)
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
@@ -66,7 +66,7 @@ class Panel::PersonalBook::Plugin::WritingBooksController < OrbitBackendControll
@author_types = BookAuthorType.all @author_types = BookAuthorType.all
@paper_types = BookPaperType.all @paper_types = BookPaperType.all
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb
@@ -82,7 +82,7 @@ class Panel::PersonalBook::Plugin::WritingBooksController < OrbitBackendControll
@author_types = BookAuthorType.all @author_types = BookAuthorType.all
@paper_types = BookPaperType.all @paper_types = BookPaperType.all
get_tags @tags = get_tags
end end
# POST /writing_books # POST /writing_books
@@ -92,7 +92,7 @@ class Panel::PersonalBook::Plugin::WritingBooksController < OrbitBackendControll
# @level_types = BookLevelType.all # @level_types = BookLevelType.all
@author_types = BookAuthorType.all @author_types = BookAuthorType.all
@paper_types = BookPaperType.all @paper_types = BookPaperType.all
get_tags @tags = get_tags
@writing_book = WritingBook.new(params[:writing_book]) @writing_book = WritingBook.new(params[:writing_book])
@@ -178,9 +178,4 @@ class Panel::PersonalBook::Plugin::WritingBooksController < OrbitBackendControll
# end # end
# end # end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_book'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end end
@@ -79,7 +79,8 @@ class WritingBook
end end
def sorted_tags def sorted_tags
tags.order_by(I18n.locale, :asc) #tags.order_by(I18n.locale, :asc)
tags
end end
def update_avliable_language def update_avliable_language
@@ -32,7 +32,7 @@
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%> <%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_book[tag_ids][]', tag.id, @writing_book.tag_ids.include?(tag.id)%> <%= check_box_tag 'writing_book[tag_ids][]', tag.id, @writing_book.tag_ids.include?(tag.id)%>
<%= tag[I18n.locale] %> <%= tag.name %>
<%= hidden_field_tag 'writing_book[tag_ids][]', '' %> <%= hidden_field_tag 'writing_book[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <% end %>
@@ -32,7 +32,7 @@
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%> <%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_book[tag_ids][]', tag.id, @writing_book.tag_ids.include?(tag.id)%> <%= check_box_tag 'writing_book[tag_ids][]', tag.id, @writing_book.tag_ids.include?(tag.id)%>
<%= tag[I18n.locale] %> <%= tag.name %>
<%= hidden_field_tag 'writing_book[tag_ids][]', '' %> <%= hidden_field_tag 'writing_book[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <% end %>
@@ -42,7 +42,7 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_conference",:conference_paper_type_id.in => @paper_type_ids) : get_viewable("writing_conference",:conference_paper_type_id.in => @paper_type_ids) @writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_conference",:conference_paper_type_id.in => @paper_type_ids) : get_viewable("writing_conference",:conference_paper_type_id.in => @paper_type_ids)
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
@@ -58,7 +58,7 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
@author_types = ConferenceAuthorType.all @author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all @paper_types = ConferencePaperType.all
get_tags @tags = get_tags
@set_author_type = ConferenceAuthorType.new(:display => 'List') @set_author_type = ConferenceAuthorType.new(:display => 'List')
@author_type_url = panel_personal_conference_back_end_writing_conferences_path @author_type_url = panel_personal_conference_back_end_writing_conferences_path
@@ -132,7 +132,7 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
# @paper_types = ConferenceLevelType.all # @paper_types = ConferenceLevelType.all
@author_types = ConferenceAuthorType.all @author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all @paper_types = ConferencePaperType.all
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb
@@ -151,7 +151,7 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
@author_types = ConferenceAuthorType.all @author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all @paper_types = ConferencePaperType.all
get_tags @tags = get_tags
end end
# POST /writing_conferences # POST /writing_conferences
@@ -183,7 +183,7 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
# @paper_types = ConferenceLevelType.all # @paper_types = ConferenceLevelType.all
@author_types = ConferenceAuthorType.all @author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all @paper_types = ConferencePaperType.all
get_tags @tags = get_tags
@writing_conference = WritingConference.new(params[:writing_conference]) @writing_conference = WritingConference.new(params[:writing_conference])
@@ -315,9 +315,4 @@ class Panel::PersonalConference::BackEnd::WritingConferencesController < OrbitBa
@plugins = OrbitApp::Plugin::Registration.all @plugins = OrbitApp::Plugin::Registration.all
end end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_conference'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end end
@@ -23,9 +23,4 @@ class Panel::PersonalConference::FrontEnd::WritingConferencesController < OrbitW
end end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_conference'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end end
@@ -38,7 +38,7 @@ class Panel::PersonalConference::Plugin::WritingConferencesController < OrbitBac
#@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_conferences : WritingConference.all.page(params[:page]).per(10) #@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered_writing_conferences : WritingConference.all.page(params[:page]).per(10)
@writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_conference",:create_user_id => current_user.id) : get_viewable("writing_conference", :create_user_id => current_user.id) @writing_conferences = (params[:sort] || @filter) ? get_sorted_and_filtered("writing_conference",:create_user_id => current_user.id) : get_viewable("writing_conference", :create_user_id => current_user.id)
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
@@ -67,7 +67,7 @@ class Panel::PersonalConference::Plugin::WritingConferencesController < OrbitBac
@author_types = ConferenceAuthorType.all @author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all @paper_types = ConferencePaperType.all
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb
@@ -83,7 +83,7 @@ class Panel::PersonalConference::Plugin::WritingConferencesController < OrbitBac
@author_types = ConferenceAuthorType.all @author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all @paper_types = ConferencePaperType.all
get_tags @tags = get_tags
end end
# POST /writing_conferences # POST /writing_conferences
@@ -93,7 +93,7 @@ class Panel::PersonalConference::Plugin::WritingConferencesController < OrbitBac
# @level_types = ConferenceLevelType.all # @level_types = ConferenceLevelType.all
@author_types = ConferenceAuthorType.all @author_types = ConferenceAuthorType.all
@paper_types = ConferencePaperType.all @paper_types = ConferencePaperType.all
get_tags @tags = get_tags
@writing_conference = WritingConference.new(params[:writing_conference]) @writing_conference = WritingConference.new(params[:writing_conference])
@@ -179,9 +179,4 @@ class Panel::PersonalConference::Plugin::WritingConferencesController < OrbitBac
# end # end
# end # end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_conference'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end end
@@ -80,7 +80,8 @@ class WritingConference
end end
def sorted_tags def sorted_tags
tags.order_by(I18n.locale, :asc) #tags.order_by(I18n.locale, :asc)
tags
end end
def update_avliable_language def update_avliable_language
@@ -48,7 +48,7 @@
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%> <%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_conference[tag_ids][]', tag.id, @writing_conference.tag_ids.include?(tag.id)%> <%= check_box_tag 'writing_conference[tag_ids][]', tag.id, @writing_conference.tag_ids.include?(tag.id)%>
<%= tag[I18n.locale] %> <%= tag.name %>
<%= hidden_field_tag 'writing_conference[tag_ids][]', '' %> <%= hidden_field_tag 'writing_conference[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <% end %>
@@ -48,7 +48,7 @@
<% @tags.each do |tag| %> <% @tags.each do |tag| %>
<%= content_tag :label,:class => "checkbox inline" do -%> <%= content_tag :label,:class => "checkbox inline" do -%>
<%= check_box_tag 'writing_conference[tag_ids][]', tag.id, @writing_conference.tag_ids.include?(tag.id)%> <%= check_box_tag 'writing_conference[tag_ids][]', tag.id, @writing_conference.tag_ids.include?(tag.id)%>
<%= tag[I18n.locale] %> <%= tag.name %>
<%= hidden_field_tag 'writing_conference[tag_ids][]', '' %> <%= hidden_field_tag 'writing_conference[tag_ids][]', '' %>
<% end %> <% end %>
<% end %> <% end %>
@@ -31,7 +31,7 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
@diplomas = (params[:sort] || @filter) ? get_sorted_and_filtered("diploma") : get_viewable("diploma") @diplomas = (params[:sort] || @filter) ? get_sorted_and_filtered("diploma") : get_viewable("diploma")
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
@@ -44,7 +44,7 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
get_plugins get_plugins
get_tags @tags = get_tags
end end
@@ -66,7 +66,7 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
@diploma = Diploma.new @diploma = Diploma.new
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb
@@ -81,14 +81,14 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
@diploma = Diploma.find(params[:id]) @diploma = Diploma.find(params[:id])
get_tags @tags = get_tags
end end
# POST /diplomas # POST /diplomas
# POST /diplomas.xml # POST /diplomas.xml
def create def create
get_tags @tags = get_tags
@diploma = Diploma.new(params[:diploma]) @diploma = Diploma.new(params[:diploma])
@@ -190,9 +190,4 @@ class Panel::PersonalDiploma::BackEnd::DiplomasController < OrbitBackendControll
@plugins = OrbitApp::Plugin::Registration.all @plugins = OrbitApp::Plugin::Registration.all
end end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_diploma'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end end
@@ -27,7 +27,7 @@ class Panel::PersonalDiploma::Plugin::DiplomasController < OrbitBackendControlle
end end
@diplomas = (params[:sort] || @filter) ? get_sorted_and_filtered("diploma",:create_user_id => current_user.id) : get_viewable("diploma", :create_user_id => current_user.id) @diplomas = (params[:sort] || @filter) ? get_sorted_and_filtered("diploma",:create_user_id => current_user.id) : get_viewable("diploma", :create_user_id => current_user.id)
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
@@ -38,7 +38,7 @@ class Panel::PersonalDiploma::Plugin::DiplomasController < OrbitBackendControlle
def diploma_setting def diploma_setting
get_tags @tags = get_tags
end end
@@ -58,7 +58,7 @@ class Panel::PersonalDiploma::Plugin::DiplomasController < OrbitBackendControlle
@diploma = Diploma.new @diploma = Diploma.new
get_tags @tags = get_tags
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb
@@ -70,14 +70,14 @@ class Panel::PersonalDiploma::Plugin::DiplomasController < OrbitBackendControlle
def edit def edit
@diploma = Diploma.find(params[:id]) @diploma = Diploma.find(params[:id])
get_tags @tags = get_tags
end end
# POST /diplomas # POST /diplomas
# POST /diplomas.xml # POST /diplomas.xml
def create def create
get_tags @tags = get_tags
@diploma = Diploma.new(params[:diploma]) @diploma = Diploma.new(params[:diploma])
@@ -164,9 +164,4 @@ class Panel::PersonalDiploma::Plugin::DiplomasController < OrbitBackendControlle
# end # end
# end # end
def get_tags
module_app = ModuleApp.first(:conditions => {:key => 'personal_diploma'})
@tags = Tag.all(:conditions => {:module_app_id => module_app.id})
end
end end
Loaded 100 of 150 files, more files were not shown because too many files have changed in this diff. Show more