diff --git a/app/controllers/admin/plugins_controller.rb b/app/controllers/admin/plugins_controller.rb index 57cb9ad8..431bc3fe 100644 --- a/app/controllers/admin/plugins_controller.rb +++ b/app/controllers/admin/plugins_controller.rb @@ -15,11 +15,11 @@ class Admin::PluginsController < ApplicationController format.html { redirect_to( @right_partial ) } end else - @right_partial = "admin/users_new_interface/plugin_summary" + @right_partial = "" end else - @right_partial = "admin/users_new_interface/plugin_summary" + @right_partial = "" end end diff --git a/app/views/admin/plugins/index.html.erb b/app/views/admin/plugins/index.html.erb index cb0d5c7e..adff640d 100644 --- a/app/views/admin/plugins/index.html.erb +++ b/app/views/admin/plugins/index.html.erb @@ -5,5 +5,5 @@
<%= render :partial => 'plugin_list' %> - <%= render :partial => @right_partial %> + <%= render :partial => @right_partial if !@right_partial.blank? %>
\ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/assets/stylesheets/archive/archives.css b/vendor/built_in_modules/archive/app/assets/stylesheets/archive/archives.css new file mode 100755 index 00000000..5ddf6697 --- /dev/null +++ b/vendor/built_in_modules/archive/app/assets/stylesheets/archive/archives.css @@ -0,0 +1,133 @@ +/* General style with default layout */ +.o-archives {} +.o-archives-content {} +.o-archives-group { + margin: 20px 0 0 0; + padding: 20px 0 0 0; + border-top: dashed 1px #eee; +} +.o-archives-group:first-child { + margin: 0; + padding: 0; + border: 0; +} +.o-archives-category { + padding-bottom: 16px; + border-bottom: solid 2px #ccc; + font-weight: bold; +} +.o-archives-list {} +.o-archives-list ul { + margin: 0; + padding: 0; + list-style: none; +} +.o-archives-list li {} +.o-archives-title { + border-left: solid 8px #eee; + border-bottom: solid 1px #eee; + padding: 0 0 0 16px; +} +.o-archives-list-item {} +.o-archives-list-item ol {} +.o-archives-list-item li { + margin: 0 0 10px 0; +} +.o-archives-file {} +.o-archives-file:hover {} +.o-archives-file-type { + display: inline-block; + vertical-align: top; + margin-left: 8px; + padding: 0 6px; + height: 16px; + font-size: 10px; + text-transform: uppercase; + line-height: 16px; + background-color: #666; + color: #fff; + border-radius: 3px; +} + +/* Tag list */ +.o-archives-tag-list {} +.o-archives-tag-list ul { + margin: 0 -4px; + padding: 0; + list-style: none; +} +.o-archives-tag-list ul:after { + content: "."; + clear: both; + display: block; + height: 0; + visibility: hidden; +} +.o-archives-tag-list li { + float: left; + margin: 0 4px 8px 4px; +} +.o-archives-tag { + display: block; + border: solid 1px #ccc; + padding: 2px 6px; +} +.o-archives-tag:hover {} + +/* Table layout */ +.o-archives.layout-table {} +.o-archives-search { + overflow: hidden; + margin: 0 0 10px 0; +} +.o-archives-search label { + display: inline-block; + margin: 0 8px 0 0; +} +.o-archives-search-option { + float: right; +} +.o-archives-search-option select { + width: 80px; +} +.o-archives-search-keyword {} +.o-archives-search-keyword input[type=submit] { + display: inline-block; + vertical-align: top; + margin: 0 0 0 8px; +} +.o-archives.layout-table table { + width: 100%; + table-layout: fixed; +} +.o-archives.layout-table tbody td { + vertical-align: top; + border-top: solid 1px #eee; + padding: 8px 4px; +} +.o-archives.layout-table .even {} +.o-archives.layout-table .even td {} +.o-archives.layout-table .column-ctrl { + text-align: left; +} +.o-archives.layout-table .column-ctrl.col-title { width: 30% } +.o-archives.layout-table .column-ctrl.col-file {} +.o-archives.layout-table .column-ctrl.col-category { width: 15%; } +.o-archives.layout-table .column-ctrl.col-tag { width: 20%; } +.o-archives.layout-table .o-archives-title { + font-weight: bold; + border: 0; + padding: 0; +} +.o-archives.layout-table .o-archives-category { + padding: 0; + margin: 0; + border: 0; +} +.o-archives.layout-table .o-archives-tag { + display: inline-block; + margin-bottom: 3px; +} +.o-archives.layout-table .o-archives-category { + font-weight: normal; +} \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_file_categorys_controller.rb b/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_file_categorys_controller.rb index beed6b8a..3d1156a6 100644 --- a/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_file_categorys_controller.rb +++ b/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_file_categorys_controller.rb @@ -1,7 +1,11 @@ -class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendController +class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendController + before_filter :for_app_manager,:except => [:index] + include OrbitControllerLib::DivisionForDisable + def index - @archive_file_categorys = ArchiveFileCategory.all + @archive_file_categorys = get_categories_for_index("ArchiveFileCategory") + # @archive_file_categorys = ArchiveFileCategory.all @archive_file_category = ArchiveFileCategory.new(:display => 'List') @url = panel_archive_back_end_archive_file_categorys_path @@ -85,12 +89,19 @@ class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendCont # DELETE /archive_files/1.xml def destroy @archive_file_category = ArchiveFileCategory.find(params[:id]) - @archive_file_category.destroy + @archive_file_category.disable = @archive_file_category.disable ? false : true - respond_to do |format| - format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url) } - # format.xml { head :ok } - format.js + if @archive_file_category.save! + respond_to do |format| + flash[:notice] = t("update.success_") + # flash[:error] += @archive_file_category.disable ? t(:enable) : t(disable) + format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url) } + # format.xml { head :ok } + format.js + end + else + flash[:error] = t("update.fail") + format.html { render :action => "index" } end end end diff --git a/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_files_controller.rb b/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_files_controller.rb index 41a4fb1a..512fb11c 100644 --- a/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_files_controller.rb +++ b/vendor/built_in_modules/archive/app/controllers/panel/archive/back_end/archive_files_controller.rb @@ -1,20 +1,45 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController + # before_filter :for_app_manager,:except => [:index,:show] + include OrbitControllerLib::DivisionForDisable + before_filter :force_order_for_visitor,:only=>[:index] before_filter :force_order_for_user,:except => [:index] + before_filter :for_app_sub_manager,:except => [:index] + before_filter :only => [ :new,:edit,:update,:create] do |controller| + controller.get_categorys('ArchiveFileCategory') + end def index - - get_categorys(params[:archive_file_category_id]) - - @archive_files = ArchiveFile.all.page(params[:page]).per(10) - - get_tags + + get_categorys("ArchiveFileCategory",params[:archive_file_category_id]) + @filter = params[:filter] + new_filter = params[:new_filter] + + if @filter && params[:clear] + @filter.delete(params[:type]) + elsif @filter && new_filter + if @filter.has_key?(new_filter[:type]) && @filter[new_filter[:type]].include?(new_filter[:id].to_s) + @filter[new_filter[:type]].delete(new_filter[:id].to_s) + elsif @filter.has_key?(new_filter[:type]) + @filter[new_filter[:type]] << new_filter[:id].to_s + else + @filter.merge!({new_filter[:type] => [new_filter[:id].to_s]}) + end + elsif new_filter + @filter = {new_filter[:type] => [new_filter[:id].to_s]} + end + @archive_filecategories = get_categories_for_index("ArchiveFileCategory") + @archive_file_category_ids = @archive_file_categories.collect{|t| t.id.to_s} + [nil] + + @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 respond_to do |format| format.html # index.html.erb - format.js format.xml { render :xml => @archive_files } + format.js end end @@ -22,7 +47,6 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController # GET /archive_files/1.xml def show @archive_file = ArchiveFile.find(params[:id]) - # get_categorys respond_to do |format| format.html # show.html.erb @@ -35,9 +59,7 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController def new @archive_file = ArchiveFile.new - get_categorys - - get_tags + get_tags respond_to do |format| format.html # new.html.erb @@ -48,7 +70,7 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController # GET /archive_files/1/edit def edit @archive_file = ArchiveFile.find(params[:id]) - get_categorys + get_tags end @@ -64,7 +86,6 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController format.html { redirect_to(panel_archive_back_end_archive_files_url) } format.xml { render :xml => @archive_file, :status => :created, :location => @archive_file } else - get_categorys get_tags format.html { render :action => "new" } format.xml { render :xml => @archive_file.errors, :status => :unprocessable_entity } @@ -83,7 +104,7 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController respond_to do |format| if @archive_file.update_attributes(params[:archive_file]) - format.html { redirect_to(panel_archive_back_end_archive_files_url) } + format.html { redirect_to(panel_archive_back_end_archive_files_url(:page => params[:page])) } format.xml { head :ok } else format.html { render :action => "edit" } @@ -104,12 +125,19 @@ class Panel::Archive::BackEnd::ArchiveFilesController < OrbitBackendController format.js end end + + def delete + if params[:ids] + archive_files = ArchiveFile.any_in(:_id => params[:ids]).destroy_all + end + redirect_to panel_archive_back_end_archive_files_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]) + end protected - def get_categorys(id = nil) - @archive_file_categorys = (id ? ArchiveFileCategory.find(id).to_a : ArchiveFileCategory.excludes('disabled' => true)) - end + # def get_categorys(id = nil) + # @archive_file_categorys = (id ? ArchiveFileCategory.find(id).to_a : ArchiveFileCategory.excludes('disabled' => true)) + # end def get_tags module_app = ModuleApp.first(:conditions => {:key => 'archive'}) diff --git a/vendor/built_in_modules/archive/app/controllers/panel/archive/front_end/archive_files_controller.rb b/vendor/built_in_modules/archive/app/controllers/panel/archive/front_end/archive_files_controller.rb index a436f5a9..72728f15 100644 --- a/vendor/built_in_modules/archive/app/controllers/panel/archive/front_end/archive_files_controller.rb +++ b/vendor/built_in_modules/archive/app/controllers/panel/archive/front_end/archive_files_controller.rb @@ -24,69 +24,24 @@ class Panel::Archive::FrontEnd::ArchiveFilesController < OrbitWidgetController # @archive_files = ArchiveFile.where( :is_hidden => false ).desc(:is_top).page(params[:page]).per(@page_num) if !params[:category_id].blank? - @archive_files = ArchiveFile.can_display.where(:archive_file_category_id => params[:category_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num) + @archive_files = ArchiveFile.all.can_display.any_in(:archive_file_category_id => params[:category_id]).merge(ArchiveFileCategory.excludes('disable' => true)).desc( :is_top ).page( params[:page_main] ).per(@page_num) @current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil elsif !params[:tag_id].blank? @tag = ArchiveTag.find(params[:tag_id]) rescue nil @tag = ArchiveTag.where(key: params[:tag_id])[0] unless @tag @archive_files = @tag.archive_files.can_display.desc( :is_top ).page( params[:page_main] ).per(@page_num) + + get_categorys else - @archive_files = ArchiveFile.can_display.desc( :is_top ).page( params[:page_main] ).per(@page_num) + @archive_files = ArchiveFile.all.can_display.merge(ArchiveFileCategory.excludes('disable' => true)).desc( :is_top ).page( params[:page_main] ).per(@page_num) + + get_categorys end - get_categorys - end - - def show - - @item = Page.find(params[:page_id]) - - @title = @item.title - - @archive_file = ArchiveFile.find(params[:id]) - - get_categorys - - end - - protected - - def reload_archive_files - - @item = Page.find(params[:page_id]) - - @title = @item.title - - if @item.frontend_data_count - @page_num = @item.frontend_data_count - else - @page_num = 0 - end - - date_now = Time.now - - @archive_file_categorys = ArchiveFileCategory.all - - # @archive_files = ArchiveFile.where( :is_hidden => false ).desc(:is_top).page(params[:page]).per(@page_num) - - - if !params[:category_id].blank? - @archive_files = ArchiveFile.can_display.where(:archive_file_category_id => params[:category_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num) - @current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil - elsif !params[:tag_id].blank? - @tag = ArchiveTag.find(params[:tag_id]) rescue nil - @tag = ArchiveTag.where(key: params[:tag_id])[0] unless @tag - @archive_files = @tag.archive_files.can_display.desc( :is_top ).page( params[:page_main] ).per(@page_num) - else - @archive_files = ArchiveFile.can_display.desc( :is_top ).page( params[:page_main] ).per(@page_num) - end - - get_categorys - end def get_categorys - @archive_file_categorys = ArchiveFileCategory.excludes('disabled' => true) + @archive_file_categorys = ArchiveFileCategory.excludes('disable' => true) end end diff --git a/vendor/built_in_modules/archive/app/controllers/panel/archive/widget/archive_files_controller.rb b/vendor/built_in_modules/archive/app/controllers/panel/archive/widget/archive_files_controller.rb new file mode 100644 index 00000000..e9dc6362 --- /dev/null +++ b/vendor/built_in_modules/archive/app/controllers/panel/archive/widget/archive_files_controller.rb @@ -0,0 +1,48 @@ +class Panel::Archive::Widget::ArchiveFilesController < OrbitWidgetController + + def initialize + super + @app_title = 'archive_files' + end + + def index + + @part = PagePart.find(params[:part_id]) + + if @part.widget_data_count + @page_num = @part.widget_data_count + else + @page_num = 4 + end + + if @part.widget_field + @widget_fields = @part.widget_field + else + @widget_fields = [] + end + + @widget_style = @part.widget_style + + @category_id = @part.category + + date_now = Time.now + + if !params[:category_id].blank? + @archive_files = ArchiveFile.all.can_display.any_in(:archive_file_category_id => params[:category_id]).merge(ArchiveFileCategory.excludes('disable' => true)).desc( :is_top ).page( params[:page_main] ).per(@page_num) + @archive_file_categorys = ArchiveFileCategory.any_in(:_id => params[:category_id]).excludes('disable' => true) + elsif !params[:tag_id].blank? + @tag = ArchiveTag.find(params[:tag_id]) rescue nil + @tag = ArchiveTag.where(key: params[:tag_id])[0] unless @tag + get_categorys + else + @archive_files = ArchiveFile.all.can_display.merge(ArchiveFileCategory.excludes('disable' => true)).desc( :is_top ).page( params[:page_main] ).per(@page_num) + get_categorys + end + + end + + def get_categorys + @archive_file_categorys = ArchiveFileCategory.excludes('disable' => true) + end + +end diff --git a/vendor/built_in_modules/archive/app/models/archive_file.rb b/vendor/built_in_modules/archive/app/models/archive_file.rb index 2d53e7ff..75b74bc0 100644 --- a/vendor/built_in_modules/archive/app/models/archive_file.rb +++ b/vendor/built_in_modules/archive/app/models/archive_file.rb @@ -4,6 +4,9 @@ class ArchiveFile include Mongoid::Document include Mongoid::Timestamps include Mongoid::MultiParameterAttributes + + BelongsToCategory = :archive_file_category + include OrbitCoreLib::BelongsToCategoryMayDisable PAYMENT_TYPES = @site_valid_locales @@ -20,7 +23,7 @@ class ArchiveFile scope :can_display,where(is_hidden: false) - belongs_to :archive_file_category + # belongs_to :archive_file_category has_many :archive_file_multiples, :autosave => true, :dependent => :destroy @@ -47,13 +50,22 @@ class ArchiveFile def self.widget_datas - where( :is_hidden => false ).desc(:is_top, :title) + where( :is_hidden => false ).desc(:is_top, :title) end def is_top? self.is_top end + + def sorted_tags + tags.order_by(I18n.locale, :asc) + end + + + def get_file_icon( file_data ) + file_icon = "#{file_data.split('.')[1]}".html_safe + end def save_archive_file_multiples self.archive_file_multiples.each do |t| diff --git a/vendor/built_in_modules/archive/app/models/archive_file_category.rb b/vendor/built_in_modules/archive/app/models/archive_file_category.rb index cd1a011f..1bd00fbf 100644 --- a/vendor/built_in_modules/archive/app/models/archive_file_category.rb +++ b/vendor/built_in_modules/archive/app/models/archive_file_category.rb @@ -3,15 +3,25 @@ class ArchiveFileCategory include Mongoid::Document include Mongoid::Timestamps + include OrbitCoreLib::ObjectAuthable + include OrbitCoreLib::ObjectDisable # include Mongoid::MultiParameterAttributes + APP_NAME = 'Archive' + ObjectAuthTitlesOptions = %W{submit_new fact_check} + AfterObjectAuthUrl = '/panel/archive/back_end/archive_file_categorys' - field :key - + field :disable, type: Boolean, :default => false + field :display + field :key field :title, localize: true has_many :archive_files validates :title, :at_least_one => true + + def pp_object + title + end def self.from_id(id) ArchiveFileCategory.find(id) rescue nil diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb index 9022282a..48d26f6c 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/_archive_file_category.html.erb @@ -6,6 +6,7 @@
diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/destroy.js.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/destroy.js.erb index a8b303ed..79515598 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/destroy.js.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_file_categorys/destroy.js.erb @@ -1 +1 @@ -$("#<%= dom_id @archive_file_category %>").remove(); \ No newline at end of file +$("#<%= dom_id @archive_file_category %>").find(".archive_toggle").text("<%= show_toggle_archive_btn(@archive_file_category) %> "); \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_archive_file.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_archive_file.html.erb index 2246d525..3c778200 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_archive_file.html.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_archive_file.html.erb @@ -1,32 +1,45 @@ - - <% if archive_file.is_top? %> - <%= t(:top) %> - <% end %> - <% if archive_file.is_hot? %> - <%= t(:hot) %> - <% end %> - <% if archive_file.is_hidden? %> - <%= t(:hidden) %> - <% end %> - <% if is_manager?%> -
- + <% if (archive_file.create_user_id == current_or_guest_user.id) || is_manager? %> + <%= check_box_tag 'to_delete[]', archive_file.id, false, :class => "checkbox_in_list" %> + <% end -%> + + +
+
+ <% if archive_file.is_top? %> + <%= t(:top) %> + <% end %> + <% if archive_file.is_hot? %> + <%= t(:hot) %> + <% end %> + <% if archive_file.is_hidden? %> + <%= t(:hidden) %> + <% end %> +
- <%end%> <%= archive_file.archive_file_category.title %> <%= link_to archive_file.title, panel_archive_front_end_archive_file_path(archive_file) %> + +
+ +
- <% archive_file.tags.each do |tag| %> - <%= tag[I18n.locale] %> - <% end %> +
+
+ <% archive_file.sorted_tags.each do |tag| %> + <%= tag[I18n.locale] %> + <% end %> +
+
diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_clear_filters.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_clear_filters.html.erb new file mode 100644 index 00000000..a15f7993 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_clear_filters.html.erb @@ -0,0 +1,3 @@ +
+ <%= link_to content_tag(:i, nil, :class => 'icons-cycle') + t(:clear), panel_archive_back_end_archive_files_path(:filter => @filter, :sort => params[:sort], :direction => params[:direction], :clear => true, :type => type), :class => "btn btn-small js_history" %> +
\ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter.html.erb new file mode 100644 index 00000000..906db029 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter.html.erb @@ -0,0 +1,37 @@ + + +<% content_for :page_specific_javascript do %> + <%= javascript_include_tag "sort_header" %> +<% end %> diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter_categories.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter_categories.html.erb new file mode 100644 index 00000000..bc55aa68 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter_categories.html.erb @@ -0,0 +1,6 @@ +
+ <% @archive_file_categories.each do |category| -%> + <%= link_to category.title, panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'categories', :id => category.id}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('categories', category.id)}" %> + <% end -%> +
+<%= render :partial => 'clear_filters', :locals => {:type => 'categories'} %> \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter_status.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter_status.html.erb new file mode 100644 index 00000000..316d471e --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter_status.html.erb @@ -0,0 +1,6 @@ +
+ <%= link_to t(:top), panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_top'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_top')}" %> + <%= link_to t(:hot), panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_hot'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_hot')}" %> + <%= link_to t(:hidden), panel_archive_back_end_archive_files_path(:filter => @filter, :new_filter => {:type => 'status', :id => 'is_hidden'}, :sort => params[:sort], :direction => params[:direction], :sort_options => params[:sort_options]), :class => "btn btn-small js_history#{is_filter_active?('status', 'is_hidden')}" unless(is_guest?)%> +
+<%= render :partial => 'clear_filters', :locals => {:type => 'status'} %> \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter_tags.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter_tags.html.erb new file mode 100644 index 00000000..e0eb154f --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_filter_tags.html.erb @@ -0,0 +1,6 @@ +
+ <% @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)}" %> + <% end -%> +
+<%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %> \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb index 8912b1d2..7eba5303 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb @@ -98,7 +98,7 @@ - <% @archive_file.archive_file_multiples.each_with_index do |archive_file_multiple, i| %> + <% @archive_file.archive_file_multiples.desc("id asc").each_with_index do |archive_file_multiple, i| %> <%= f.fields_for :archive_file_multiples, archive_file_multiple do |f| %> <%= render :partial => 'form_file', :object => archive_file_multiple, :locals => {:f => f, :i => i} %> <% end %> @@ -117,6 +117,8 @@
+ <%= hidden_field_tag 'page', params[:page] if !params[:page].blank? %> + <%= hidden_field_tag 'filter', params[:filter] %> <%= f.submit t('submit'), :class=>'btn btn-primary' %> <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_sort_headers.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_sort_headers.html.erb new file mode 100644 index 00000000..b02c74ea --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_sort_headers.html.erb @@ -0,0 +1,5 @@ +<%= render_sort_bar(true, delete_panel_archive_back_end_archive_files_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), + ['status', ['is_top', 'is_hot', 'is_hidden'], 'span1', :status], + ['category', 'archive_file_category', 'span2', :category], + ['title', 'title','span3', :title], + ['tags', 'tags', 'span2', :tags]).html_safe %> \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/index.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/index.html.erb index dd54bcb5..77ade626 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/index.html.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/index.html.erb @@ -1,13 +1,13 @@ - -<%= flash_messages %> +<%= render 'filter' %> - - - - + + + + + @@ -18,3 +18,11 @@
<%= paginate @archive_files %>
+ + +
+ <%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t(:add), new_panel_archive_back_end_archive_file_path, :class => 'btn btn-primary pull-right' if (is_manager? rescue nil) %> + +
\ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/index.js.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/index.js.erb index 7608ab33..f3d30c0b 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/index.js.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/index.js.erb @@ -1,2 +1,7 @@ +$("#collapse-status").html("<%= j render 'filter_status' %>"); +$("#collapse-category").html("<%= j render 'filter_categories' %>"); +$("#collapse-tags").html("<%= j render 'filter_tags' %>"); +$("#delete_all").attr("action", "<%= delete_panel_archive_back_end_archive_files_path(:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil, :sort_options => params[:sort_options]) %>"); +$("#sort_headers").html("<%= j render 'sort_headers' %>"); $("#tbody_archive").html("<%= j render :partial => 'archive_file', :collection => @archive_files %>"); -$("#archive_pagination").html("<%= j paginate @archive_files %>"); \ No newline at end of file +$("#archive_file_pagination").html("<%= j paginate @archive_files, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>"); \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/front_end/archive_files/index.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/front_end/archive_files/index.html.erb index 2fa34389..5d910be4 100644 --- a/vendor/built_in_modules/archive/app/views/panel/archive/front_end/archive_files/index.html.erb +++ b/vendor/built_in_modules/archive/app/views/panel/archive/front_end/archive_files/index.html.erb @@ -1,31 +1,56 @@ <% # encoding: utf-8 %> -<%= flash_messages %> -<%#= paginate @archive_files, :params => {:inner => false}%> +
+ +
<%= t('archive_file.status') %><%= t('archive_file.category') %><%= t('archive_file.title') %><%= t('archive_file.tags') %>
+ + + + + + + + + + <% @archive_files.each_with_index do |post,i| %> + class="even" <% end %>> + + + + + <% end %> + + +
TitleFilesCategory
<%= post.title %>
+
+ <% if !post.archive_file_multiples.blank? %> +
    + <% post.archive_file_multiples.desc("id asc").each do | afile | %> + <% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %> +
  1. + <%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %> + <%= post.get_file_icon(afile.file.url) %> +
  2. + <% end %> + <% end %> +
