{% extends 'admin/layout.html.twig' %}

{% set menu = 'admin_setting_message' %}

{% set script_controller = 'setting/site' %}

{% block main %}

{{ web_macro.flash_messages() }}

<form class="form-horizontal" id="site-form" method="post">
  
  <fieldset>
    
    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="name">{{'网站名称'|trans}}</label>
      </div>
      <div class="col-md-8 controls">
        <input type="text" id="name" name="name" class="form-control" value="{{site.name}}">
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="slogan">{{'网站副标题'|trans}}</label> 
      </div>
      <div class="col-md-8 controls">
         <input type="text" id="slogan" name="slogan" class="form-control" value="{{site.slogan}}">
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label"> 
        <label for="url">{{'网站域名'|trans}}</label> 
      </div>
      <div class="col-md-8 controls">
       <input type="text" id="url" name="url" class="form-control" value="{{site.url}}">
        <p class="help-block">{{'以"%http%://"开头'|trans({'%http%':app.request.getScheme()})}}</p>
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="logo">{{'网站LOGO'|trans}}</label>
      </div>
      <div class="col-md-8 controls">
        <div id="site-logo-container">{% if site.logo %}<img src="{{ asset(site.logo) }}">{% endif %}</div>
        <a class="btn btn-default" id="site-logo-upload" 
        data-upload-token="{{ upload_token('system', 'image') }}"
        data-goto-url="{{ path('admin_setting_logo_upload') }}">{{'上传'|trans}}</a>
        <button class="btn btn-default" id="site-logo-remove" type="button" data-url="{{ path('admin_setting_logo_remove') }}" {% if not site.logo %}style="display:none;"{% endif %}>{{'删除'|trans}}</button>
        <p class="help-block">{{'请上传png, gif, jpg格式的图片文件。LOGO图片建议不要超过250*50。网校logo设置后显示顶部导航左上角,'|trans}}<a href="{{ path('homepage') }}" target="_blank">点击查看</a></p>
        <input type="hidden" name="logo" value="{{ site.logo }}">
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="favicon">{{'浏览器图标'|trans}}</label>
      </div>
      <div class="col-md-8 controls">
        <div id="site-favicon-container">{% if site.favicon %}<img src="{{ asset(site.favicon) }}">{% endif %}</div>
        <a class="btn btn-default" 
        id="site-favicon-upload" 
        data-upload-token="{{ upload_token('system', 'image') }}"
        data-goto-url="{{ path('admin_setting_favicon_upload') }}">{{'上传'|trans}}</a>
        <button class="btn btn-default" 
        id="site-favicon-remove" 
        type="button" data-url="{{ path('admin_setting_favicon_remove') }}" {% if not site.favicon %}style="display:none;"{% endif %}>{{'删除'|trans}}</button>
        <p class="help-block">{{'请上传ico格式的图标文件, 建议大小16*16或者32*32。'|trans}}</p>
        <input type="hidden" name="favicon" value="{{ site.favicon }}">
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="seo_keywords">{{'SEO关键词'|trans}}</label>
      </div>
      <div class="col-md-8 controls">
        <input type="text" id="seo_keywords" name="seo_keywords" class="form-control" value="{{site.seo_keywords}}">
        <p class="help-block">{{'设置多个关键词请用半角逗号","隔开。'|trans}}</p>
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="seo_description">{{'SEO描述信息'|trans}}</label>
      </div>
      <div class="col-md-8 controls">
        <input type="text" id="seo_description" name="seo_description" class="form-control" value="{{site.seo_description}}">
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="master_email">{{'管理员邮箱地址'|trans}}</label>
      </div>
      <div class="col-md-8 controls">
        <input type="text" id="master_email" name="master_email" class="form-control" value="{{site.master_email}}">
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="copyright">{{'课程内容版权方'|trans}}</label>
      </div>
      <div class="col-md-8 controls">
        <input type="text" id="copyright" name="copyright" class="form-control" value="{{site.copyright}}">
        <div class="help-block">{{'您可以填写网站名称或公司名称。'|trans}}</div>
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="icp">{{'ICP备案号'|trans}}</label>
      </div>
      <div class="col-md-8 controls">
        <input type="text" id="icp" name="icp" class="form-control" value="{{site.icp}}">
      </div>
    </div>

  </fieldset>

<br>

  <fieldset>
    <legend>{{'网站统计分析代码部署'|trans}}</legend>
    <div class="form-group">
      <div class="col-md-2 control-label">
        <label for="analytics">{{'统计分析代码'|trans}}</label>
      </div>
      <div class="col-md-8 controls">

        <textarea id="analytics" name="analytics" class="form-control" rows="4">{{site.analytics}}</textarea>

        <p class="help-block">统计代码是网站统计软件发布的一段代码，用以统计添加统计代码的网站的数据。</p>
        <p class="help-block">包括网站的访客来源，从哪个网页跳转到此网站，搜索什么关键词到网站，一共有多少人访问，每天多少人多少IP，平均访问时间是多少等等数据。</p>
        <p class="help-block">统计分析工具可以分析网校访问趋势，以及根据数据做推广调整，优化网校资源，建议使用<a href="http://tongji.baidu.com" target="_blank">百度统计</a>、<a href="http://ta.qq.com/" target="_blank">腾讯分析</a>或者<a target="_blank" href="http://www.umeng.com/">CNZZ。</a></p>
      </div>
    </div>
  </fieldset>

  <fieldset style="display:none;">
    <legend>{{'站点状态'|trans}}</legend>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label >{{'网站状态'|trans}}</label>
      </div>
      <div class="col-md-8 controls radios">
        {{ radios('status', {open:'开放'|trans, closed:'关闭'|trans}, site.status) }}
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-2 control-label">
        <label>{{'网站关闭公告'|trans}}</label>
      </div>
        <div class="col-md-8 controls">
          <textarea id="closed_note" name="closed_note" class="form-control" rows="4">{{site.closed_note}}</textarea>
        <p class="help-block">{{'网站处于关闭状态时，用户访问网站将显示此公告，支持HTML代码'|trans}}。</p>
      </div>
    </div>
  </fieldset>

  <div class="row form-group">
    <div class="controls col-md-offset-2 col-md-8">
      <button type="submit" class="btn btn-primary">{{'提交'|trans}}</button>
    </div>
  </div>

  <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
  
</form>

{% endblock %}