delete unuse data
This commit is contained in:
parent
078876788a
commit
be47fd78a3
|
@ -1,147 +0,0 @@
|
|||
class Panel::Archive::BackEnd::ArchiveFileCategorysController < OrbitBackendController
|
||||
include OrbitControllerLib::DivisionForDisable
|
||||
|
||||
before_filter :for_app_manager,:except => [:index,:get_categorys_json,:get_archive_files_json]
|
||||
|
||||
before_filter :force_order_for_visitor,:only=>[:index,:get_categorys_json,:get_archive_files_json]
|
||||
before_filter :force_order_for_user,:except => [:index,:get_categorys_json,:get_archive_files_json]
|
||||
before_filter :for_app_sub_manager,:except => [:index,:get_categorys_json,:get_archive_files_json]
|
||||
|
||||
def index
|
||||
@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
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def get_categorys_json
|
||||
categorys = ArchiveFileCategory.all
|
||||
data = Array.new
|
||||
|
||||
categorys.each do |c|
|
||||
data << {
|
||||
category: c.title,
|
||||
link: "#{url_for( :action => "index",
|
||||
:controller => "panel/archive/front_end/archive_files",
|
||||
:format => :rss,
|
||||
:only_path => false,
|
||||
:inner=>true,
|
||||
:category_id => c )}"
|
||||
}
|
||||
end
|
||||
|
||||
render :json => JSON.pretty_generate(data)
|
||||
end
|
||||
|
||||
def get_archive_files_json
|
||||
archive_file = ArchiveFileCategory.find(params[:archive_file_category_id]).archive_files
|
||||
p archive_file
|
||||
data = Array.new
|
||||
|
||||
archive_file.each do |b|
|
||||
|
||||
data << {
|
||||
title: b.title,
|
||||
link: "http://#{request.host_with_port}#{panel_archive_front_end_archive_file_path(b, :category_id => b.archive_file_category.id)}",
|
||||
tag: b.sorted_tags.to_a,
|
||||
}
|
||||
end
|
||||
|
||||
render :json => JSON.pretty_generate(data)
|
||||
end
|
||||
|
||||
# GET /archive_files/1
|
||||
# GET /archive_files/1.xml
|
||||
def show
|
||||
@archive_file_category = ArchiveFileCategory.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# GET /archive_files/new
|
||||
# GET /archive_files/new.xml
|
||||
def new
|
||||
@archive_file_category = ArchiveFileCategory.new(:display => 'List')
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# GET /archive_files/1/edit
|
||||
def edit
|
||||
@archive_file_category = ArchiveFileCategory.find(params[:id])
|
||||
|
||||
@url = panel_archive_back_end_archive_file_category_path(@archive_file_category)
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# POST /archive_files
|
||||
# POST /archive_files.xml
|
||||
def create
|
||||
@archive_file_category = ArchiveFileCategory.new(params[:archive_file_category])
|
||||
|
||||
respond_to do |format|
|
||||
if @archive_file_category.save
|
||||
format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url, :notice => t('archive_file_category.create_archive_file_category_success')) }
|
||||
format.js
|
||||
else
|
||||
format.html { render :action => "new" }
|
||||
format.js { render action: "new" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /archive_files/1
|
||||
# PUT /archive_files/1.xml
|
||||
def update
|
||||
@archive_file_category = ArchiveFileCategory.find(params[:id])
|
||||
|
||||
@url = panel_archive_back_end_archive_file_category_path(@archive_file_category)
|
||||
|
||||
respond_to do |format|
|
||||
if @archive_file_category.update_attributes(params[:archive_file_category])
|
||||
format.html { redirect_to(panel_archive_back_end_archive_file_categorys_url, :notice => t('archive_file_category.update_archive_file_category_success')) }
|
||||
# format.xml { head :ok }
|
||||
format.js
|
||||
else
|
||||
format.html { render :action => "edit" }
|
||||
format.js { render :action => "edit" }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /archive_files/1
|
||||
# DELETE /archive_files/1.xml
|
||||
def destroy
|
||||
@archive_file_category = ArchiveFileCategory.find(params[:id])
|
||||
@archive_file_category.disable = @archive_file_category.disable ? false : true
|
||||
|
||||
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
|
|
@ -1,142 +0,0 @@
|
|||
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("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)
|
||||
|
||||
@tags = get_tags
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.xml { render :xml => @archive_files }
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# GET /archive_files/1
|
||||
# GET /archive_files/1.xml
|
||||
def show
|
||||
@archive_file = ArchiveFile.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.xml { render :xml => @archive_file }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /archive_files/new
|
||||
# GET /archive_files/new.xml
|
||||
def new
|
||||
@archive_file = ArchiveFile.new
|
||||
|
||||
@tags = get_tags
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render :xml => @archive_file }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /archive_files/1/edit
|
||||
def edit
|
||||
@archive_file = ArchiveFile.find(params[:id])
|
||||
|
||||
@tags = get_tags
|
||||
end
|
||||
|
||||
# POST /archive_files
|
||||
# POST /archive_files.xml
|
||||
def create
|
||||
@archive_file = ArchiveFile.new(params[:archive_file])
|
||||
@archive_file.create_user_id = current_user.id
|
||||
@archive_file.update_user_id = current_user.id
|
||||
|
||||
respond_to do |format|
|
||||
if @archive_file.save
|
||||
format.html { redirect_to(panel_archive_back_end_archive_files_url) }
|
||||
format.xml { render :xml => @archive_file, :status => :created, :location => @archive_file }
|
||||
else
|
||||
@tags = get_tags
|
||||
format.html { render :action => "new" }
|
||||
format.xml { render :xml => @archive_file.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /archive_files/1
|
||||
# PUT /archive_files/1.xml
|
||||
def update
|
||||
@archive_file = ArchiveFile.find(params[:id])
|
||||
|
||||
@archive_file.update_user_id = current_user.id
|
||||
|
||||
params[:archive_file][:tag_ids] ||=[]
|
||||
|
||||
respond_to do |format|
|
||||
if @archive_file.update_attributes(params[:archive_file])
|
||||
format.html { redirect_to(panel_archive_back_end_archive_files_url(:page => params[:page])) }
|
||||
format.xml { head :ok }
|
||||
else
|
||||
format.html { render :action => "edit" }
|
||||
format.xml { render :xml => @archive_file.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /archive_files/1
|
||||
# DELETE /archive_files/1.xml
|
||||
def destroy
|
||||
@archive_file = ArchiveFile.find(params[:id])
|
||||
@archive_file.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to(panel_archive_back_end_archive_files_url) }
|
||||
# format.xml { head :ok }
|
||||
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
|
||||
|
||||
end
|
|
@ -1,8 +0,0 @@
|
|||
class Panel::Archive::BackEnd::TagsController < Admin::TagsController
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_title = 'archive'
|
||||
end
|
||||
|
||||
end
|
|
@ -1,91 +0,0 @@
|
|||
class Panel::Archive::FrontEnd::ArchiveFilesController < OrbitWidgetController
|
||||
include AdminHelper
|
||||
|
||||
def initialize
|
||||
super
|
||||
@app_title = 'archive_files'
|
||||
end
|
||||
|
||||
def get_search_result
|
||||
@search = ArchiveFileCategory.solr_search do
|
||||
fulltext params[:search_query]
|
||||
with(:frontend_search,true)
|
||||
end
|
||||
|
||||
search_result = @search.results.collect{|result| result.id}
|
||||
params[:category_id] = @search.results.collect{|result| result.id}
|
||||
|
||||
@archive_file_categorys = ArchiveFileCategory.any_in(_id:search_result).page( params[:page_main]).per(@page_num)
|
||||
end
|
||||
|
||||
def index
|
||||
@item = Page.find(params[:page_id])
|
||||
@title = @item.title
|
||||
if !@item.frontend_data_count.blank?
|
||||
@page_num = @item.frontend_data_count
|
||||
else
|
||||
@page_num = 10
|
||||
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? && !params[:tag_id].blank?
|
||||
@archive_files = @archive_files.default_sort(params[:sort]).can_display.where(:archive_file_category_id.in => params[:category_id], :tagged_ids.in => params[:tag_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num)
|
||||
|
||||
@current_category = ArchiveFileCategory.from_id(params[:category_id]) rescue nil
|
||||
|
||||
elsif !params[:category_id].blank?
|
||||
@archive_files = ArchiveFile.default_sort(params[:sort]).can_display.where(:archive_file_category_id.in => 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?
|
||||
@archive_files = ArchiveFile.default_sort(params[:sort]).can_display.where(:tagged_ids.in => params[:tag_id]).desc( :is_top ).page( params[:page_main] ).per(@page_num)
|
||||
else
|
||||
@archive_files = ArchiveFile.default_sort(params[:sort]).can_display.desc( :is_top ).page( params[:page_main] ).per(@page_num)
|
||||
end
|
||||
|
||||
|
||||
get_categorys
|
||||
|
||||
if params[:sort]
|
||||
@archive_files = get_sorted_and_filtered('archive_file', nil, @archive_files)
|
||||
end
|
||||
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?
|
||||
@archive_files = ArchiveFile.can_display.where(:tagged_ids => params[:tag_id]).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)
|
||||
end
|
||||
end
|
|
@ -1,52 +0,0 @@
|
|||
class Panel::Archive::Widget::ArchiveFilesController < OrbitWidgetController
|
||||
include AdminHelper
|
||||
|
||||
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.default_sort(params[:sort]).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?
|
||||
@archive_files = ArchiveFile.default_sort(params[:sort]).all.can_display.any_in(:tagged_ids => params[:tag_id]).merge(ArchiveFileCategory.excludes('disable' => true)).desc( :is_top ).page( params[:page_main] ).per(@page_num)
|
||||
get_categorys
|
||||
else
|
||||
@archive_files = ArchiveFile.default_sort(params[:sort]).all.can_display.merge(ArchiveFileCategory.excludes('disable' => true)).desc( :is_top).page( params[:page_main] ).per(@page_num)
|
||||
get_categorys
|
||||
end
|
||||
|
||||
if params[:sort]
|
||||
@archive_files = get_sorted_and_filtered('archive_file', nil, @archive_files)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def get_categorys
|
||||
@archive_file_categorys = ArchiveFileCategory.excludes('disable' => true)
|
||||
end
|
||||
|
||||
end
|
|
@ -1,15 +0,0 @@
|
|||
module Panel::Archive::BackEnd::ArchiveFileCategorysHelper
|
||||
include ActionView::Helpers::UrlHelper
|
||||
|
||||
|
||||
def show_anc_cate_permission_link(archive_file_category)
|
||||
type = 'submit'
|
||||
oa = archive_file_category.get_object_auth_by_title(type)
|
||||
if oa.nil?
|
||||
archive_file_category.object_auths.new(title: type ).save
|
||||
oa = archive_file_category.get_object_auth_by_title(type)
|
||||
end
|
||||
link_to t(:category_auth),admin_object_auth_ob_auth_path(oa)
|
||||
end
|
||||
|
||||
end
|
|
@ -1,20 +0,0 @@
|
|||
|
||||
<tr id="<%= dom_id archive_file_category %>" class="with_action">
|
||||
<td>
|
||||
<%= archive_file_category.key %>
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<% if is_admin?%>
|
||||
<li><%= link_to t(:edit), edit_panel_archive_back_end_archive_file_category_path(archive_file_category), :remote => true %></li>
|
||||
<li><%= link_to show_toggle_archive_btn(archive_file_category) , panel_archive_back_end_archive_file_category_path(archive_file_category), :confirm => t(:sure?), :method => :delete, :remote => true,:class=> "archive_toggle" %></li>
|
||||
<% end %>
|
||||
<%if is_manager? || is_admin? %>
|
||||
<li><%= show_anc_cate_permission_link(archive_file_category) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<td><%= archive_file_category.title_translations[locale] rescue nil %></td>
|
||||
<% end %>
|
||||
</tr>
|
|
@ -1,30 +0,0 @@
|
|||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= form_for(@archive_file_category, :remote => true, :url => @url) do |f| %>
|
||||
|
||||
<h2><%= (@archive_file_category.new_record? ? 'Add' : 'Edit') %></h2>
|
||||
|
||||
<div id="widget-title">
|
||||
<%= f.label :key %>
|
||||
<%= f.text_field :key %>
|
||||
</div>
|
||||
|
||||
<div id="widget-title">
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<div class="control-group">
|
||||
<%= label_tag "name-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, :class =>' input-xxlarge', :value => (@archive_file_category.title_translations[locale] rescue nil) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
$('<%= j render :partial => 'archive_file_category', :collection => [@archive_file_category] %>').appendTo('#archive_file_categorys').hide().fadeIn();
|
||||
$("#new_archive_file_category")[0].reset();
|
|
@ -1 +0,0 @@
|
|||
$("#<%= dom_id @archive_file_category %>").find(".archive_toggle").text("<%= show_toggle_archive_btn(@archive_file_category) %> ");
|
|
@ -1 +0,0 @@
|
|||
$("#form > form").replaceWith("<%= j render "form" %>");
|
|
@ -1,23 +0,0 @@
|
|||
|
||||
|
||||
<%= flash_messages %>
|
||||
|
||||
<table id="archive_file_categorys" class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1-2"><%= t('archive_file_category.key') %></th>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<th class="span1-2"><%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<%= render :partial => 'archive_file_category', :collection => @archive_file_categorys %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="form"><%= render :partial => "form" %></div>
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
$("#form > form").replaceWith("<%= j render "form" %>");
|
|
@ -1,4 +0,0 @@
|
|||
$("#<%= dom_id @archive_file_category %>").replaceWith("<%= j render :partial => 'archive_file_category', :collection => [@archive_file_category] %>");
|
||||
<% @archive_file_category = ArchiveFileCategory.new(:display => 'List') # reset for new form %>
|
||||
$(".edit_archive_file_category").replaceWith("<%= j render "form" %>")
|
||||
$(".new_archive_file_category")[0].reset();
|
|
@ -1,49 +0,0 @@
|
|||
<tr id="<%= dom_id archive_file %>" class="with_action">
|
||||
<td>
|
||||
<% 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 -%>
|
||||
</td>
|
||||
<td>
|
||||
<%= archive_file.sort_number %>
|
||||
</td>
|
||||
<td>
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
<% if archive_file.is_top? %>
|
||||
<span class="label label-success"><%= t(:top) %></span>
|
||||
<% end %>
|
||||
<% if archive_file.is_hot? %>
|
||||
<span class="label label-important"><%= t(:hot) %></span>
|
||||
<% end %>
|
||||
<% if archive_file.is_hidden? %>
|
||||
<span class="label"><%= t(:hidden) %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td><%= archive_file.archive_file_category.title %></td>
|
||||
<td>
|
||||
<%= link_to archive_file.title, panel_archive_front_end_archive_file_path(archive_file) %>
|
||||
|
||||
<div class="quick-edit">
|
||||
<ul class="nav nav-pills hide">
|
||||
<% if (archive_file.create_user_id == current_or_guest_user.id) || is_manager? %>
|
||||
<li><%= link_to t(:edit), edit_panel_archive_back_end_archive_file_path(archive_file) %></li>
|
||||
<li class="dropdown"><%= link_to t(:delete_), panel_archive_back_end_archive_file_path(archive_file), :confirm => t(:sure?), :method => :delete, :remote => true %></li>
|
||||
<% end -%>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<div class="label-group">
|
||||
<div class="label-td">
|
||||
<% archive_file.sorted_tags.each do |tag| %>
|
||||
<span class="label label-tags"><%= tag.name %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
<div class="filter-clear">
|
||||
<%= 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" %>
|
||||
</div>
|
|
@ -1,37 +0,0 @@
|
|||
<div id='filter' class="subnav">
|
||||
<ul class="nav nav-pills filter">
|
||||
<li class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a href="#collapse-status" data-toggle="collapse" data-parent="#filter" class="accordion-toggle"><%= t(:status) %> <b class="web-symbol"></b></a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a href="#collapse-category" data-toggle="collapse" data-parent="#filter" class="accordion-toggle"><%= t(:categories) %> <b class="web-symbol"></b></a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a href="#collapse-tags" data-toggle="collapse" data-parent="#filter" class="accordion-toggle"><%= t(:tags) %> <b class="web-symbol"></b></a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="filters accordion-group">
|
||||
<div class="accordion-body collapse" id="collapse-status">
|
||||
<%= render 'filter_status' %>
|
||||
</div>
|
||||
<div class="accordion-body collapse" id="collapse-category">
|
||||
<%= render 'filter_categories' %>
|
||||
</div>
|
||||
<div class="accordion-body collapse" id="collapse-tags">
|
||||
<%= render 'filter_tags' %>
|
||||
</div>
|
||||
<div id="sort_headers" class="table-label">
|
||||
<%= render 'sort_headers' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "sort_header" %>
|
||||
<% end %>
|
|
@ -1,6 +0,0 @@
|
|||
<div class="accordion-inner" data-toggle="buttons-checkbox">
|
||||
<% @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 -%>
|
||||
</div>
|
||||
<%= render :partial => 'clear_filters', :locals => {:type => 'categories'} %>
|
|
@ -1,6 +0,0 @@
|
|||
<div class="accordion-inner" data-toggle="buttons-checkbox">
|
||||
<%= 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?)%>
|
||||
</div>
|
||||
<%= render :partial => 'clear_filters', :locals => {:type => 'status'} %>
|
|
@ -1,6 +0,0 @@
|
|||
<div class="accordion-inner" data-toggle="buttons-checkbox">
|
||||
<% @tags.each do |tag| -%>
|
||||
<%= 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 -%>
|
||||
</div>
|
||||
<%= render :partial => 'clear_filters', :locals => {:type => 'tags'} %>
|
|
@ -1,157 +0,0 @@
|
|||
<% # encoding: utf-8 %>
|
||||
|
||||
<%= f.error_messages %>
|
||||
|
||||
<!--Widget start-->
|
||||
|
||||
<div id="sub-wiget">
|
||||
|
||||
<div id="widget-status" class="widget-box widget-size-300">
|
||||
<div class="widget-action clear tip" title="Setting the announcement state">
|
||||
<a class="action"><i class="icon-exclamation-sign icon-white"></i></a>
|
||||
</div>
|
||||
<h3 class="widget-title"><i class="icons-star"></i>Status</h3>
|
||||
<div class="widget-content clear">
|
||||
<div class="controls">
|
||||
<%= f.check_box :is_top %><%= t('top') %>
|
||||
<%= f.check_box :is_hot %><%= t('hot') %>
|
||||
<%= f.check_box :is_hidden %><%= t('hide') %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="widget-tags" class="widget-box widget-size-300">
|
||||
<div class="widget-action clear tip" title="Setting">
|
||||
<a class="action"><i class="icon-cog icon-white"></i></a>
|
||||
</div>
|
||||
<h3 class="widget-title"><i class="icons-tag"></i>Tags</h3>
|
||||
<div class="widget-content clear form-horizontal">
|
||||
<% @tags.each do |tag| %>
|
||||
<%= check_box_tag 'archive_file[tag_ids][]', tag.id, @archive_file.tag_ids.include?(tag.id)%>
|
||||
<%= tag.name %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!--Wiget End-->
|
||||
<!--Post Start-->
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content" class="clear">
|
||||
|
||||
<%= f.label :category %>
|
||||
<%= f.select :archive_file_category_id, @archive_file_categorys.collect {|t| [ t.title, t.id ]} %>
|
||||
|
||||
<%= f.label :sort_number %>
|
||||
<%= f.text_field :sort_number %>
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
<%# site_valid_locales_default_head.each_with_index do |locale, i| %>
|
||||
<li <%= ( i == 0 ) ? "class=active" : '' %>><a data-toggle="tab" href=".<%= locale %>"><%= I18nVariable.from_locale(locale) %></a></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
<div class="title">
|
||||
<%= f.label :title %>
|
||||
<%= f.fields_for :title_translations do |f| %>
|
||||
<%= I18nVariable.from_locale(locale) %>
|
||||
<%= f.text_field locale, :class=>'post-title', :value => (@archive_file.title_translations[locale] rescue nil) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<div class="archive_file_multiples_block">
|
||||
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>排序數</th>
|
||||
<th>File</th>
|
||||
<th>File Name</th>
|
||||
<th class="span2"><%= t('呈現語系')%></th>
|
||||
<th class="span1"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td style="text-align:center" colspan="4">
|
||||
<div id='add_archive_file_multiple' class="info_input archive_file_multiples_block">
|
||||
<%= hidden_field_tag 'archive_file_multiple_field_count', @archive_file.archive_file_multiples.count %>
|
||||
<a class="add"><span class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> ADD/新增</span></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tfoot>
|
||||
<tbody>
|
||||
|
||||
<% @archive_file.archive_file_multiples.asc(:_id).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 %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!--Post End-->
|
||||
|
||||
|
||||
<div class="form-actions">
|
||||
<%= 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" %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "archive_form" %>
|
||||
<script>
|
||||
$('#add_archive_file_multiple a.add').live('click', function(){
|
||||
var new_id = $(this).prev().attr('value');
|
||||
var old_id = new RegExp("new_archive_file_multiples", "g");
|
||||
$(this).prev().attr('value', parseInt(new_id) + 1);
|
||||
var new_form_file = $("<%= escape_javascript(add_attribute 'form_file', f, :archive_file_multiples) %>".replace(old_id, new_id));
|
||||
new_form_file.find('input#archive_file_archive_file_multiples_attributes_'+new_id+'_sort_number').val(new_id * 10)
|
||||
$(this).parents('table').append(new_form_file);
|
||||
});
|
||||
|
||||
$('.archive_file_multiples_block a.delete').live('click', function(){
|
||||
$(this).parents('.list_item').remove();
|
||||
});
|
||||
|
||||
$('.action a.remove_existing_record').live('click', function(){
|
||||
$(this).next('.should_destroy').attr('value', 1);
|
||||
$("tr#archive_file_" + $(this).prev().attr('value')).hide();
|
||||
});
|
||||
|
||||
</script>
|
||||
<% end %>
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
<% # encoding: utf-8 %>
|
||||
|
||||
<tr id="<%= "archive_file_multiple_#{form_file.id}" if !form_file.new_record? %>" class='list_item'>
|
||||
<td>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<%= f.text_field :sort_number %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<%= f.file_field :file %>
|
||||
<%= form_file.file.file ? ( link_to t(:view), form_file.file.url, {:class => 'btn', :target => '_blank', :title => t(:view)} ) : '' %>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<% @site_valid_locales.each_with_index do |locale, i| %>
|
||||
|
||||
<div class="<%= locale %> fade tab-pane <%= ( i == 0 ) ? "in active" : '' %>">
|
||||
<%#= f.fields_for :i18n_variable, (form_file.new_record? ? form_file.build_i18n_variable : form_file.i18n_variable ) do |f| %>
|
||||
<%= f.fields_for :file_title_translations do |f| %>
|
||||
<div class="control-group">
|
||||
<label for="link-<%= locale %>" class="control-label"><%= I18nVariable.from_locale(locale) %></label>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, :class=>'post-file_title', :value => (form_file.file_title_translations[locale] rescue nil) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<% @site_valid_locales.each do |locale| %>
|
||||
<%= check_box_tag "archive_file[archive_file_multiples_attributes][#{( form_file.new_record? ? 'new_archive_file_multiples' : "#{i}" )}][choose_lang][]", locale, (form_file.choose_lang.nil? ? true : form_file.choose_lang.include?(locale)) %>
|
||||
<%= I18nVariable.from_locale(locale) %>
|
||||
<% end %>
|
||||
<%= hidden_field_tag 'archive_file[archive_file_multiples_attributes][0][choose_lang][]', '' %>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<span class="action">
|
||||
<% if form_file.new_record? %>
|
||||
<a class="delete"><i class="icon-remove"></i></a>
|
||||
<% else %>
|
||||
<%= f.hidden_field :id %>
|
||||
<a class="remove_existing_record"><i class="icon-remove"></i></a>
|
||||
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
|
||||
<% end %>
|
||||
</span>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<%= render_sort_bar(true, delete_panel_archive_back_end_archive_files_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]),
|
||||
['sort_number', 'sort_number', 'span1', :sort_number],
|
||||
['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 %>
|
|
@ -1 +0,0 @@
|
|||
$("#<%= dom_id @archive_file %>").remove();
|
|
@ -1,5 +0,0 @@
|
|||
<h1><%= t('archive.editing_archive') %></h1>
|
||||
|
||||
<%= form_for @archive_file, :url => panel_archive_back_end_archive_file_path(@archive_file), :html => {:class => 'clear'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<% end %>
|
|
@ -1,24 +0,0 @@
|
|||
<%= render 'filter' %>
|
||||
|
||||
<table class="table main-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="span1"></th>
|
||||
<th class="span1"></th>
|
||||
<th class="span1"></th>
|
||||
<th class="span2"></th>
|
||||
<th class="span3"></th>
|
||||
<th class="span2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbody_archive">
|
||||
<%= render :partial => 'archive_file', :collection => @archive_files %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="form-actions form-fixed pagination-right">
|
||||
<%= 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) %>
|
||||
<div id="archive_file_pagination" class="paginationFixed">
|
||||
<%= paginate @archive_files, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>
|
||||
</div>
|
||||
</div>
|
|
@ -1,7 +0,0 @@
|
|||
$("#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_file_pagination").html("<%= j paginate @archive_files, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>");
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
<%= flash_messages %>
|
||||
<h1><%= t('archive_file.new_archive') %></h1>
|
||||
<%= form_for @archive_file, :url => panel_archive_back_end_archive_files_path, :html => {:class => 'clear'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<% end %>
|
||||
|
||||
<%#= link_back %>
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<% # encoding: utf-8 %>
|
||||
|
||||
|
||||
<div class="o-archives layout-table">
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="column-ctrl col-title"><%= sortable(:title, t("archive.Title"))%></th>
|
||||
<th class="column-ctrl col-file"><%= t("archive.Files")%></th>
|
||||
<th class="column-ctrl col-category"><%= sortable(:archive_file_category, t("archive.Category"))%></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<% @archive_files.each_with_index do |post,i| %>
|
||||
<tr <% if ( (i + 1) % 2 ) == 0 %> class="even" <% end %>>
|
||||
<td><div class="o-archives-title"><%= post.title %></div></td>
|
||||
<td>
|
||||
<div class="o-archives-list-item">
|
||||
<% if !post.archive_file_multiples.blank? %>
|
||||
<ol>
|
||||
<% post.archive_file_multiples.asc(:_id).each do | afile | %>
|
||||
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
|
||||
<li>
|
||||
<%= 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) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ol>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td><div class="o-archives-category">
|
||||
<%= post.archive_file_category.title %>
|
||||
</div></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<%= paginate @archive_files, :param_name => :page_main, :params => {:inner => 'false'} %>
|
||||
|
||||
<%= stylesheet_link_tag "archive/archives" %>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<%= stylesheet_link_tag "default_widget" %>
|
||||
<script type='text/javascript' src='/assets/jquery.mu.image.resize.js'></script>
|
||||
<script type='text/javascript' src='/assets/jquery.mu.image.resize.degsin.js'></script>
|
||||
|
||||
<div id="archive_file_widget">
|
||||
<%= render 'index' %>
|
||||
</div>
|
||||
|
||||
<%= stylesheet_link_tag "archive/archives" %>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1 +0,0 @@
|
|||
$('#archive_file_widget').html("<%= j render 'index' %>")
|
|
@ -1,30 +0,0 @@
|
|||
|
||||
<div class="o-archives">
|
||||
<div class="o-archives-content">
|
||||
<div class="o-archives-group">
|
||||
<h2 class="o-archives-category h2"><%= @archive_file.archive_file_category.title rescue nil %></h2>
|
||||
<div class="o-archives-content">
|
||||
<div class="o-archives-list">
|
||||
<ul>
|
||||
<li>
|
||||
<h3 class="o-archives-title h3"><%= @archive_file.title %></h3>
|
||||
<div class="o-archives-list-item">
|
||||
<ol>
|
||||
<% @archive_file.archive_file_multiples.each do | afile | %>
|
||||
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
|
||||
<li>
|
||||
<%= link_to afile.file_title, afile.file.url, {:target => '_blank', :title => afile.file_title, :class => "o-archives-file"} %>
|
||||
<%= @archive_file.get_file_icon(afile.file.url) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ol>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= stylesheet_link_tag "archive/archives" %>
|
|
@ -1,10 +0,0 @@
|
|||
<% @bulletins.each do |bulletin| %>
|
||||
<li>
|
||||
<%= link_to bulletin.title, panel_announcement_front_end_bulletin_path(bulletin, :category_id => bulletin.bulletin_category_id , :tag_id => @selected_tag.id ) %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<div class='pagination'>
|
||||
<%= link_to_previous_page @bulletins, 'Previous Page', :params => {:controller => 'widget/bulletins', :action => 'reload_bulletins', :tag_id => @selected_tag.id}, :remote => true, :class => 'previous' %>
|
||||
<%= link_to_next_page @bulletins, 'Next Page', :params => {:controller => 'widget/bulletins', :action => 'reload_bulletins', :tag_id => @selected_tag.id}, :remote => true, :class => 'next' %>
|
||||
</div>
|
|
@ -1,98 +0,0 @@
|
|||
<% # encoding: utf-8 %>
|
||||
|
||||
|
||||
<% if @widget_style == '1' %>
|
||||
|
||||
<div class="o-archives layout-table">
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="column-ctrl col-title"><%= sortable(:title, t("archive.Title"))%></th>
|
||||
<th class="column-ctrl col-file"><%= t("archive.Files")%></th>
|
||||
<th class="column-ctrl col-category"><%= sortable(:archive_file_category, t("archive.Category"))%></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @archive_files.each_with_index do |post,i| %>
|
||||
<tr <% if ( (i + 1) % 2 ) == 0 %> class="even" <% end %>>
|
||||
<td><div class="o-archives-title"><%= post.title %></div></td>
|
||||
<td>
|
||||
<div class="o-archives-list-item">
|
||||
<% if !post.archive_file_multiples.blank? %>
|
||||
<ol>
|
||||
<% post.archive_file_multiples.asc(:_id).each do | afile | %>
|
||||
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
|
||||
<li>
|
||||
<%= 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) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ol>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
<td><div class="o-archives-category">
|
||||
<%= post.archive_file_category.title %>
|
||||
</div></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="pull_right">
|
||||
<% if !params[:category_id].blank? %>
|
||||
<%= link_to t(:more_plus), panel_archive_front_end_archive_files_path(:category_id => @part.category) %>
|
||||
<% else %>
|
||||
<%= link_to t(:more_plus), panel_archive_front_end_archive_files_path %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% elsif @widget_style == '2' %>
|
||||
|
||||
<div class="o-archives">
|
||||
<div class="o-archives-content">
|
||||
|
||||
<% @archive_file_categorys.each do |afcpost| %>
|
||||
|
||||
<div class="o-archives-group">
|
||||
<% if @category_id.blank? %>
|
||||
<h2 class="o-archives-category h2"><%= afcpost.title %></h2>
|
||||
<% end %>
|
||||
<div class="o-archives-content">
|
||||
<div class="o-archives-list">
|
||||
<ul>
|
||||
|
||||
<% afcpost.archive_files.can_display.desc( :is_top ).each do |post| %>
|
||||
<li>
|
||||
<h3 class="o-archives-title h3"><%= post.title %></h3>
|
||||
<div class="o-archives-list-item">
|
||||
|
||||
<% if !post.archive_file_multiples.blank? %>
|
||||
<ol>
|
||||
<% post.archive_file_multiples.asc(:_id).each do | afile | %>
|
||||
<% if afile.file.file and afile.choose_lang_display(I18n.locale.to_s) %>
|
||||
<li>
|
||||
<%= 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) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</ol>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
|
@ -1,3 +0,0 @@
|
|||
<li>
|
||||
<%= 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>
|
|
@ -1,10 +0,0 @@
|
|||
<% @web_links.each do |web_link| %>
|
||||
<li>
|
||||
<%= link_to web_link.title, web_link.url %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<div class='pagination'>
|
||||
<%= link_to_previous_page @web_links, 'Previous Page', :params => {:controller => 'widget/bulletins', :action => 'reload_web_links', :tag_id => @selected_tag.id}, :remote => true, :class => 'previous' %>
|
||||
<%= link_to_next_page @web_links, 'Next Page', :params => {:controller => 'widget/bulletins', :action => 'reload_web_links', :tag_id => @selected_tag.id}, :remote => true, :class => 'next' %>
|
||||
</div>
|
|
@ -1,8 +0,0 @@
|
|||
<%= form_tag panel_archive_front_end_archive_files_path, method: :get do %>
|
||||
<%= hidden_field_tag :category_id, params[:category_id] %>
|
||||
<%= hidden_field_tag :tag_id, params[:tag_id] %>
|
||||
<p>
|
||||
<%= 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 %>
|
||||
</p>
|
||||
<% end %>
|
|
@ -1,31 +0,0 @@
|
|||
<% # encoding: utf-8 %>
|
||||
|
||||
<% if @bulletins and !@bulletins.nil? %>
|
||||
|
||||
<div class="tag_block">
|
||||
<ul class="tag_list">
|
||||
<% @tags.each do |tag| %>
|
||||
<li><%= tag.name %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<% @tags.each_with_index do |tag, index| %>
|
||||
<div id="news_<%= index %>" class="news_block">
|
||||
<h3 class="news_title2"><%= t("announcement.bulletins") %></h3>
|
||||
<div class="news_prev">prev</div>
|
||||
<div class="news_next">next</div>
|
||||
<ul class="news_list">
|
||||
<% tag.bulletins.each do |post| %>
|
||||
<li><%= link_to post.title, panel_announcement_front_end_bulletin_path(post) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<!-- <div class="search"> <input type="text" onfocus="this.value='';this.searchClickFlag=true;" onblur="if(this.value==''){this.value='公告搜尋';this.searchClickFlag=false;}" value="公告搜尋" id="q" class="search_key" name="q"/> <input type="submit" name="sa" id="sa" class="sa" value="." /> </div> -->
|
||||
<div class="category_list">
|
||||
<h3 class="h3"><%= t(:categories) %></h3>
|
||||
<ul class="list">
|
||||
<% @bulletin_categorys.each do |category| %>
|
||||
<li class="<%= category.id.to_s.eql?(params[:category_id]) ? 'active' : nil %>">
|
||||
<%= link_to category.title, panel_announcement_front_end_bulletins_path(:category_id => category.id) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tag_cloud">
|
||||
<h3 class="h3"><%= t(:tag_cloud) %></h3>
|
||||
<div class="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 %>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="clear"></div> -->
|
||||
<!-- <div class="rss_feed">
|
||||
<a href="" class="rssimg"> Rss feed </a>
|
||||
</div> -->
|
|
@ -1,9 +0,0 @@
|
|||
<%= stylesheet_link_tag "default_widget" %>
|
||||
<script type='text/javascript' src='/assets/jquery.mu.image.resize.js'></script>
|
||||
<script type='text/javascript' src='/assets/jquery.mu.image.resize.degsin.js'></script>
|
||||
|
||||
<div id="archive_file_widget">
|
||||
<%= render 'index' %>
|
||||
</div>
|
||||
|
||||
<%= stylesheet_link_tag "archive/archives" %>
|
|
@ -1 +0,0 @@
|
|||
$('#archive_file_widget').html("<%= j render 'index' %>")
|
|
@ -1 +0,0 @@
|
|||
$('#bulletins_web_links_bulletins').html("<%= j render 'bulletins' if @bulletins %>")
|
|
@ -1 +0,0 @@
|
|||
$('#bulletins_web_links_web_links').html("<%= j render 'web_links' if @web_links %>")
|
Loading…
Reference in New Issue