This commit is contained in:
BoHung Chiu 2023-01-03 12:07:58 +08:00
parent e4888e1421
commit 4601c1faff
23 changed files with 80 additions and 114 deletions

View File

@ -30,6 +30,8 @@ class ArchivesController < ApplicationController
page = Page.where(url:params['url']).first page = Page.where(url:params['url']).first
end end
params = OrbitHelper.params params = OrbitHelper.params
OrbitHelper.render_css_in_head(['archive/archive_frontend.css'])
OrbitHelper.render_js_in_head(['archive/archive_frontend.js'])
@@total_pages = 1 @@total_pages = 1
in_class = "" in_class = ""
custom_data_field = page.custom_data_field rescue nil custom_data_field = page.custom_data_field rescue nil
@ -64,14 +66,7 @@ class ArchivesController < ApplicationController
end end
end end
else else
if OrbitHelper.page_data_count > 0 page_data_count = OrbitHelper.page_data_count
OrbitHelper.set_page_data_count 0
page = Page.where(:page_id => params["page_id"]).first rescue nil
if !page.nil?
page.data_count = 0
page.save
end
end
categories = params["categories"].blank? ? OrbitHelper.page_categories : params["categories"] categories = params["categories"].blank? ? OrbitHelper.page_categories : params["categories"]
tags = params["tags"].blank? ? OrbitHelper.page_tags : params["tags"] tags = params["tags"].blank? ? OrbitHelper.page_tags : params["tags"]
module_app = ModuleApp.where(:key=>'archive').first module_app = ModuleApp.where(:key=>'archive').first
@ -82,9 +77,7 @@ class ArchivesController < ApplicationController
tags = module_app.tags.sort_by{|tag| ((module_app.asc rescue true) ? tag.sort_number.to_i : -tag.sort_number.to_i)}.map{|tag| tag.id.to_s} tags = module_app.tags.sort_by{|tag| ((module_app.asc rescue true) ? tag.sort_number.to_i : -tag.sort_number.to_i)}.map{|tag| tag.id.to_s}
tags << nil tags << nil
end end
if params[:data_count].to_i <=0 if params[:data_count].to_i > 0
page_data_count = 0
else
page_data_count = params[:data_count].to_i page_data_count = params[:data_count].to_i
end end
if params[:page_no].nil? if params[:page_no].nil?
@ -93,7 +86,7 @@ class ArchivesController < ApplicationController
page_no = params[:page_no].to_i page_no = params[:page_no].to_i
end end
if (tags.count > 1 && categories.count <= 1 rescue false) if (tags.count > 1 && categories.count <= 1 rescue false)
archive_files = ArchiveFile.can_display.filter_by_categories(categories).sorted archive_files = ArchiveFile.can_display.filter_by_categories(categories, false).sorted
group_archive_files = {} group_archive_files = {}
cats = [] cats = []
each_data_count = [] each_data_count = []
@ -141,7 +134,7 @@ class ArchivesController < ApplicationController
end end
cats_last = cats cats_last = cats
else else
files_by_category = ArchiveFile.can_display.filter_by_categories(categories).filter_by_tags(tags).sorted.group_by(&:category) files_by_category = ArchiveFile.can_display.filter_by_categories(categories, false).filter_by_tags(tags).sorted.group_by(&:category)
each_data_count = [] each_data_count = []
categories = files_by_category.keys categories = files_by_category.keys
categories_sort = get_sorted_cat_with_filter(categories, :orm) categories_sort = get_sorted_cat_with_filter(categories, :orm)
@ -162,44 +155,32 @@ class ArchivesController < ApplicationController
} }
end end
if page_data_count != 0 if page_data_count != 0
all_data_count = 0 # all_data_count = 0
data_start = -1 data_start = -1
data_end = -1 data_end = -1
for i in 0...each_data_count.length page_data_end = page_no * page_data_count #Not include end
all_data_count_before = all_data_count page_data_start = page_data_end - page_data_count
all_data_count += each_data_count[i] # all_data_count = each_data_count.sum
if ( data_start == -1 && (all_data_count > (page_no - 1) * page_data_count) )
data_start = i
data_start_first = (page_no - 1) * page_data_count - all_data_count_before
end
if ( data_end == -1 && (all_data_count > (page_no * page_data_count - 1)) )
data_end = i
data_end_last = (page_no * page_data_count - 1) - all_data_count_before
end
end
if ( data_end == -1 && data_start != -1)
data_end = i
data_end_last = -1
end
if data_start!=-1 && page_no>=1
cats_last = [] cats_last = []
for i in data_start..data_end counter = 0
if data_start != data_end cats.each do |cat_data|
if i==data_start start_idx = page_data_start - counter
cats_last << Hash[cats[i].map{|k,v| [k , (k=='archives' ? v[data_start_first..-1] : v)]}] end_idx = page_data_end - counter
elsif i==data_end archives = cat_data['archives']
cats_last << Hash[cats[i].map{|k,v| [k , (k=='archives' ? v[0..data_end_last] : v)]}] archives_count = archives.count
else counter += archives_count
cats_last << cats[i] if start_idx >= archives_count
next
elsif start_idx < 0
start_idx = 0
end end
else archives = archives[start_idx...end_idx]
cats_last << Hash[cats[i].map{|k,v| [k,(k=='archives' ? v[data_start_first..data_end_last] : v)]}] if archives && archives.count > 0
cat_data['archives'] = archives
cats_last << cat_data
end end
end end
else @@total_pages = (counter.to_f / page_data_count).ceil
cats_last = [Hash[cats[0].map{|k,v| [k,'']}]]
end
@@total_pages = (all_data_count.to_f / page_data_count).ceil
else else
if page_no!=1 if page_no!=1
cats_last = [Hash[cats[0].map{|k,v| [k,'']}]] cats_last = [Hash[cats[0].map{|k,v| [k,'']}]]
@ -232,7 +213,7 @@ class ArchivesController < ApplicationController
def download_file def download_file
file_id = params[:file] file_id = params[:file]
file = ArchiveFileMultiple.find(file_id) rescue nil file = ArchiveFileMultiple.find(file_id) rescue nil
if !file.nil? if !file.nil? && file.file.present?
file.download_count = file.download_count + 1 file.download_count = file.download_count + 1
file.save file.save
@url = file.file.url @url = file.file.url
@ -259,6 +240,7 @@ class ArchivesController < ApplicationController
def group_by_category def group_by_category
cat_id = OrbitHelper.widget_categories.map {|cat_id| cat_id.to_s} cat_id = OrbitHelper.widget_categories.map {|cat_id| cat_id.to_s}
page_data_count = OrbitHelper.widget_data_count
if OrbitHelper.widget_tags.first == "all" if OrbitHelper.widget_tags.first == "all"
files_by_category = ArchiveFile.where(:category_id.in => OrbitHelper.widget_categories).with_tags(OrbitHelper.widget_module_app.tags.collect{|tag| tag.id.to_s}).asc(:sort_number).group_by(&:category) files_by_category = ArchiveFile.where(:category_id.in => OrbitHelper.widget_categories).with_tags(OrbitHelper.widget_module_app.tags.collect{|tag| tag.id.to_s}).asc(:sort_number).group_by(&:category)
else else
@ -284,15 +266,15 @@ class ArchivesController < ApplicationController
t.each do |inner_tag| t.each do |inner_tag|
idx = ts.index{|tot| tot["tag-name"] == inner_tag.name} idx = ts.index{|tot| tot["tag-name"] == inner_tag.name}
if !idx.nil? if !idx.nil?
break if ts[idx]["archives"].count >= OrbitHelper.widget_data_count break if ts[idx]["archives"].count >= page_data_count
ts[idx]["archives"] << a ts[idx]["archives"] << a
else else
break if archives.count >= OrbitHelper.widget_data_count break if archives.count >= page_data_count
archives << a archives << a
end end
end end
else else
break if archives.count >= OrbitHelper.widget_data_count break if archives.count >=page_data_count
archives << a archives << a
end end
@ -300,7 +282,7 @@ class ArchivesController < ApplicationController
ts << { ts << {
"tag-name" => (t[0].name rescue ""), "tag-name" => (t[0].name rescue ""),
"archives" => archives "archives" => archives
} if !archives.blank? && archive_counts < OrbitHelper.widget_data_count } if !archives.blank? && archive_counts < page_data_count
end end
{ {
"category-id" => cat.id, "category-id" => cat.id,
@ -374,6 +356,8 @@ class ArchivesController < ApplicationController
cats_with_archives cats_with_archives
end end
def widget def widget
OrbitHelper.render_css_in_head(['archive/archive_frontend.css'])
OrbitHelper.render_js_in_head(['archive/archive_frontend.js'])
ArchiveFile.check_sort_number ArchiveFile.check_sort_number
page_data_count = OrbitHelper.widget_data_count page_data_count = OrbitHelper.widget_data_count
categories = OrbitHelper.widget_categories #data are categories' ids or 'all' categories = OrbitHelper.widget_categories #data are categories' ids or 'all'

View File

@ -221,7 +221,7 @@ class ArchiveFile
a["files"] << { a["files"] << {
"file-name_translations" => title_translations, "file-name_translations" => title_translations,
"file-type" => extension, "file-type" => extension,
"file-url" => "#{base_url}/xhr/archive/download?file=#{file.id}" "file-url" => (file.file.present? ? "#{base_url}/xhr/archive/download?file=#{file.id}" : "javascript:void(0)")
} }
end end
end end
@ -295,7 +295,8 @@ class ArchiveFile
files << { files << {
"file-name" => title, "file-name" => title,
"file-type" => extension, "file-type" => extension,
"file-url" => "/xhr/archive/download?file=#{file.id}", "file-url" => (file.file.present? ? "/xhr/archive/download?file=#{file.id}" : 'javascript:void(0)'),
"target" => "_blank",
"serial_number" => serial_number "serial_number" => serial_number
} }
end end
@ -303,10 +304,12 @@ class ArchiveFile
if self.urls.present? if self.urls.present?
self.urls.each_with_index do |url,i| self.urls.each_with_index do |url,i|
serial_number += 1 serial_number += 1
target = (url.match(/\/[^\/]/) ? '_self' : '_blank')
files << { files << {
"file-name" => self.get_url_text(i), "file-name" => self.get_url_text(i),
"file-type" => 'link', "file-type" => 'link',
"file-url" => url, "file-url" => url + "\" data-target=\"#{target}",
"target" => target,
"serial_number" => serial_number "serial_number" => serial_number
} }
end end

View File

@ -1,8 +1,13 @@
<%= render_view %> <%= render_view %>
<% data = action_data %> <%
data = action_data
total_pages = ArchivesController.get_total_pages
%>
<% if data["categories"].length == 1 %> <% if data["categories"].length == 1 %>
<script> <script>
$("#main-content .panel-collapse").addClass("in"); $("#main-content .panel-collapse").addClass("in");
</script> </script>
<% end %> <% end %>
<%= create_pagination(ArchivesController.get_total_pages).html_safe %> <% if total_pages > 1 %>
<%= create_pagination(total_pages).html_safe %>
<% end %>

View File

@ -28,6 +28,7 @@ module Archive
end end
widget_methods ["widget","group_by_category"] widget_methods ["widget","group_by_category"]
widget_settings [{"data_count"=>30,"enable_custom_widget_data"=>true}] widget_settings [{"data_count"=>30,"enable_custom_widget_data"=>true}]
data_count 0..30
models_to_cache [:archive_file] models_to_cache [:archive_file]
begin begin
avoid_page_cache ArchiveCache avoid_page_cache ArchiveCache

View File

@ -6,7 +6,7 @@
<li class="w-archive__item level-2"> <li class="w-archive__item level-2">
<ul class="w-archive__list level-3" data-list="archives" data-level="1"> <ul class="w-archive__list level-3" data-list="archives" data-level="1">
<li class="w-archive__item level-3"> <li class="w-archive__item level-3">
<a class="w-archive__link" href="{{archive_url}}">{{archive-title}}</a> <a class="w-archive__link" href="{{archive_url}}" target="{{target}}" title="{{archive-title}}">{{archive-title}}</a>
</li> </li>
</ul> </ul>
</li> </li>

View File

@ -15,7 +15,7 @@
<div class="panel-body"> <div class="panel-body">
<ul class="widget-archive-item-group" data-list="archives" data-level="1"> <ul class="widget-archive-item-group" data-list="archives" data-level="1">
<li class="widget-archive-item-list"> <li class="widget-archive-item-list">
<a href="{{archive_url}}">{{archive-title}}</a> <a class="w-archive__link" href="{{archive_url}}" target="{{target}}" title="{{archive-title}}">{{archive-title}}</a>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -9,7 +9,7 @@
<span class="w-archive__title" href="{{archive_url}}">{{archive-title}}</span> <span class="w-archive__title" href="{{archive_url}}">{{archive-title}}</span>
<ul class="w-archive__list level-4" data-list="files" data-level="2"> <ul class="w-archive__list level-4" data-list="files" data-level="2">
<li class="w-archive__item level-4"> <li class="w-archive__item level-4">
<a href="{{file-url}}" class="widget-archive-files-item w-archive__link" target="_blank" title="{{file-name}}">{{file-name}}</a> <a href="{{file-url}}" class="widget-archive-files-item w-archive__link" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
<span class="label label-primary {{file-type}}">{{file-type}}</span> <span class="label label-primary {{file-type}}">{{file-type}}</span>
</li> </li>
</ul> </ul>

View File

@ -25,7 +25,7 @@
</dt> </dt>
<dl class="widget-archive-files-list" data-list="files" data-level="2"> <dl class="widget-archive-files-list" data-list="files" data-level="2">
<dd> <dd>
<a href="{{file-url}}" class="widget-archive-files-item" target="_blank" title="{{file-name}}">{{file-name}}</a> <a href="{{file-url}}" class="widget-archive-files-item" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
<span class="label label-primary {{file-type}}">{{file-type}}</span> <span class="label label-primary {{file-type}}">{{file-type}}</span>
</dd> </dd>
</dl> </dl>

View File

@ -13,7 +13,7 @@
</dt> </dt>
<dl class="i-archive__file-list" data-list="files" data-level="2"> <dl class="i-archive__file-list" data-list="files" data-level="2">
<dd class="i-archive__file-wrap"> <dd class="i-archive__file-wrap">
<a class="i-archive__file-name" href="{{file-url}}" target="_blank" title="{{file-name}}">{{file-name}}</a> <a class="i-archive__file-name" href="{{file-url}}" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
<span class="i-archive__file-type label label-primary {{file-type}}">{{file-type}}</span> <span class="i-archive__file-type label label-primary {{file-type}}">{{file-type}}</span>
</dd> </dd>
</dl> </dl>

View File

@ -22,7 +22,7 @@
</span> </span>
</td> </td>
<td class="i-archive__file-list col-sm-3" data-list="files" data-level="2"> <td class="i-archive__file-list col-sm-3" data-list="files" data-level="2">
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a>
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -20,10 +20,10 @@
<span class="i-archive__serial_number">{{serial_number}}</span> <span class="i-archive__serial_number">{{serial_number}}</span>
</td> </td>
<td class="col-sm-7"> <td class="col-sm-7">
<a class="i-archive__file-name" href="{{file-url}}" target="_blank" title="{{file-name}}">{{file-name}}</a> <a class="i-archive__file-name" href="{{file-url}}" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
</td> </td>
<td class="col-sm-3"> <td class="col-sm-3">
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a>
</td> </td>
</tr> </tr>
</span> </span>

View File

@ -25,7 +25,7 @@
</dt> </dt>
<dl class="i-archive-files-list" data-list="files" data-level="2"> <dl class="i-archive-files-list" data-list="files" data-level="2">
<dd> <dd>
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" title="{{file-name}}">{{file-name}}</a> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
<span class="label label-primary {{file-type}}">{{file-type}}</span> <span class="label label-primary {{file-type}}">{{file-type}}</span>
</dd> </dd>
</dl> </dl>
@ -41,18 +41,4 @@
width: auto; width: auto;
} }
</style> </style>
<script>
$('.index-archive-12 .panel-heading').each(function(i, v){
var $v = $(v);
if($v.text().trim() == ''){
$v.css('display', 'none');
}
})
$(document).ready(function(){
var location_id = window.location.hash;
if(location_id && location_id != '' && location_id.length > 1){
$(location_id).addClass('in');
}
})
</script>
</div> </div>