+ <% end %> +
+
+ <%= post.archive_file_category.title %> +
+
+ +<%= paginate @archive_files, :param_name => :page_main, :params => {:inner => 'false'} %> + +<%= stylesheet_link_tag "archive/archives" %> + + + + + + + + -<%# if @title %> - -<%# end %> - - - <%# @archive_file_categorys.each do |afcpost| %> - - <%# end %> - - -

<%= @current_category.title rescue nil %>

- - <% @archive_files.each do |post| %> - - <%= link_to post.title, panel_archive_front_end_archive_file_path(post, :category_id => post.archive_file_category_id) %> - -
    - <% post.archive_file_multiples.each do | afile | %> - <% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %> -
  1. <%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title} %>
  2. - <% end %> - <% end %> -
- - <% end %> diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_bulletins.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_bulletins.html.erb new file mode 100644 index 00000000..eb70e2f8 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_bulletins.html.erb @@ -0,0 +1,10 @@ +<% @bulletins.each do |bulletin| %> +
  • + <%= link_to bulletin.title, panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category_id , :tag_id => @selected_tag.id ) %> +
  • +<% end %> + + diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_index.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_index.html.erb new file mode 100644 index 00000000..e21ea599 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_index.html.erb @@ -0,0 +1,99 @@ +<% # encoding: utf-8 %> + + +<% if @widget_style == '1' %> + +
    + + + + + + + + + + + + <% @archive_files.each_with_index do |post,i| %> + class="even" <% end %>> + + + + + <% end %> + + +
    TitleFilesCategory
    <%= post.title %>
    +
    + <% if !post.archive_file_multiples.blank? %> +
      + <% post.archive_file_multiples.desc("id asc").each do | afile | %> + <% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %> +
    1. + <%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %> + <%= post.get_file_icon(afile.file.url) %> +
    2. + <% end %> + <% end %> +
    + <% end %> +
    +
    + <%= post.archive_file_category.title %> +
    +
    +
    + <% if !params[:category_id].blank? %> + <%= link_to t('archive.read_more'), panel_archive_front_end_archive_files_path(:category_id => @part.category) %> + <% else %> + <%= link_to t('archive.read_more'), panel_archive_front_end_archive_files_path %> + <% end %> +
    +<% elsif @widget_style == '2' %> + +
    +
    + + <% @archive_file_categorys.each do |afcpost| %> + +
    + <% if @category_id.blank? %> +

    <%= afcpost.title %>

    + <% end %> +
    +
    +
      + + <% afcpost.archive_files.can_display.desc( :is_top ).each do |post| %> +
    • +

      <%= post.title %>

      +
      + + <% if !post.archive_file_multiples.blank? %> +
        + <% post.archive_file_multiples.desc("_id asc").each do | afile | %> + <% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %> +
      1. + <%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %> + <%= post.get_file_icon(afile.file.url) %> +
      2. + <% end %> + <% end %> +
      + <% end %> + +
      +
    • + <% end %> + +
    +
    +
    + + <% end %> + +
    +
    + +<% end %> diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_tag.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_tag.html.erb new file mode 100644 index 00000000..b8d32dca --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_tag.html.erb @@ -0,0 +1,3 @@ +
  • + <%= 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)) %> +
  • \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_web_links.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_web_links.html.erb new file mode 100644 index 00000000..a1b8f4db --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/_web_links.html.erb @@ -0,0 +1,10 @@ +<% @web_links.each do |web_link| %> +
  • + <%= link_to web_link.title, web_link.url %> +
  • +<% end %> + + \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/bulletins_list.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/bulletins_list.html.erb new file mode 100644 index 00000000..2d3f198e --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/bulletins_list.html.erb @@ -0,0 +1,31 @@ +<% # encoding: utf-8 %> + +<% if @bulletins and !@bulletins.nil? %> + +
    + +
    + +<% @tags.each_with_index do |tag, index| %> +
    +

    <%= t("announcement.bulletins") %>

    +
    prev
    +
    next
    + +
    +<% end %> + +<% end %> + + + + + diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/bulletins_search_block.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/bulletins_search_block.html.erb new file mode 100644 index 00000000..f49bf84a --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/bulletins_search_block.html.erb @@ -0,0 +1,8 @@ +<%= form_tag panel_announcement_front_end_bulletins_path, method: :get do %> + <%= hidden_field_tag :category_id, params[:category_id] %> + <%= hidden_field_tag :tag_id, params[:tag_id] %> +

    + <%= 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 %> +

    +<% end %> \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/bulletins_side_bar.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/bulletins_side_bar.html.erb new file mode 100644 index 00000000..f5f2077e --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/bulletins_side_bar.html.erb @@ -0,0 +1,23 @@ + +
    +

    <%= t(:categories) %>

    + +
    +
    +

    <%= t(:tag_cloud) %>

    +
    + <% @tags_and_class.each do |tag| %> + <%= link_to tag[0][I18n.locale], panel_announcement_front_end_bulletins_path(:tag_id => tag[0].id, :category_id => params[:category_id]), :class => "#{tag[1]} #{(tag[0].id.to_s.eql?(params[:tag_id]) || tag[0].key.eql?(params[:tag_id])) ? 'active' : nil} " %> + <% end %> +
    +
    + + \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/index.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/index.html.erb new file mode 100644 index 00000000..14d74c7e --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/index.html.erb @@ -0,0 +1,7 @@ +<%= stylesheet_link_tag "default_widget" %> + + + +
    + <%= render 'index' %> +
    \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/index.js.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/index.js.erb new file mode 100644 index 00000000..e1be79eb --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/index.js.erb @@ -0,0 +1 @@ +$('#bulletin_widget').html("<%= j render 'index' %>") \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/reload_bulletins.js.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/reload_bulletins.js.erb new file mode 100644 index 00000000..3ee82c10 --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/reload_bulletins.js.erb @@ -0,0 +1 @@ +$('#bulletins_web_links_bulletins').html("<%= j render 'bulletins' if @bulletins %>") \ No newline at end of file diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/reload_web_links.js.erb b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/reload_web_links.js.erb new file mode 100644 index 00000000..d5abd76b --- /dev/null +++ b/vendor/built_in_modules/archive/app/views/panel/archive/widget/archive_files/reload_web_links.js.erb @@ -0,0 +1 @@ +$('#bulletins_web_links_web_links').html("<%= j render 'web_links' if @web_links %>") \ No newline at end of file diff --git a/vendor/built_in_modules/archive/config/locales/en.yml b/vendor/built_in_modules/archive/config/locales/en.yml index 27ba2c9f..b94e820b 100644 --- a/vendor/built_in_modules/archive/config/locales/en.yml +++ b/vendor/built_in_modules/archive/config/locales/en.yml @@ -7,6 +7,11 @@ en: archive: all: All archive: Archive + widget: + index: Archive Widget + frontend: + archive: Archive Frontend + read_more: Read More add: Add back: Back create: Create diff --git a/vendor/built_in_modules/archive/config/locales/zh_tw.yml b/vendor/built_in_modules/archive/config/locales/zh_tw.yml index 0369e6f6..c96d653f 100644 --- a/vendor/built_in_modules/archive/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/archive/config/locales/zh_tw.yml @@ -5,9 +5,10 @@ zh_tw: archive: 檔案室 all: 全部檔案 widget: - archive_files: 檔案室Wiget + index: 檔案室Widget frontend: - archive: 檔案室前台 + archive: 檔案室前台 + read_more: 閱讀更多 add: 新增 back: 回去 create: 創造 diff --git a/vendor/built_in_modules/archive/config/routes.rb b/vendor/built_in_modules/archive/config/routes.rb index ea923bba..e9d1facb 100644 --- a/vendor/built_in_modules/archive/config/routes.rb +++ b/vendor/built_in_modules/archive/config/routes.rb @@ -3,17 +3,19 @@ Rails.application.routes.draw do namespace :panel do namespace :archive do namespace :back_end do - resources :archive_files + resources :archive_files do + collection do + get 'delete' + end + end resources :archive_file_categorys resources :tags end namespace :front_end do - root :to => "archive_files#index" resources :archive_files end namespace :widget do - match "archive_files" => "archive_files#index" - match "reload_archive_files" => "archive_files#reload_archive_files" + match "index" => "archive_files#index" end end end diff --git a/vendor/built_in_modules/archive/init.rb b/vendor/built_in_modules/archive/init.rb index 7e32c041..f3e86c6e 100644 --- a/vendor/built_in_modules/archive/init.rb +++ b/vendor/built_in_modules/archive/init.rb @@ -3,7 +3,7 @@ module Archive module_label 'archive.archive' base_url File.expand_path File.dirname(__FILE__) - personal_plugin :enable => true,:path=>"panel/archive/plugin/profile",:i18n=>'archive.archive' + # personal_plugin :enable => true,:path=>"panel/archive/plugin/profile",:i18n=>'archive.archive' version "0.1" organization "Rulingcom" @@ -17,19 +17,27 @@ module Archive end end + category ["ArchiveFileCategory"] + widgets do # default_widget do - # query 'Bulletin.all' - # image :image + # query 'ArchiveFile.all' + # field :category + # link_field :title,{:method => 'panel_archive_front_end_archive_file_path',:args=>:self} + # link_field :archive_file_category_with_title,{:method => 'panel_archive_front_end_archive_files_path',:args=>{:category_id => [:archive_file_category,:id]}} # end - # categories_query 'BulletinCategory.all' - # tags_query 'ArchiveTag.all' - customize_widget "archive_files" do - widget_i18n "archive.widget.archive_files" - style [] + categories_query 'ArchiveFileCategory.all' + tags_query 'ArchiveTag.all' + + customize_widget "index" do + widget_i18n "archive.widget.index" + style ["1"] end + # item "index","announcement.widget.index",:default_template=>true,:fields=>["title","category","postdate"] + # item "bulletins_and_web_links","announcement.widget.bulletins_and_web_links" end + side_bar do head_label_i18n 'archive.archive',:icon_class=>"icons-archive" diff --git a/vendor/built_in_modules/personal_conference/config/locales/zh_tw.yml b/vendor/built_in_modules/personal_conference/config/locales/zh_tw.yml index 967d14d0..2354895c 100644 --- a/vendor/built_in_modules/personal_conference/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/personal_conference/config/locales/zh_tw.yml @@ -1,5 +1,7 @@ zh_tw: _locale: "中文" + module_name: + personal_conference: 研討會論文 personal_conference: year : "年度" language : "語言" diff --git a/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/_diploma.html.erb b/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/_diploma.html.erb index b3288797..c0141009 100644 --- a/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/_diploma.html.erb +++ b/vendor/built_in_modules/personal_diploma/app/views/panel/personal_diploma/back_end/diplomas/_diploma.html.erb @@ -6,7 +6,7 @@ <%= diploma.start_date.strftime("%Y.%m") %> ~ <%= diploma.end_date.strftime("%Y.%m") %> - <%= link_to diploma.school_name, panel_personal_diploma_front_end_diploma_path(diploma) %> + <%= diploma.school_name %>