edit.html 3.2 KB
<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('focus/index')}">关注我们</a></li>
        <li><a href="{:url('focus/add')}">添加关注我们</a></li>
        <li class="active"><a>编辑关注我们</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('focus/editPost')}">
        <div class="form-group">
            <label for="input-link_name" class="col-sm-2 control-label">名称<span class="form-required">*</span></label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-link_name" name="name" value="{$focus.name}">
            </div>
        </div>
        <div class="form-group">
            <label for="thumbnail" class="col-sm-2 control-label">图片<span class="form-required">*</span></label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="thumbnail" name="image" value="{$focus.image}">
                <a href="javascript:uploadOneImage('上传图片','#thumbnail');">
                    <if condition="empty($focus.image)">
                        <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                             id="thumbnail-preview"
                             width="54" height="54" style="cursor: pointer"/>
                        <else/>
                        <img src="{:cmf_get_image_preview_url($focus.image)}"
                             id="thumbnail-preview"
                             width="54" height="54" style="cursor: pointer"/>
                    </if>
                </a>
                <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
                <a href="javascript:uploadOneImage('图片上传','#thumbnail');">上传图片</a>
            </div>
        </div>
        <div class="form-group">
            <label for="thumbnail" class="col-sm-2 control-label"></label>
            <div class="col-md-6 col-sm-10">
                <span class="form-required">图片参考尺寸:54*54</span>
            </div>
        </div>
        <div class="form-group">
            <label for="input-weigh" class="col-sm-2 control-label">权重</label>
            <div class="col-md-6 col-sm-10">
                <input type="number" class="form-control" id="input-weigh" name="weigh" value="{$focus.weigh}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="hidden" name="id" value="{$focus.id}">
                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                <a class="btn btn-default" href="{:url('focus/index')}">{:lang('BACK')}</a>
            </div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>

<script type="text/javascript">
    $(function () {
        $('.btn-cancel-thumbnail').click(function () {
            $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#thumbnail').val('');
        });
    });
</script>