This commit is contained in:
rulingcom 2024-08-11 22:48:38 +08:00
parent 349d862baf
commit 6a12f220ad
7 changed files with 270 additions and 383 deletions

View File

@ -76,6 +76,7 @@
padding: 2px 15px 2px 15px;
font-size: 1em;
border-radius: 5px;
behavior: url("/assets/ie_support/PIE2/PIE.htc");
color: #333;
font-weight: 400;
letter-spacing: 0;

View File

@ -1,10 +1,4 @@
<style>
.universal-th-text{
overflow: hidden;
display: -webkit-box;
-webkit-line-clamp: 2;
white-space: normal;
}
.universal-dropdown-menu {
padding: 15px 18px;
white-space: nowrap;
@ -54,58 +48,31 @@
width: 120px;
}
</style>
<table class="table table-hover table-striped universal-table-index" style="position:relative;">
<div class="searchbtn ken-click"><div class="searchbtn2"><i class="fa-solid fa-magnifying-glass"></i>查詢</div></div>
<div class="searchbox">
<thead class="theadsearch2">
<tr data-list="head-columns" data-level="0">
<th class="col-sm-3">
<div class="universal-th-text {{title-class}}">{{title}}</div>
<a href="{{sort-url}}" class="{{sort}}"><i class="universal-th-icon fa fa-{{sort-class}}"></i></a>
<div class="dropdown universal-dropdown {{search}}">
<button class="btn btn-sm" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-search"></i>
<span class="caret"></span>
</button>
<div class="dropdown-menu universal-dropdown-menu" aria-labelledby="dLabel">
<form class="form-inline universal-form-inline" action="{{url}}" method="get">
<div class="form-group">
{{form-field}}
<input type="hidden" value="{{key}}" name="column" >
</div>
<button class="btn btn-primary" type="submit" class="btn btn-default">Go</button>
</form>
</div>
</div>
</th>
</tr>
</thead></diV>
<table class="table table-hover table-striped universal-table-index">
<caption>
<h3>{{table-name}}</h3>
<a href="{{url}}" class="universal-btn btn btn-info pull-right {{reset}}"><i class="fa fa-refresh"></i> Reset</a>
</caption>
<thead class="theadsearch">
<thead>
<tr data-list="head-columns" data-level="0">
<th class="col-sm-3">
<th class="col-md-3">
<a href="{{sort-url}}" class="{{sort}}"><i class="universal-th-icon fa fa-{{sort-class}}"></i></a>
<div class="universal-th-text {{title-class}}">{{title}}</div>
<a href="{{sort-url}}" class="{{sort}}"><i class="universal-th-icon fa fa-{{sort-class}}"></i></a>
<div class="dropdown universal-dropdown {{search}}">
<button class="btn btn-sm" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-search"></i>
<span class="caret"></span>
</button>
<div class="dropdown-menu universal-dropdown-menu" aria-labelledby="dLabel">
<form class="form-inline universal-form-inline" action="{{url}}" method="get">
<div class="form-group">
{{form-field}}
<input type="hidden" value="{{key}}" name="column" >
</div>
<button class="btn btn-primary" type="submit" class="btn btn-default">Go</button>
</form>
</div>
<div class="dropdown universal-dropdown {{search}}">
<button class="btn btn-sm" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-search"></i>
<span class="caret"></span>
</button>
<div class="dropdown-menu universal-dropdown-menu" aria-labelledby="dLabel">
<form class="form-inline universal-form-inline" action="{{url}}" method="get">
<div class="form-group">
{{form-field}}
<input type="hidden" value="{{key}}" name="column" >
</div>
<button class="btn btn-primary" type="submit" class="btn btn-default">Go</button>
</form>
</div>
</div>
</th>
</tr>
</thead>
@ -119,32 +86,20 @@
<div>{{export_button}}</div>
{{pagination_goes_here}}
<script>
// $('.universal-table-index th').eq(1).attr('class', 'desktop tablet-l tablet-p');
// $('.universal-table-index th').filter(':gt(1)').attr('class', 'desktop tablet-l tablet-p mobile-l');
// $('.universal-table-index').each(function(){
// if($(this).find('thead').length!=0 && $(this).find('td').length!=0 && !$(this).hasClass('dataTable')){
// $(this).DataTable({
// searching: false,
// paging: false,
// ordering: false,
// info: false,
// order: false,
// autoWidth: false,
// responsive: true
// });
// }
// });
$(document).ready(function(){
$("tr>th:first-child").removeClass("col-sm-3");
$("tr>th:first-child").addClass("col-sm-4");
$("tr>th:nth-child(2)").removeClass("col-sm-3");
$("tr>th:nth-child(2)").addClass("col-sm-2");
$("tr>th:nth-child(3)").removeClass("col-sm-3");
$("tr>th:nth-child(3)").addClass("col-sm-2");
$("tr>th:nth-child(4)").removeClass("col-sm-3");
$("tr>th:nth-child(4)").addClass("col-sm-2");
$("tr>th:nth-child(5)").removeClass("col-sm-3");
$("tr>th:nth-child(5)").addClass("col-sm-2");
$('.universal-table-index th').eq(1).attr('class', 'desktop tablet-l tablet-p');
$('.universal-table-index th').filter(':gt(1)').attr('class', 'desktop tablet-l tablet-p mobile-l');
$('.universal-table-index').each(function(){
if($(this).find('thead').length!=0 && $(this).find('td').length!=0 && !$(this).hasClass('dataTable')){
$(this).DataTable({
searching: false,
paging: false,
ordering: false,
info: false,
order: false,
autoWidth: false,
responsive: true
});
}
});
</script>
<style>

View File

@ -47,6 +47,9 @@
content: "No.";
}
.universal-table-index thead > tr > th:first-child {
width: 4em;
}
.universal-th-icon {
border: 1px solid #eee;
@ -63,55 +66,27 @@
width: 120px;
}
</style>
<table class="table table-hover table-striped universal-table-index" style="position:relative;">
<div class="searchbtn ken-click"><div class="searchbtn2"><i class="fa-solid fa-magnifying-glass"></i>查詢</div></div>
<div class="searchbox">
<thead class="theadsearch2">
<tr data-list="head-columns" data-level="0">
<th class="col-md-3">
<a href="{{sort-url}}" class="{{sort}}"><i class="universal-th-icon fa fa-{{sort-class}}"></i></a>
<div class="universal-th-text {{title-class}}">{{title}}</div>
<div class="dropdown universal-dropdown {{search}}">
<button class="btn btn-md" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-search"></i>
<span class="caret"></span>
</button>
<div class="dropdown-menu universal-dropdown-menu" aria-labelledby="dLabel">
<form class="form-inline universal-form-inline" action="{{url}}" method="get">
<div class="form-group">
{{form-field}}
<input type="hidden" value="{{key}}" name="column" >
</div>
<button class="btn btn-primary" type="submit" class="btn btn-default">Go</button>
</form>
</div>
</div>
</th>
</tr>
</thead>
</div>
<form class="form-inline universal-form-inline" action="{{url}}" method="get">
<table class="table table-hover table-striped universal-table-index">
<caption>
<h3>{{table-name}}</h3>
<a href="{{url}}" class="universal-btn btn btn-info pull-right {{reset}}"><i class="fa fa-refresh"></i> Reset</a>
</caption>
<thead class="theadsearch">
<thead>
<tr data-list="head-columns" data-level="0">
<th class="col-md-3">
<a href="{{sort-url}}" class="{{sort}}"><i class="universal-th-icon fa fa-{{sort-class}}"></i></a>
<div class="universal-th-text {{title-class}}">{{title}}</div>
<div class="dropdown universal-dropdown {{search}}">
<button class="btn btn-md" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button class="btn btn-sm" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-search"></i>
<span class="caret"></span>
</button>
<div class="dropdown-menu universal-dropdown-menu" aria-labelledby="dLabel">
<form class="form-inline universal-form-inline" action="{{url}}" method="get">
<div class="form-group">
{{form-field}}
<input type="hidden" value="{{key}}" name="column" >
</div>
<button class="btn btn-primary" type="submit" class="btn btn-default">Go</button>
</form>
<div class="form-group">
{{form-field}}
</div>
<button class="btn btn-primary" type="submit" class="btn btn-default">Go</button>
</div>
</div>
</th>
@ -123,24 +98,11 @@
</tr>
</tbody>
</table>
</form>
<div>{{total_entries}}</div>
<div>{{export_button}}</div>
{{pagination_goes_here}}
<script>
$(document).ready(function(){
$('.universal-table-index thead tr').prepend('<th></th>')
$('.universal-table-index tbody tr').prepend('<td></td>')
$("tr>th:first-child").removeClass("col-md-3");
$("tr>th:first-child").addClass("col-md-1");
$("tr>th:nth-child(2)").removeClass("col-md-3");
$("tr>th:nth-child(2)").addClass("col-md-6");
$("tr>th:nth-child(3)").removeClass("col-md-3");
$("tr>th:nth-child(3)").addClass("col-md-3");
$("tr>th:nth-child(4)").removeClass("col-md-3");
$("tr>th:nth-child(4)").addClass("col-md-2");
$("tr>th:nth-child(5)").removeClass("col-md-3");
$("tr>th:nth-child(5)").addClass("col-md-3");
});
// $('.universal-table-index thead tr').prepend('<th></th>')
// $('.universal-table-index tbody tr').prepend('<td></td>')
$('.universal-table-index thead tr').prepend('<th></th>')
$('.universal-table-index tbody tr').prepend('<td></td>')
</script>

View File

@ -14,7 +14,8 @@
"zh_tw" : "2. 含序號表格列表",
"en" : "2. Index Table with serial number"
},
"thumbnail" : "thumb.png"
"thumbnail" : "thumb.png",
"default": true
}
]
}

