<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>{$config.page_title|escape}</title>
{if $config.meta_robots}<meta name="robots" content="{$config.meta_robots}">
{/if}
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" href="{$config.root_uri}/bootstrap/bootswatch/{$appearance.bootswatch_name}/bootstrap.min.css" media="screen">
<link rel="stylesheet" href="{$config.root_uri}/css/parts.css">
<link rel="stylesheet" href="{$config.root_uri}/css/flatmemo.css">

<link rel="stylesheet" href="{$config.root_uri}/font-awesome/css/font-awesome.min.css">

<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="{$config.root_uri}/bootstrap/bootstrap.min.js" defer></script>
<script src="{$config.root_uri}/js/flatmemo.js" defer></script>
<script src="{$config.root_uri}/js/jquery_kill_referrer.js" defer></script>

<script src="{$config.root_uri}/js/jquery-ui.min.js" defer></script>
<script src="{$config.root_uri}/js/jquery.ui.touch-punch.min.js" defer></script>

{literal}
<script type="text/javascript">
var global_data = '';
jQuery(function(){
jQuery("#fm_sortable").sortable({
update: function(event, ui) {
    var data  = jQuery("#fm_sortable").sortable("serialize");
    var data2 = jQuery('#fm_sortable').sortable('toArray').toString();
global_data = data;
//alert(data);
//alert(data2);
}
})
.disableSelection();
});

function change_icon(){
var v;
if( jQuery('#display_icon_flag').prop('checked')){
v = jQuery('#display_icon_flag').val();
}
if (v=='on'){ jQuery("#fm_sortable p").show(); }
else{ jQuery("#fm_sortable p").hide(); }
}

function submit_junban(div_id){
accessing(div_id);
setTimeout( function() {
location.href=('memo_admin.php?cmd=category_turn_submit&'+global_data)
}, 1 );
}
</script>
{/literal}

</head>
<body>

{include file="inc/header.html"}



<div class="container">

<div class="page-header">
<h1>カテゴリの順番変更 <small>ドラッグしてカテゴリを入れ替えてください</small></h1>
</div>


<div class="row mb30">
<div class="col-xs-12">
<div class="pull-left"><a href="{$config.memo_uri}"><i class="fa fa-arrow-left"></i> トップに戻る</a>　　</div>
<div class="pull-right"><a href="{$config.admin_uri}?cmd=category_edit_input" ><i class="fa fa-file-text"></i> カテゴリの編集</a>　　
<a href="{$_program_name}?cmd=category_turn_input"><i class="fa fa-list"></i> カテゴリの順番変更</a>　　
<a href="{$_program_uri}?cmd=tag_edit_input" ><i class="fa fa-file-text"></i> タグの編集</a>
</div>
</div> <!-- /.col-xs-12 -->
</div>
<hr />


<div class="row mb30">
<div class="col-xs-12">
表示順番を確定する場合は【表示順番を確定】のボタンを押してください<br />
<input type="button" class="btn btn-primary mb3" onclick="submit_junban('accessing_2');" value="表示順番を確定" />
<input type="button" class="btn btn-primary mb3" onclick="location.href=('{$_program_uri}?cmd=category_edit_input')" value="キャンセルして戻る" />
<p id="accessing_1" class="fm_accessing" style="display:none;"><i class="fa fa-refresh fa-spin"></i> now accessing...</p>
</div>
</div><!-- /.row -->


<label><input type="checkbox" name="display_icon_flag" id="display_icon_flag" value="on" onclick="change_icon();" checked > アイコンを表示する</label>



<ul id="fm_sortable">
{ foreach from=$category_loop key="k" item="v" name="loopname"}
<li id="list_{$v.category_id}">
<div class="fm_icon2 pull-left">
<a href="{$config.memo_uri}/category/{$v.category_id}" target="_blank"><p style="background-image: url({$config.icon_uri}/{if $v.icon_file_name}{$v.icon_file_name}{else}noicon.jpg{/if})"></p></a>
</div>
<p class="pull-left ml5 mt5">{$v.category_name|escape}</p>
<br class="clear" />
</li>
{ /foreach }
</ul>

<hr />
表示順番を確定する場合は【表示順番を確定】のボタンを押してください<br />
<input type="button" class="btn btn-primary mb3" onclick="submit_junban('accessing_2');" value="表示順番を確定" />
<input type="button" class="btn btn-primary mb3" onclick="location.href=('{$_program_uri}?cmd=category_edit_input')" value="キャンセルして戻る" />
<p id="accessing_2" class="fm_accessing" style="display:none;"><i class="fa fa-refresh fa-spin"></i> now accessing...</p>



</div><!-- /.container -->


{include file="inc/footer.html"}


</body>
</html>
<!-- temp_admin_category_turn_input.html -->
