rhymix/modules/autoinstall/tpl/list.html
2012-10-08 02:40:27 +00:00

205 lines
10 KiB
HTML

<include target="category.html" />
<div class="x_clearfix">
<div cond="$act == 'dispAutoinstallAdminIndex'" class="x_pull-left">
<!--@if($order_target == 'newest')-->
<!--@if($order_type == 'desc')-->{@$_newest_order_type = 'asc'}<!--@else-->{@$_newest_order_type = 'desc'}<!--@end-->
<!--@else-->
{@$_newest_order_type = 'desc'}
<!--@end-->
<!--@if($order_target == 'download')-->
<!--@if($order_type == 'desc')-->{@$_download_order_type = 'asc'}<!--@else-->{@$_download_order_type = 'desc'}<!--@end-->
<!--@else-->
{@$_download_order_type = 'desc'}
<!--@end-->
<!--@if($order_target == 'popular')-->
<!--@if($order_type == 'desc')-->{@$_popular_order_type = 'asc'}<!--@else-->{@$_popular_order_type = 'desc'}<!--@end-->
<!--@else-->
{@$_popular_order_type = 'desc'}
<!--@end-->
<a href="{getUrl('order_target','newest','order_type',$_newest_order_type)}">{$lang->order_newest}<!--@if($order_target == 'newest')--><i class="<!--@if($_newest_order_type == 'asc')-->x_icon-arrow-down<!--@else-->x_icon-arrow-up<!--@end-->">{$_newest_order_type}</i><!--@end--></a>
<i>|</i>
<a href="{getUrl('order_target','download','order_type',$_download_order_type)}">{$lang->order_download}<!--@if($order_target == 'download')--><i class="<!--@if($_newest_order_type == 'asc')-->x_icon-arrow-down<!--@else-->x_icon-arrow-up<!--@end-->">{$_newest_order_type}</i><!--@end--></a>
<i>|</i>
<a href="{getUrl('order_target','popular','order_type',$_popular_order_type)}">{$lang->order_popular}<!--@if($order_target == 'popular')--><i class="<!--@if($_newest_order_type == 'asc')-->x_icon-arrow-down<!--@else-->x_icon-arrow-up<!--@end-->">{$_newest_order_type}</i><!--@end--></a></li>
</div>
<div class="x_btn-group x_pull-right x_nav">
<button id="__btn_simple" class="x_btn x_active">{$lang->simple_view}</button>
<button id="__btn_detail" class="x_btn">{$lang->detail_view}</button>
</div>
</div>
<div id="__list_simple">
<strong>
<block cond="$current_category">{$current_category}</block>
<block cond="!$current_category">All</block>
({sprintf('%d', $page_navigation->total_count)})
</strong>
<div class="x_row-fluid">
{@$c = 0}
<block loop="$item_list => $key, $item">
{@ $target_url = $original_site."?mid=download&package_srl=".$item->package_srl; }
{@$c++}
<div class="x_well x_span6" style="position:relative;padding-left:135px;">
<div class="x_thumbnail" style="position:absolute;left:15px">
<img src="{str_replace('./', $uri, $item->item_screenshot_url)}" alt="" width="100" height="100" />
</div>
<div style="text-align:right">
<p>{$item->category}</p>
<h4 style="text-overflow:ellipsis;overflow:hidden;white-space:nowrap"><a href="{$target_url}" title="{htmlspecialchars($item->title)}" target="_blank">{htmlspecialchars($item->title)}</a></h4>
<p>
<block cond="(int)$item->package_voter > 0">
<span class="starRating" style="text-align:left"><span style="width:{sprintf("%d",$item->package_voted/$item->package_voter*20)}%">{sprintf($lang->rate, $item->package_start)}</span></span>
<span class="x_label">{sprintf("%0.1f",$item->package_voted/$item->package_voter*2)}/{number_format($item->package_voter)}</label>
</block>
<block cond="(int)$item->package_voter <= 0">
<span class="starRating" style="text-align:left"><span style="width:0%">0</span></span>
<span class="x_label">0/0</span>
</block>
</p>
<p>
<a cond="$item->current_version && $item->need_update != 'Y'" class="x_btn x_disabled" href="#">{$lang->installed}</a>
<a cond="!$item->current_version" class="x_btn x_btn-primary" href="{getUrl('act','dispAutoinstallAdminInstall','package_srl',$item->package_srl)}">{$lang->install}</a>
<a cond="!$show_ftp_note && $item->current_version && $item->avail_remove" class="x_btn x_btn-primary" href="{getUrl('act','dispAutoinstallAdminUninstall','package_srl',$item->package_srl)}">{$lang->cmd_delete}</a>
<a cond="$item->current_version && $item->need_update == 'Y'" class="x_btn x_btn-primary" href="{getUrl('act','dispAutoinstallAdminInstall','package_srl',$item->package_srl)}">{$lang->update}</a>
</p>
</div>
</div>
<!--@if($c % 2 == 0)-->
</div>
<div class="x_row-fluid">
<!--@end-->
</block>
</div>
</div>
<table id="__list_detail" class="x_table x_table-striped x_table-hover" style="display:none">
<caption>
<strong>
<block cond="$current_category">{$current_category}</block>
<block cond="!$current_category">All</block>
({sprintf('%d', $page_navigation->total_count)})
</strong>
</caption>
<thead>
<tr>
<th scope="col" class="nowr">{$lang->category}</th>
<th scope="col" class="nowr">{$lang->thumbnail}</th>
<th scope="col" class="title">{$lang->name}</th>
<th scope="col" class="nowr">{$lang->distribute_version}</th>
<th scope="col" class="nowr">{$lang->current_version}</th>
<th scope="col" class="nowr">{$lang->run}</th>
</tr>
</thead>
<tbody>
<tr loop="$item_list => $key, $item">
{@ $target_url = $original_site."?mid=download&package_srl=".$item->package_srl; }
<td class="nowr">{$item->category}</td>
<td>
<div class="x_thumbnail">
<img src="{str_replace('./', $uri, $item->item_screenshot_url)}" alt="" width="100" height="100" />
</div>
</td>
<td class="title">
<p><a href="{$target_url}" target="_blank">{htmlspecialchars($item->title)}</a></p>
<p>{cut_str(htmlspecialchars($item->package_description),200)}</p>
<p>
<block cond="(int)$item->package_voter > 0">
<span class="starRating"><span style="width:{sprintf("%d",$item->package_voted/$item->package_voter*20)}%">{sprintf($lang->rate, $item->package_start)}</span></span>
<span class="x_badge">{sprintf("%0.1f",$item->package_voted/$item->package_voter*2)}/{number_format($item->package_voter)}</span> <i>|</i>
</block>
<block cond="(int)$item->package_voter <= 0">
<span class="starRating"><span style="width:0%">0</span></span>
<span class="x_badge">0/0</span> <i>|</i>
</block>
{$lang->package_update} {zdate($item->item_regdate, "Y-m-d H:i")} <i>|</i>
{$lang->package_downloaded_count} : {number_format($item->package_downloaded)}
</p>
<p cond="$item->deps">{$lang->dependant_list}:</p>
<ul cond="$item->deps">
<li loop="$item->deps => $package_srl">{$installed[$package_srl]->title}</li>
</ul>
</td>
<td class="nowr">{htmlspecialchars($item->item_version)}</td>
<td class="nowr">{htmlspecialchars($item->current_version)}</td>
<td class="nowr">
<a cond="$item->current_version && $item->need_update != 'Y'" class="x_btn x_disabled" href="#">{$lang->installed}</a>
<a cond="!$item->current_version" class="x_btn x_btn-primary" href="{getUrl('act','dispAutoinstallAdminInstall','package_srl',$item->package_srl)}">{$lang->install}</a>
<a cond="!$show_ftp_note && $item->current_version && $item->avail_remove" class="x_btn x_btn-primary" href="{getUrl('act','dispAutoinstallAdminUninstall','package_srl',$item->package_srl)}">{$lang->cmd_delete}</a>
<a cond="$item->current_version && $item->need_update == 'Y'" class="x_btn x_btn-primary" href="{getUrl('act','dispAutoinstallAdminInstall','package_srl',$item->package_srl)}">{$lang->update}</a>
</td>
</tr>
</tbody>
</table>
<form cond="$page_navigation" action="./" class="x_pagination x_pagination-centered" no-error-return-url="true">
{@
$urlInfo = parse_url(getRequestUriByServerEnviroment());
parse_str($urlInfo['query'], $param);
}
<input loop="$param => $key, $val" cond="!in_array($key, array('mid', 'vid', 'act'))" type="hidden" name="{$key}" value="{$val}" />
<ul>
<li class="x_disabled"|cond="!$page || $page == 1"><a href="{getUrl('page', '')}">&laquo; {$lang->first_page}</a></li>
<block cond="$page_navigation->first_page != 1 && $page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page - 1 && $page_navigation->page_count != $page_navigation->total_page">
{@$isGoTo = true}
<li>
<a href="#goTo" data-toggle="#goTo" title="{$lang->cmd_go_to_page}">...</a>
<span cond="$isGoTo" id="goTo" class="x_input-append">
<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
<button type="submit" class="x_add-on">Go</button>
</span>
</li>
</block>
<!--@while($page_no = $page_navigation->getNextPage())-->
{@$last_page = $page_no}
<li class="x_active"|cond="$page_no == $page"><a href="{getUrl('page', $page_no)}">{$page_no}</a></li>
<!--@end-->
<block cond="$last_page != $page_navigation->last_page && $last_page + 1 != $page_navigation->last_page">
{@$isGoTo = true}
<li>
<a href="#goTo" data-toggle="#goTo" title="{$lang->cmd_go_to_page}">...</a>
<span cond="$isGoTo" id="goTo" class="x_input-append">
<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
<button type="submit" class="x_add-on">Go</button>
</span>
</li>
</block>
<li class="x_disabled"|cond="$page == $page_navigation->last_page"><a href="{getUrl('page', $page_navigation->last_page)}" title="{$page_navigation->last_page}">{$lang->last_page} &raquo;</a></li>
</ul>
</form>
<form action="./" class="search center x_input-append" no-error-return-url="true">
<input loop="$param => $key, $val" cond="!in_array($key, array('mid', 'vid', 'act', 'page'))" type="hidden" name="{$key}" value="{$val}" />
<input type="search" name="search_keyword" required title="Search" value="{htmlspecialchars($search_keyword)}">
<button class="x_btn x_btn-inverse" type="submit">{$lang->cmd_search}</button>
<a href="{getUrl('page', '', 'search_keyword', '')}" class="x_btn">{$lang->cmd_cancel}</a>
</form>
<script>
jQuery(function($){
var $btnSimple = $('#__btn_simple');
var $btnDetail = $('#__btn_detail');
var $listSimple = $('#__list_simple');
var $listDetail = $('#__list_detail');
$btnSimple.click(function(){
$btnSimple.addClass('x_active');
$btnDetail.removeClass('x_active');
$listSimple.show();
$listDetail.hide();
setCookie('__autoinstall_view_type', 'simple');
});
$btnDetail.click(function(){
$btnSimple.removeClass('x_active');
$btnDetail.addClass('x_active');
$listSimple.hide();
$listDetail.show();
setCookie('__autoinstall_view_type', 'detail');
});
var viewType = getCookie('__autoinstall_view_type');
if(viewType == 'detail'){
$btnDetail.trigger('click');
}
});
</script>