{include file="$template_path/html/header.html"}
</head>
<body class="">
{include file="$template_path/html/user-header-self.html"}

<div class="space-items clear bg-lgray b-b" id="items">
  <div class="container">
    <div class="row">
      <div class="container m-b-md text-center">
        <ul class="nav navbar-nav space-nav ">
          {include file="$template_path/users/tabsy.html"}
        </ul>

      </div>
    </div>
  </div>
</div>



<div class="clearfix m-t-md text-center">
  <div class="container" id="ziper">

    <a href="javascript:;" class="btn btn-ghost-success btn-rounded btn-xs-xs m-t-sm">个人资料</a>
    <a href="javascript:;" class="btn btn-ghost-success btn-rounded btn-xs-xs m-t-sm">更改密码</a>
    <a href="javascript:;" class="btn btn-ghost-success btn-rounded btn-xs-xs m-t-sm">头像和主页图片</a>
    <a href="javascript:;" class="btn btn-ghost-success btn-rounded btn-xs-xs m-t-sm">我的社交应用</a>
    {if $smarty.session.user.quiz == 'true'}
    <a href="javascript:;" class="btn btn-ghost-success btn-rounded btn-xs-xs m-t-sm">自荐作品</a>
    <a href="javascript:;" class="btn btn-ghost-success btn-rounded btn-xs-xs m-t-sm">作品许可</a>
    {/if}

  </div>


</div>


