articles_edit.html 7.05 KB
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
#override("css") #end #override("body")
<style>
#select6 {
width: 100%;
height: 36px;
}
</style>

<script type="text/javascript" charset="utf-8" src="${ctx}/static/js/plugins/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctx}/static/js/plugins/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"src="${ctx}/static/js/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>

<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="col-sm-12">
<form id="validForm" class="form-horizontal m-t"
novalidate="novalidate">
<div class="form-group">
<label class="col-sm-2 control-label">*栏目:</label>
<div class="col-sm-5">
<select class="form-control" id="columnList">

</select>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">*分类:</label>
<div class="col-sm-5">
<select class="form-control">
<option value="">请选择</option>
<option value="1">孕期</option>
<option value="2">育儿</option>
<option value="3">其它</option>
</select>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">权重:</label>
<div class="col-sm-5">
<input type="text" class="form-control" class="form-control"
placeholder="选填" name="">
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">*标签:</label>
<div class="col-sm-5">
<select id="select6" name="contentTagIds" multiple
data-selectator-keep-open="true">
</select>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label" for="">*封面:</label>
<div class="col-sm-5">
<div class="btn-group m-b">
<label class="btn btn-sm btn-info w-sm"
onclick="switchContent(1)"> <i
class="fa fa-check text-active" id="commonCon"></i> 普通内容
</label> <label class="btn btn-sm btn-success w-sm"
onclick="switchContent(2)"> <i class="fa text-active"
id="specialCon"></i> 专题内容
</label>
</div>
<div class="col-sm-12 no-padder">
<div ng-file-select="onFileSelect($files)" data-multiple="false"
title="点击上传" onclick="this.value = null"
class="btn btn-primary btn-upload m-b-sm">
<i class="fa fa-cloud-upload text"></i> 点击上传图片
</div>
<img class="b wrapper-xs w img-responsive" style="width: 200px"
src="${ctx}/static/images/p0.jpg" />
</div>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-sm-2 control-label">*标题:</label>
<div class="col-sm-5">
<input type="text" ng-maxlength="32" name="title"
class="form-control w-lg" required="" aria-required="true">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*链接:</label>
<div class="col-sm-5">
<input type="text" type="url" name="link"
class="form-control w-lg" required="" aria-required="true">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*摘要:</label>
<div class="col-sm-5">
<input type="text" ng-maxlength="255" name="introduction"
ng-model="article.introduction" class="form-control w-lg"
ng-required="radioModel.imageType == 'Ordinary'">
</div>
</div>

<div class="form-group" id="imageContext">
<label class="col-sm-2 control-label">正文:</label>
<div class="col-sm-5">
<script id="editor" name="richText" type="text/plain"></script>
</div>
</div>

<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-sm-7 col-sm-offset-3 pull-right">
<button type="button" class="btn btn-primary" onclick="save();">
<i class="fa fa-check"></i>&nbsp;提交
</button>
<button type="button" class="btn btn-white"
onclick="parent.closeAll();">
<i class="fa fa-close"></i>&nbsp;取消
</button>
</div>
</div>
</form>
</div>
</div>
</div>
#end #extends("/common/base_list.html")
<script type="text/javascript" src="${ctx}/static/js/plugins/plupload/moxie.js"></script>
<script type="text/javascript" src="${ctx}/static/js/plugins/plupload/plupload.dev.js"></script>
<script type="text/javascript" src="${ctx}/static/js/plugins/plupload/i18n/zh_CN.js"></script>
<script type="text/javascript" src="${ctx}/static/qiniu.min.js"></script>

<script type="text/javascript">
$('#multChe').on('ifClicked', function(event) {
$("#imageTitle").toggleClass("hidden");
$("#imageContext").toggleClass("hidden");
$("#imageTitle").toggleClass("show");
$("#imageContext").toggleClass("show");
});

function switchContent(num) {
if (num == 1) {
$("#commonCon").addClass("fa-check");
$("#specialCon").removeClass("fa-check");
} else {
$("#commonCon").removeClass("fa-check");
$("#specialCon").addClass("fa-check");
}
}

$(function() {
//初始化
var ue = UE.getEditor('editor', {
initialFrameHeight : 200,
initialFrameWidth : "100%"
});

$.getJSON("${ctx}/contentCategories/list", function(data) {
if (data.success) {
var columnList = "<option value=''>请选择</option>";
data.data.forEach(function(d, i) {
columnList += "<option value='"+d.id+"'>" + d.name + "</option>";
});
$("#columnList").empty();
$("#columnList").append(columnList);
}
});

$.get("${ctx}/contentTags/list", "json", function(data) {
if (data.success) {
var seleHtml = "";
data.data.forEach(function(d, i) {
seleHtml += '<option value="'+d.id+'">' + d.tagName + '</option>';
});

$("#select6").empty();
$("#select6").append(seleHtml);

$('#select6').selectator({
prefix : 'selectator_', // CSS class prefix
height : 'auto', // auto or element
useDimmer : false, // dims the screen when option list is visible
useSearch : true, // if false, the search boxes are removed and
// `showAllOptionsOnFocus` is forced to true
keepOpen : true, // if true, then the dropdown will not close when
// selecting options, but stay open until losing focus
showAllOptionsOnFocus : true, // shows all options if input box is empty
selectFirstOptionOnSearch : true, // selects the topmost option on every search
searchCallback : function(value) {
}, // Callback function when enter is pressed and
// no option is active in multi select box
labels : {
search : 'Search...' // Placeholder text in search box in single select box
}
});

}
});
});

function save() {
var content = UE.getEditor('editor').getContent();
if ($('#validForm').valid()) {
var data = $('#validForm').serialize();
//data+"&"
ajaxPost(APP.PATH + "/contentMessageTemplate/create", data);
parent.reloadGrid('dataTable');
}
}
</script>