View File

@ -15,11 +15,11 @@
<span data-list="statuses" data-level="2"> <span data-list="statuses" data-level="2">
<span class="label status {{status-class}}">{{status}}</span> <span class="label status {{status-class}}">{{status}}</span>
</span> </span>
<a href="{{archive-file-url}}" target="_blank" title="{{archive-title}}"> <a href="{{archive-file-url}}" target="{{target}}" title="{{archive-title}}">
{{archive-title}} {{archive-title}}
</a> </a>
<span class="i-archive-files-list" data-list="files" data-level="2"> <span class="i-archive-files-list" data-list="files" data-level="2">
<a href="{{file-url}}" class="i-archive-files-item" title="{{file-name}}" data-toggle="tooltip" data-placement="bottom"> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" title="{{file-name}}" data-toggle="tooltip" data-placement="bottom">
<span class="label label-primary {{file-type}}">{{file-type}}</span> <span class="label label-primary {{file-type}}">{{file-type}}</span>
</a> </a>
</span> </span>

View File

@ -18,7 +18,7 @@
<div class="panel-body"> <div class="panel-body">
<ul class="i-archive-files-list" data-list="files" data-level="2"> <ul class="i-archive-files-list" data-list="files" data-level="2">
<li> <li>
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" title="{{file-name}}">{{file-name}}</a> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
<span class="label label-primary {{file-type}}">{{file-type}}</span> <span class="label label-primary {{file-type}}">{{file-type}}</span>
</li> </li>
</ul> </ul>
@ -33,18 +33,4 @@
width: auto; width: auto;
} }
</style> </style>
<script>
$('.index-archive-12 .panel-heading').each(function(i, v){
var $v = $(v);
if($v.text().trim() == ''){
$v.css('display', 'none');
}
})
$(document).ready(function(){
var location_id = window.location.hash;
if(location_id && location_id != '' && location_id.length > 1){
$(location_id).addClass('in');
}
})
</script>
</div> </div>

