Merge branch 'dev' into virusdefender-dev

* dev:
  [前端] 修改announcement模块轻微问题 1. 去掉翻页函数多余的参数 2.去掉新增公告刷新函数调用时多传的参数 3.去掉模板空的style标签 [CI SKIP]
  [功能] 新增公告管理模块,对GET users API轻微修改,筛管理员添加超级管理员包含
  修改了用户编辑密码时,密码是否编辑的两个测试用例
  admin/views里里面的typo
  修复合并后的冲突
  创建account的数据库migration
  修复announcement js中作用域的问题
  并没有改动。。。。     [CI SKIP]
  [后端]修改后端公告GET接口,增加返回公告总条数,总页数
  [前端-公告管理]增加仅显示可见公告功能,统一数据获取方法
  后台页面小bug修复
This commit is contained in:
virusdefender
2015-08-08 22:44:30 +08:00
14 changed files with 484 additions and 96 deletions

View File

@@ -97,13 +97,20 @@
<li class="list-group-item" id="li-contest-add_contest">
<a href="#contest/add_contest">创建比赛</a>
</li>
<li class="list-group-header">用户管理</li>
<li class="list-group-item" id="li-user-user_list">
<a href="#user/user_list">用户列表</a>
</li>
<li class="list-group-item" id="li-user-user_group">
<a href="#user/user_group">用户分组</a>
</li>
</ul>
</div>
<!-- admin left end -->
<img src="/static/img/loading.gif" id="loading-gif">
<!-- custom body begin -->
<div class='col-md-8' ms-include-src="template_url" data-include-rendered="hide_loading"></div>
<div ms-include-src="template_url" data-include-rendered="hide_loading"></div>
<!-- custom body end -->
</div>

View File

@@ -0,0 +1,65 @@
<div ms-controller="announcement" class="col-md-9">
<h1>Announcement</h1>
<table class="table table-striped">
<tr>
<th>编号</th>
<th>标题</th>
<th>创建时间</th>
<th>更新时间</th>
<th>创建者</th>
<th>状态</th>
<th>操作</th>
</tr>
<tr ms-repeat="announcement">
<td>{{el.id}}</td>
<td>{{el.title}}</td>
<td>{{el.create_time|date("yyyy-MM-dd HH:mm:ss")}}</td>
<td>{{el.last_update_time|date("yyyy-MM-dd HH:mm:ss")}}</td>
<td>{{el.created_by.username}}</td>
<td>{{getState(el)}}</td>
<td>
<button class="btn-sm btn-info" ms-click="enEdit(el)">编辑</button>
</td>
</tr>
</table>
<div class="form-group">
<label>仅显示可见 <input ms-duplex-checked="visableOnly" type="checkbox"/></label>
</div>
<div class="text-right">
页数:{{page}}/{{page_count}}&nbsp;&nbsp;
<botton ms-attr-class="getBtnClass(0)" ms-click="getPrevious">上一页</botton>
<botton ms-attr-class="getBtnClass(1)" ms-click="getNext">下一页</botton>
</div>
<div ms-visible="isEditing">
<h3>编辑公告</h3>
<div class="form-group"><label for="title">标题</label>
<input name="title" type="text" class="form-control" id="newTitle" placeholder="公告标题" value=""></div>
<div class="form-group">
<label>内容</label>
<textarea id="editAnnouncementEditor"></textarea>
</div>
<div class="form-group">
<label>可见 <input ms-duplex-checked="announcementVisible" type="checkbox"/></label>
</div>
<div class="form-group">
<button ms-click="submitChange()" class="btn btn-primary">提交</button>
&nbsp;&nbsp;
<button ms-click="disEdit()" class="btn btn-danger">取消</button>
</div>
</div>
<h3>添加公告</h3>
<form id="announcement-form">
<div class="form-group"><label for="title">标题</label>
<input name="title" type="text" class="form-control" id="title" placeholder="公告标题"></div>
<div class="form-group">
<label>内容</label>
<textarea id="editor" placeholder="公告内容"></textarea>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">提交</button>
</div>
</form>
</div>
<script src="/static/js/app/admin/announcement/announcement.js"></script>

View File

@@ -1,6 +1,4 @@
<div ms-controller="add_contest">
<form id="add-contest-form">
<div class="col-md-9">
<div class="col-md-12">

View File

@@ -0,0 +1,79 @@
<div ms-controller="user_list" class="col-md-9">
<h1>User</h1>
<div class="text-right">
<form class="form-inline" onsubmit="return false;">
<div class="form-group-sm">
<label>搜索</label>
<input name="keyWord" class="form-control" placeholder="请输入关键词" ms-duplex="key_word">
<input type="submit" value="搜索" class="btn btn-primary" ms-click="getPage(1)">
</div>
</form>
<br>
</div>
<table class="table table-striped">
<tr>
<th>ID</th>
<th>用户名</th>
<th>注册时间</th>
<th>最近登陆</th>
<th>真实姓名</th>
<th>电子邮箱</th>
<th>用户类型</th>
<th>修改</th>
</tr>
<tr ms-repeat="user_list">
<td>{{el.id}}</td>
<td>{{el.username}}</td>
<td>{{el.create_time|date("yyyy-MM-dd HH:mm:ss")}}</td>
<td>{{el.last_login|date("yyyy-MM-dd HH:mm:ss")}}</td>
<td>{{el.real_name}}</td>
<td>{{el.email}}</td>
<td>{{user_type[el.admin_type]}}</td>
<td>
<button class="btn-sm btn-info" ms-click="enEdit(el)">编辑</button>
</td>
</tr>
</table>
<div class="form-group">
<label>仅显示管理员 <input ms-duplex-checked="showAdminOnly" type="checkbox"/></label>
</div>
<div class="text-right">
页数:{{page}}/{{page_count}}&nbsp;&nbsp;
<botton ms-attr-class="getBtnClass(0)" ms-click="getPrevious">上一页</botton>
<botton ms-attr-class="getBtnClass(1)" ms-click="getNext">下一页</botton>
</div>
<div ms-visible="isEditing">
<h3>修改用户信息</h3>
<form id="edit_user-form">
<div class="row">
<div class="form-group col-md-4"><label>ID</label>
<input name="id" type="number" class="form-control" readonly ms-duplex="id">
</div>
<div class="form-group col-md-4"><label>用户名</label>
<input name="username" type="text" class="form-control" ms-duplex="username">
</div>
<div class="form-group col-md-4"><label>真实姓名</label>
<input name="real_name" type="text" class="form-control" ms-duplex="real_name">
</div>
</div>
<div class="row">
<div class="form-group col-md-4"><label>新密码(留空则保留原密码)</label>
<input name="password" type="password" class="form-control" id="password" ms-duplex="password"
placeholder="此项留空则保留原密码">
</div>
<div class="form-group col-md-4"><label>电子邮箱</label>
<input name="email" type="email" class="form-control" ms-duplex="email">
</div>
<div class="form-group col-md-4"><label>用户类型</label>
<select name="admin_type" class="form-control" ms-duplex="admin_type">
<option ms-repeat="user_type" ms-attr-value="$index">{{el}}</option>
</select>
</div>
</div>
<div class="form-group">
<button type="sbumit" class="btn btn-primary">提交</button>
</div>
</form>
</div>
</div>
<script src="/static/js/app/admin/user/user_list.js"></script>