View File

@ -14,7 +14,7 @@
<table class="table table-striped universal-table-show">
<tbody data-level="0" data-list="entry">
<tr>
<td class="col-md-2 table-title">{{title}}</td>
<td class="table-title">{{title}}</td>
<td>{{text}}</td>
</tr>
</tbody>

View File

@ -1,10 +1,10 @@
<div class="i-video_data video_data-index-1">
<h3 class="i-annc__page-title">{{page-title}}</h3>
<ul class="video_data_wrap col-sm-12" data-list="videos" data-level="0">
<li class="video_data col-sm-12 row" data-video-url="{{video_url}}" data-video-webm-url="{{video_webm_url}}" data-type="{{video_type}}">
<a class=" video_link" href="{{video_show_url}}" title="{{video_title_escape}}">
<img class=" col-sm-3 video_snapshot" src="{{snapshot_url}}"/>
<div class="col-sm-9 video_info">
<li class="video_data col-xs-12 col-sm-4" data-video-url="{{video_url}}" data-video-webm-url="{{video_webm_url}}" data-type="{{video_type}}">
<a class="video_link" href="{{video_show_url}}" title="{{video_title_escape}}">
<img class="video_snapshot" src="{{snapshot_url}}"/>
<div class="video_info">
<div class="video_group_time">{{video_post_agency}} | {{video_postdate}}</div>
<div data-list="video_tags" data-level="1" class="video_tag"><div>{{video_tag}}</div></div>
<div class="video_title"><h4>{{video_title}}</h4></div>
@ -19,18 +19,6 @@
</ul>
<div class="clearfix"></div>
<style>
.video_data{
overflow: hidden;
margin-bottom: 1.875em;
box-shadow: #0000004d 0 0 4px;
border: 1px solid #bbb;
margin: 0.5em;
padding: 1em;
&:hover{
border: 1px solid #55bbd0;
box-shadow: #55bbd0e6 0 0 4px;
}
}
.video_data_wrap{
display: flex;
flex-wrap: wrap;
@ -40,7 +28,6 @@
}
.video_tag{
color: #e4374a;
display: none;
}
.video_title h4{
font-size: 1.6em;
@ -56,25 +43,6 @@
.view_info img{
margin-right: 5px;
}
.video_group_time{
display: none;
}
.video_tags{
display: none;
}
.video_desc{
color: #333;
padding-top: 0.5em;
display: -webkit-box;
-webkit-line-clamp: 6;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.video_title{
border-bottom: 2px solid #55bbd0;
padding-bottom: 0.5em;
}
</style>
</div>
{{pagination_goes_here}}

View File

@ -20,7 +20,7 @@
<link rel="stylesheet" type="text/css" href="/assets/template/owl.carousel.min.css">
<link rel="stylesheet" type="text/css" href="/assets/template/owl.theme.default.min.css">
<%#= javascript_include_tag "app"%>
<%= javascript_include_tag "app"%>
<%= javascript_include_tag "#{@dataApi}" if @dataApi != nil%>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<%= render_google_analytics %>