View File

@ -12,7 +12,7 @@
</a> </a>
</h4> </h4>
</div> </div>
<div id="collapse" class="panel-collapse collapse"> <div id="collapse" class="panel-collapse collapse {{in_class}}">
<div class="panel-body"> <div class="panel-body">
<dl class="dl-horizontal i-archive-item-group" data-list="archives" data-level="1"> <dl class="dl-horizontal i-archive-item-group" data-list="archives" data-level="1">
<dt class="i-archive-item-list col-sm-3"> <dt class="i-archive-item-list col-sm-3">
@ -23,7 +23,7 @@
</dt> </dt>
<dl class="i-archive-files-list col-sm-9" data-list="files" data-level="2"> <dl class="i-archive-files-list col-sm-9" data-list="files" data-level="2">
<dd> <dd>
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" title="{{file-name}}">{{file-name}}</a> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
<span class="label label-primary {{file-type}}">{{file-type}}</span> <span class="label label-primary {{file-type}}">{{file-type}}</span>
</dd> </dd>
</dl> </dl>

View File

@ -12,7 +12,7 @@
</dt> </dt>
<dl class="i-archive__file-list" data-list="files" data-level="2"> <dl class="i-archive__file-list" data-list="files" data-level="2">
<dd class="i-archive__file-wrap"> <dd class="i-archive__file-wrap">
<a class="i-archive__file-name" href="{{file-url}}" target="_blank" title="{{file-name}}">{{file-name}}</a> <a class="i-archive__file-name" href="{{file-url}}" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
<span class="i-archive__file-type label label-primary {{file-type}}">{{file-type}}</span> <span class="i-archive__file-type label label-primary {{file-type}}">{{file-type}}</span>
</dd> </dd>
</dl> </dl>

