{% extends "../theme.html" %}

{% block content %}
{%include 'inc/menu.html'%}
<div class="pannel">
    <h2>修改农场资料</h2>
    <form class="formset" action="/main/edit" method="post" autocomplete="off" target="f1">
            {% module xsrf_form_html() %}
        <input type="hidden" name="function" id="function" value="msg"/>
        <iframe id="f1" name="f1" style="display:none;"></iframe>
        <div class="form-group"><span>农场名称</span><div class="formbox"><input type="text" name="update_name" id="update_name" placeholder="农场名称" value="{{data['setting']['farmInfo']['name']}}"/></div></div>
        <div class="form-group">
            <span>农场照片</span><div class="formbox">
            <div class="imgbox">
                <a class="upimg img1000x500" ><img src="{% if data['setting']['farmInfo']['pic'] %}{{data['setting']['farmInfo']['pic']}}{% else %}data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo1MzMwRkIzMDhDOUMxMUU3QjZENkJFRDMzNkQ4MDIyNiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo1MzMwRkIzMThDOUMxMUU3QjZENkJFRDMzNkQ4MDIyNiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjUzMzBGQjJFOEM5QzExRTdCNkQ2QkVEMzM2RDgwMjI2IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjUzMzBGQjJGOEM5QzExRTdCNkQ2QkVEMzM2RDgwMjI2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+eEhyRgAAABBJREFUeNpi+P//PwNAgAEACPwC/tuiTRYAAAAASUVORK5CYII={% end %}" width="100%" height="100%" id="upload_pic_show"/><i>1000*300~450</i></a><a class="button">选择<input type="file" class="upload" name="file" id="pic"/><input type="hidden" id="update_pic" name="update_pic"  value="{{data['setting']['farmInfo']['pic']}}"/></a>
            </div></div>
        </div>
        <div class="form-group"><span>农场位置</span><div class="formbox"><input type="text" name="update_location" id="update_location" placeholder="农场位置" value="{{data['setting']['farmInfo']['location']}}"/> [<a href="http://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank">获取农场坐标</a>]</div></div>
        <div class="form-group"><span>农场主姓名</span><div class="formbox"><input type="text" name="update_master_name" id="update_master_name" placeholder="农场主姓名" value="{{data['setting']['farmInfo']['master_name']}}"/></div></div>
        <div class="form-group">
            <span>场主照片</span><div class="formbox">
            <div class="imgbox">
                <a class="upimg img500x500" ><img src="{% if data['setting']['farmInfo']['master_pic'] %}{{data['setting']['farmInfo']['master_pic']}}{% else %}data:image/png;base64,iVBORw0KGgoAA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CNkQ2QkVEMzM2RDgwMjI2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+eEhyRgAAABBJREFUeNpi+P//PwNAgAEACPwC/tuiTRYAAAAASUVORK5CYII={% end %}" width="100%" height="100%" id="upload_master_pic_show"/><i>300*450</i></a><a class="button">选择<input type="file" class="upload" name="file" id="master_pic"/><input type="hidden" id="update_master_pic" name="update_master_pic"  value="{{data['setting']['farmInfo']['master_pic']}}"/></a>
            </div></div>
        </div>
        <div class="form-group"><span>联系电话</span><div class="formbox"><input type="text" name="update_tel" id="update_tel" placeholder="联系电话" value="{{data['setting']['farmInfo']['tel']}}"/></div></div>
        <div class="form-group"><span>联系地址</span><div class="formbox"><input type="text" name="update_address" id="update_address" placeholder="联系地址" value="{{data['setting']['farmInfo']['address']}}"/></div></div>
        <div class="form-group" style="display:none;"><span>欢迎语</span><div class="formbox"><input type="text" name="update_welcome" id="update_welcome" placeholder="欢迎语" value="{{data['setting']['farmInfo']['welcome']}}"/></div></div>
        <div class="form-group">
            <input type="submit" name="" class="button big primary" value="修改确认">
        </div>
    </form>
</div>
<div id="allmap" style="display:none;"></div>
{% end %}

{% block script %}
<script type="text/javascript" src="{{static_url('pc/lib/layui/layui.js')}}"></script>
<script type="text/javascript">
Farm.Upload('#pic','#master_pic');
</script>
{% end %}