<section class="clearfix">
  <div class="container pos-rlt p-t-md m-t-sm m-b-lg m-xs-t-none m-xs-b-none">

    <div class="row">
      <div class="col-xs-12 col-xs-offset-0 col-sm-8 col-sm-offset-2" id="taber">


        <div class="panel b-a">
          <div class="panel-heading b-b">
            <p class="h3 h3-xs m-t-xs m-b-xs">个人信息</p>
          </div>
          <div id="profile" class="panel-body">
            <form class="form-horizontal disable-on-submit" action="" method="post">
              <fieldset>



                <div class="form-group">
                  <label class="col-sm-2 control-label" for="nickname">昵称</label>
                  <div class="col-sm-10">
                    <input id="nickname" class="form-control rounded" name="nickname" required="true" type="text" value="{$smarty.post.nickname|escape}" />
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="invoice_to">公司名称</label>
                  <div class="col-sm-10">
                    <input id="invoice_to" class="form-control rounded" name="firmname" type="text" value="{$smarty.post.firmname|escape}" />
                    <small class="text-grays">没有请留空</small>
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="lives_in">所在城市</label>
                  <div class="col-sm-10">
                    <input id="lives_in" class="form-control rounded" name="live_city" type="text" value="{$smarty.post.live_city|escape}" />
                    <small class="text-grays">比如：北京</small>
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="email">邮件地址</label>
                  <div class="col-sm-10">
                    <input id="email" class="form-control rounded" name="email" value="{$smarty.post.email|escape}" type="text">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="country">国家地区</label>
                  <div class="col-sm-10">
                    <select name="country_id" class="form-control rounded">
                      <option value="">不显示我的国家</option>
                      {if $countries}
                      {foreach from=$countries item=c}
                      <option value="{$c.id}" {if $smarty.post.country_id == $c.id}selected="selected"{/if}>{$c.name}</option>
                      {/foreach}
                      {/if}
                    </select>

                    <small class="text-grays">选择国家或地区后将显示相应的旗帜徽章</small>
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="address">详细地址</label>
                  <div class="col-sm-10">
                    <input id="address" class="form-control rounded" name="address" value="{$smarty.post.address|escape}" type="text">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="available_for_freelance">我是威客</label>
                  <div class="col-sm-10">
                    <label class="i-checks m-l-sm m-t-xs"><input id="available_for_freelance" name="custom_made" type="checkbox" value="true" {if $smarty.post.custom_made == 'true'}checked="checked"{/if} /><i></i>可以接受定制服务</label>
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-2 control-label" for="by_line">个性签名</label>
                  <div class="col-sm-10">
                    <input id="by_line" class="form-control rounded" name="profile_title" type="text" value="{$smarty.post.profile_title|escape}" />
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-2 control-label" for="profile_desc">个人介绍</label>
                  <div class="col-sm-10">
                    <!--初始化编辑器-->
                    <script id="profile_desc" name="profile_desc" type="text/plain">
					  {$smarty.post.profile_desc}
					</script>
                    <!-- 配置文件 -->
                    <script type="text/javascript" src="{$data_server}ueditor/ueditor.config.js"></script>
                    <!-- 编辑器源码文件 -->
                    <script type="text/javascript" src="{$data_server}ueditor/ueditor.all.js"></script>
                    <!-- 实例化编辑器 -->
                    <script type="text/javascript">
                      var ue = UE.getEditor('profile_desc');
                    </script>

                    <!--<textarea class="tall" id="profile_desc" name="profile_desc">{$smarty.post.profile_desc}</textarea>-->
                    <!--<small><div class="formatting-help">{$lang.formatting_help}</div></small>-->


                    <!--<div class="summernote-wrapper">
                      <div class="summernote-wrapper">
                        <div id="summernote">输入您的内容</div>
                      </div>
                    </div>
                    <div class="post-toolbar b-l b-b b-r">
                      <span class="pull-right">
                        <button class="btn btn-sm btn-success padder-lg" type="button">
                          发布
                        </button>
                      </span>
                      <div class="toolbar-buttons">
                        <a class="btn btn-link btn-sm" title="插入表情">
                          <i class="icon-emoticon-smile"></i>
                        </a>
                      </div>
                    </div>-->


                  </div>
                </div>

                <div class="form-submit"><input type="hidden" name="personal_edit" value="yes" />
                  <button id="personal_info_submit_button" class="btn btn-success btn-block" type="submit">保存</button>
                </div>


              </fieldset>
            </form>
          </div>
        </div>

        <div class="panel b-a">
          <div class="panel-heading b-b">
            <p class="h3 h3-xs m-t-xs m-b-xs">更改密码</p>
          </div>
          <div id="profile" class="panel-body">
            <form class="form-horizontal disable-on-submit" action="" method="post">
              <fieldset>
                <div class="form-group">
                  <label class="col-sm-3 control-label" for="current_password">当前密码</label>
                  <div class="col-sm-9">
                    <input id="current_password" class="form-control rounded" name="password" required="true" type="password" value="" />
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-3 control-label" for="user_password">输入新密码</label>
                  <div class="col-sm-9">
                    <input type="password" class="form-control rounded" id="user_password" name="new_password" />
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-3 control-label" for="user_password_again">确认新密码</label>
                  <div class="col-sm-9">
                    <input type="password" class="form-control rounded" id="user_password_again" name="new_password_confirm" />
                  </div>
                </div>
                <div class="form-submit"><input type="hidden" name="change_password" value="yes" />
                  <button id="personal_info_submit_button" class="btn btn-success btn-block" type="submit">保存</button>
                </div>


              </fieldset>
            </form>
          </div>

        </div>

        <div class="panel b-a">
          <div class="panel-heading b-b">
            <p class="h3 h3-xs m-t-xs m-b-xs">头像和主页图片</p>
          </div>
          <div id="profile" class="panel-body">
            <form class="horizontal-form disable-on-submit" action="" method="post" enctype="multipart/form-data">
              <fieldset>
                <div class="form-group clearfix">
                  <label class="col-sm-2 control-label" for="profile_image">你的头像</label>
                  <div class="col-sm-10">
                    {if $smarty.session.user.avatar != ''}
                    <img alt="{$smarty.session.user.username}" src="{$data_server}/uploads/users/{$smarty.session.user.user_id}/A_{$smarty.session.user.avatar}" width="90" height="90" />
                    {/if}
                    <div class="chosepic m-t-sm clearfix">
                      <input id="profile_image" name="profile_image" type="file" class="filestyle" data-icon="false" data-classButton="btn btn-default" data-classInput="form-control inline v-middle input-s">
                    </div>
                    <small class="text-grays">图片格式JPEG 图片尺寸128x128px</small>
                  </div>
                </div>
                <div class="form-group clearfix m-t-md">
                  <label class="col-sm-2 control-label" for="profile_image">主页图片</label>
                  <div class="col-sm-10">
                    {if $smarty.session.user.homeimage != ''}
                    <img alt="{$smarty.session.user.username}" src="{$data_server}/uploads/users/{$smarty.session.user.user_id}/A_{$smarty.session.user.homeimage}" class="img-responsive homepage_image" />
                    {/if}
                    <div class="chosepic m-t-sm clearfix">
                      <input id="homepage_image" name="homepage_image" type="file" class="filestyle" data-icon="false" data-classButton="btn btn-default" data-classInput="form-control inline v-middle input-s">
                    </div>
                    <small class="text-grays">图片格式JPEG 图片尺寸900x500</small>
                  </div>
                </div>
                <div class="form-submit">
                  <div class="form-submit"><input type="hidden" name="change_avatar_image" value="yes" />
                    <button type="submit" class="btn btn-success btn-block">保存</button>
                  </div>
                </div>
              </fieldset>
            </form>
          </div>
          <script src="/assets/js/file-input/bootstrap-filestyle.min.js"></script>
        </div>

        <div class="panel b-a">
          <div class="panel-heading b-b">
            <p class="h3 h3-xs m-t-xs m-b-xs">你的社交应用</p>
          </div>
          <div id="social_networks" class="panel-body">
            <form class="horizontal-form disable-on-submit" action="" method="post">
              <div class="form-group clearfix">
                <label class="col-sm-2 control-label" for="weibo">
                  <img alt="新浪微博" src="{$template_data}img/custom/weibo.png" title="weibo" height="34" width="34">
                </label>
                <div class="col-sm-10">
                  <input id="weibo" class="form-control rounded" name="weibo" placeholder="http://新浪微博URL" value="{$smarty.post.weibo|escape}" type="text">
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-sm-2 control-label" for="weixin">
                  <img alt="腾讯微博" src="{$template_data}img/custom/weixin.png" title="weixin" height="34" width="34">
                </label>
                <div class="col-sm-10">
                  <input id="weixin" class="form-control rounded" name="weixin" placeholder="http://腾讯微博URL" value="{$smarty.post.weixin|escape}" type="text">
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-sm-2 control-label" for="baidu">
                  <img alt="百度空间" src="{$template_data}img/custom/baidu.png" title="baidu" height="34" width="34">
                </label>
                <div class="col-sm-10">
                  <input id="baidu" class="form-control rounded" name="baidu" placeholder="http://百度空间URL" value="{$smarty.post.baidu|escape}" type="text">
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-sm-2 control-label" for="netease">
                  <img alt="网易微博" src="{$template_data}img/custom/netease.png" title="netease" height="34" width="34">
                </label>
                <div class="col-sm-10">
                  <input id="netease" class="form-control rounded" name="netease" placeholder="http://网易微博URL" value="{$smarty.post.netease|escape}" type="text">
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-sm-2 control-label" for="sohu">
                  <img alt="搜狐微博" src="{$template_data}img/custom/sohu.png" title="sohu" height="34" width="34">
                </label>
                <div class="col-sm-10">
                  <input id="sohu" class="form-control rounded" name="sohu" placeholder="http://搜狐微博URL" value="{$smarty.post.sohu|escape}" type="text">
                </div>
              </div>
              <div class="form-group clearfix">
                <label class="col-sm-2 control-label" for="qq">
                  <img alt="人人空间" src="{$template_data}img/custom/qq.png" title="qq" height="34" width="34">
                </label>
                <div class="col-sm-10">
                  <input id="qq" class="form-control rounded" name="qq" placeholder="http://人人空间URL" value="{$smarty.post.qq|escape}" type="text">
                </div>
              </div>
              <div class="form-submit clearfix">
                <div class="form-submit"><input type="hidden" name="social_edit" value="yes" />
                  <button type="submit" class="btn btn-success btn-block">保存</button>
                </div>
              </div>
            </form>
          </div>

        </div>
        {if $smarty.session.user.quiz == 'true'}
        <div class="panel b-a">
          <div class="panel-heading b-b">
            <p class="h3 h3-xs m-t-xs m-b-xs">自荐作品</p>
          </div>
          <div id="profile" class="panel-body">
            <form class="horizontal-form disable-on-submit" action="" method="post">
              <fieldset>
                <div class="form-group clearfix">
                  <label class="col-sm-2 control-label" for="featured_items">选择作品</label>
                  <div class="col-sm-10">
                    <select name="featured_item_id" class="form-control rounded">
                      <option value="0">暂不自荐</option>
                      {if $items}
                      {foreach from=$items item=i}
                      <option value="{$i.id}" {if $i.id == $smarty.session.user.featured_item_id}selected="selected"{/if}>{$i.name}</option>
                      {/foreach}
                      {/if}
                    </select>
                  </div>
                </div>
                <div class="form-submit clearfix"><input type="hidden" name="feature_save" value="yes" />
                  <button id="personal_info_submit_button" class="btn btn-success btn-block" type="submit">保存</button>
                </div>
              </fieldset>
            </form>
          </div>

        </div>

        <div class="panel b-a">
          <div class="panel-heading b-b">
            <p class="h3 h3-xs m-t-sm">作品许可</p>
            <p class="m-t-sm text-grays">选择你所售作品的许可，请注意并非所有作品都适合全部许可，共享许可是必选项。</p>
          </div>
          <div id="item_licences" class="panel-body">
            <form action="" class="horizontal-form disable-on-submit" method="post">
              <fieldset>
                <div class="form-group clearfix">
                  <label class="col-sm-2 control-label">许可类型</label>
                  <div class="col-sm-10">
                    <label class="checkbox-inline i-checks" for="extended">
                      <input id="extended" name="license[extended]" type="checkbox" value="extended" {if isset($smarty.session.user.license.extended)}checked="checked"{/if} /><i></i> 专有许可
                    </label>
                    <label class="checkbox-inline i-checks" for="personal">
                      <input id="personal" name="license[personal]" type="checkbox" value="personal" {if isset($smarty.session.user.license.personal)}checked="checked"{/if} disabled><i></i> 共享许可
                    </label>
                  </div>
                </div>
              </fieldset>
              <div class="form-submit clearfix"><input type="hidden" name="save_license" value="yes" />
                <button type="submit" class="btn btn-success btn-block">保存</button>
              </div>
            </form>
          </div>

        </div>
        {/if}


      </div>
    </div>
  </div>
</section>

{include file="$template_path/html/user-footer.html"}
{literal}
<script type="text/javascript">
  seajs.use(["jq", "pageui"], function($, ui){
    ui.tabsinit($("#ziper").find("a"), $("#taber").find(".panel"), {"active": "active"});
  });
</script>
{/literal}
</body>
</html>