View File

@ -11,7 +11,7 @@
</a> </a>
</h4> </h4>
</div> </div>
<div id="collapse" class="panel-collapse collapse"> <div id="collapse" class="panel-collapse collapse {{in_class}}">
<div class="panel-body"> <div class="panel-body">
<dl class="dl-horizontal i-archive-item-group" data-list="archives" data-level="1"> <dl class="dl-horizontal i-archive-item-group" data-list="archives" data-level="1">
<dt class="i-archive-item-list col-sm-5"> <dt class="i-archive-item-list col-sm-5">
@ -21,7 +21,7 @@
</dt> </dt>
<dl class="i-archive-files-list col-sm-7" data-list="files" data-level="2"> <dl class="i-archive-files-list col-sm-7" data-list="files" data-level="2">
<dd> <dd>
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" title="{{file-name}}">{{file-name}}</a> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
<span class="label label-primary {{file-type}}">{{file-type}}</span> <span class="label label-primary {{file-type}}">{{file-type}}</span>
</dd> </dd>
</dl> </dl>

View File

@ -21,7 +21,7 @@
</span> </span>
</div> </div>
<div class="i-archive__file-list col-sm-3" data-list="files" data-level="2"> <div class="i-archive__file-list col-sm-3" data-list="files" data-level="2">
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}">
<span class="label label-primary {{file-type}}">{{file-type}}</span> <span class="label label-primary {{file-type}}">{{file-type}}</span>
</a> </a>
</div> </div>

