|
|
|
@ -532,7 +532,12 @@
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-xs-24 btn-sm"></div>
|
|
|
|
|
<div class="col-xs-7">
|
|
|
|
|
<label>信息标题</label>
|
|
|
|
|
<label>
|
|
|
|
|
信息标题
|
|
|
|
|
<button type="button" class="btn btn-xs" data-toggle="modal" data-target="#tagM">
|
|
|
|
|
+ 标签(国际站)
|
|
|
|
|
</button>
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-xs-24">
|
|
|
|
|
<input class="form-control" type="text" id="ic_title" style="<?php if ($embody == 1) echo 'border-color:green;'; ?>" name="ic_title" value="<?php echo $information->ic_title; ?>" >
|
|
|
|
@ -1253,3 +1258,90 @@
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<?php //标签模态框 ?>
|
|
|
|
|
<div class="modal fade" id="tagM" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
|
|
|
|
<style type="text/css">
|
|
|
|
|
.tagLabel {background: #eee;padding: 5px 15px 5px 35px!important;border-radius: 5px;border: 1px solid #aaa; margin-right:2px;}
|
|
|
|
|
.myTag {background: darkcyan; color:#fff; border-color: #000;}
|
|
|
|
|
.tagLabel.newLabel {padding: 5px 10px!important;border: 1px dashed #000;}
|
|
|
|
|
</style>
|
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
|
|
|
|
<h4 class="modal-title" id="myModalLabel">添加标签</h4>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<div class="checkbox">
|
|
|
|
|
<?php foreach ($my_tags as $tag) { ?>
|
|
|
|
|
<label class="tagLabel myTag">
|
|
|
|
|
<input type="checkbox" value="<?php echo($tag->it_title)?>" data-it-id="<?php echo($tag->it_id)?>" checked>
|
|
|
|
|
<span><?php echo($tag->it_title)?></span>
|
|
|
|
|
</label>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="checkbox">
|
|
|
|
|
<?php foreach ($all_tags as $tag) { ?>
|
|
|
|
|
<label class="tagLabel">
|
|
|
|
|
<input type="checkbox" value="<?php echo($tag->it_title)?>" data-it-id="<?php echo($tag->it_id)?>">
|
|
|
|
|
<span><?php echo($tag->it_title)?></span>
|
|
|
|
|
</label>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
<label class="tagLabel newLabel">
|
|
|
|
|
<a class="btn btn-xs newTagA"> + 新标签 </a>
|
|
|
|
|
<input class="form-control input-sm newTag newTagI" type="text" placeholder=" + 新标签 " style="display:none">
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
<a class="btn btn-default" target="_blank" href="http://localhost:3000/">打开模板标签管理</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
//标签更新
|
|
|
|
|
$('[data-it-id]').on('change', function() {
|
|
|
|
|
if ($(this).is(':checked')) {
|
|
|
|
|
$.post('/info.php/info_tags/add_tag_to_content/', {
|
|
|
|
|
'it_id' : $(this).attr('data-it-id'),
|
|
|
|
|
'ic_id' : <?php echo $information->ic_id; ?>,
|
|
|
|
|
});
|
|
|
|
|
$(this).parent().addClass('myTag');
|
|
|
|
|
} else {
|
|
|
|
|
$.post('/info.php/info_tags/remove_tag_to_content/', {
|
|
|
|
|
'it_id' : $(this).attr('data-it-id'),
|
|
|
|
|
'ic_id' : <?php echo $information->ic_id; ?>,
|
|
|
|
|
});
|
|
|
|
|
$(this).parent().removeClass('myTag');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//新标签
|
|
|
|
|
$('.newTagA').on('click', function() {
|
|
|
|
|
$(this).hide();
|
|
|
|
|
$('.newTagI').show();
|
|
|
|
|
});
|
|
|
|
|
$('.newTagI').on('blur', function() {
|
|
|
|
|
$(this).hide();
|
|
|
|
|
if ($(this).val()) {
|
|
|
|
|
//添加标签
|
|
|
|
|
$.post('/info.php/info_tags/add_tag/', {'title':$(this).val(),'memo':'test'}, function(json) {
|
|
|
|
|
if (json.statu != '-1') {
|
|
|
|
|
$clone = $('.tagLabel').eq(0).clone(true);
|
|
|
|
|
$clone.removeClass('myTag');
|
|
|
|
|
$clone.find('input').attr('data-it-id', json.message).removeAttr('checked');
|
|
|
|
|
$clone.find('span').html($('.newTagI').val());
|
|
|
|
|
$('.newLabel').before($clone);
|
|
|
|
|
//归零
|
|
|
|
|
$('.newTagI').val('').hide();
|
|
|
|
|
$('.newTagA').html(' + 新标签 ').show();
|
|
|
|
|
} else {
|
|
|
|
|
alert('增加标签失败!');
|
|
|
|
|
}
|
|
|
|
|
}, 'json');
|
|
|
|
|
$('.newTagA').html($(this).val()).show();
|
|
|
|
|
} else {
|
|
|
|
|
$('.newTagA').html(' + 新标签 ').show();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</div>
|