EV005/modules/member/show.html.erb

68 lines
2.4 KiB
Plaintext
Raw Permalink Normal View History

2023-07-17 10:56:29 +00:00
<div class="show-member" module="member">
<div class="row">
<div class="member-pic col-xs-3">
<img src="{{image}}" alt="{{name}}" title="{{name}}" width="100%">
</div>
<div class="member-data col-xs-9">
<table class="table table-striped">
<div data-list="profile_data" data-level="0">
<tr><th class="{{title_class}}">{{title}}</th><td class="{{value_class}}">{{value}}</td></tr>
</div>
</table>
</div>
</div>
<ul class="member-plugins nav nav-pills" role="tablist" data-list="plugins" data-level="0">
<li class="{{plugin_class}}"><a href="#{{plugin_name}}" role="tab" data-toggle="tab" title="{{plugin_title}}">{{plugin_title}}</a></li>
</ul>
<div class="tab-content" data-list="plugins" data-level="0">
<div class="tab-pane {{plugin_class}}" id="{{plugin_name}}">
<div class="info" data-list="plugin_data_intro" data-level="1">
{{data_intro_title}}
</div>
<table class="table table-hover table-striped {{complete_display}}">
<thead>
<tr data-list="pd_title" data-level="1">
<th>{{plugin_data_title}}</th>
</tr>
</thead>
<tbody data-level="1" data-list="plugin_datas">
<tr data-level="2" data-list="pd_datas">
<td>{{data_title}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script>
(function() {
// Adding class on first element
function memberPlugins() {
var plugins = document.querySelector('.member-plugins');
if( plugins.children.length === 0 ) {
return;
}
if( plugins.querySelectorAll('.member-plugins .active').length === 0 ) {
var navs = plugins.querySelectorAll('.member-plugins > li'),
contents = plugins.nextElementSibling.children[0];
navs[0].className += ' ' + 'active';
contents.className += ' ' + 'active';
}
}
memberPlugins();
}())
for(var i = 0;i < $('.show-member img').length ; i++){
if($('.show-member img').eq(i).attr('alt')=="" ){
$('.show-member img').eq(i).attr('alt','noname');
$('.show-member img').eq(i).attr('title','noname');
}
}
for(var i = 0;i < $('.show-member table').length ; i++){
if($('.show-member table').eq(i).html().trim().replace('&nbsp;','')=="" )
$('.show-member table').eq(i).html('please write down something!');
}
</script>