View File

@ -17,7 +17,7 @@
<div class="head col-sm-7"> <div class="head col-sm-7">
<dl class="i-archive__file" data-list="files" data-level="2"> <dl class="i-archive__file" data-list="files" data-level="2">
<div class="file-name"> <div class="file-name">
<a class="i-archive__file-name" href="{{file-url}}" target="_blank" title="{{file-name}}">{{file-name}}</a> <a class="i-archive__file-name" href="{{file-url}}" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
<span class="i-archive__status-wrap" data-list="statuses" data-level="2"> <span class="i-archive__status-wrap" data-list="statuses" data-level="2">
<span class="i-archive__status label status {{status-class}}">{{status}}</span> <span class="i-archive__status label status {{status-class}}">{{status}}</span>
</span> </span>
@ -26,7 +26,7 @@
</div> </div>
<div class="i-archive__file-list col-sm-3" data-list="files" data-level="2"> <div class="i-archive__file-list col-sm-3" data-list="files" data-level="2">
<div class="file-item"> <div class="file-item">
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -23,7 +23,7 @@
</div> </div>
<div class="description col-sm-3" style="border-right: 0.05em solid #333;">{{description}}</div> <div class="description col-sm-3" style="border-right: 0.05em solid #333;">{{description}}</div>
<div class="i-archive__file-list col-sm-3" data-list="files" data-level="2"> <div class="i-archive__file-list col-sm-3" data-list="files" data-level="2">
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -18,7 +18,7 @@
<div class="head col-sm-4"> <div class="head col-sm-4">
<dl class="i-archive__file" data-list="files" data-level="2"> <dl class="i-archive__file" data-list="files" data-level="2">
<div class="file-name"> <div class="file-name">
<a class="i-archive__file-name" href="{{file-url}}" target="_blank" title="{{file-name}}">{{file-name}}</a> <a class="i-archive__file-name" href="{{file-url}}" target="{{target}}" title="{{file-name}}">{{file-name}}</a>
<span class="i-archive__status-wrap" data-list="statuses" data-level="2"> <span class="i-archive__status-wrap" data-list="statuses" data-level="2">
<span class="i-archive__status label status {{status-class}}">{{status}}</span> <span class="i-archive__status label status {{status-class}}">{{status}}</span>
</span> </span>
@ -28,7 +28,7 @@
<div class="description col-sm-3">{{description}}</div> <div class="description col-sm-3">{{description}}</div>
<div class="i-archive__file-list col-sm-3" data-list="files" data-level="2"> <div class="i-archive__file-list col-sm-3" data-list="files" data-level="2">
<div class="file-item"> <div class="file-item">
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -19,7 +19,7 @@
{{file-name}} {{file-name}}
</td> </td>
<td class="col-sm-4"> <td class="col-sm-4">
<a href="{{file-url}}" class="i-archive-files-item" target="_blank" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a> <a href="{{file-url}}" class="i-archive-files-item" target="{{target}}" data-toggle="tooltip" data-placement="bottom" title="{{file-name}}"><span class="label label-primary {{file-type}}">{{file-type}}</span></a>
</td> </td>
</tr> </tr>
</span> </span>

View File

@ -33,6 +33,7 @@
"zh_tw" : "4. 手風琴式列表( 無檔案名稱 ( 模組標題, 類別標題, 下載連結 )", "zh_tw" : "4. 手風琴式列表( 無檔案名稱 ( 模組標題, 類別標題, 下載連結 )",
"en" : "4. Accordion list(no filename) (widget-title, category, download link)" "en" : "4. Accordion list(no filename) (widget-title, category, download link)"
}, },
"force_cover": "true",
"thumbnail" : "ar4.png" "thumbnail" : "ar4.png"
}, },
{ {