-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
廖扬扬
committed
Aug 28, 2018
1 parent
0aa7a0b
commit d18c404
Showing
15 changed files
with
739 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{% extends 'base/layout.html' %} | ||
{% block content %} | ||
|
||
|
||
<div class="wrapper wrapper-content"> | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
<div class="col-lg-12"> | ||
<div class="ibox float-e-margins"> | ||
<div class="ibox-title"> | ||
<h5>编辑用户信息</h5> | ||
|
||
</div> | ||
<div class="ibox-content"> | ||
<form action="/account/edituser" class="form-horizontal" enctype="multipart/form-data" method="post" > | ||
|
||
<input type="hidden" name="id" value="{{ user_info.id }}"> | ||
<div class="form-group"> | ||
<label class="col-lg-2 control-label">id:</label> | ||
<div class="col-lg-6"><input type="text" name="id" class="form-control" value="{{ user_info.id }}" disabled></div> | ||
</div> | ||
<div class="hr-line-dashed" ></div> | ||
<div class="form-group"> | ||
<label class="col-lg-2 control-label">用户名:</label> | ||
<div class="col-lg-6"><input type="text" name="username" class="form-control" value="{{ user_info.username }}" disabled></div> | ||
</div> | ||
<div class="hr-line-dashed" ></div> | ||
<div class="form-group"> | ||
<label class="col-lg-2 control-label">EMAIL:</label> | ||
<div class="col-lg-6"><input type="text" name="email" class="form-control" value="{{ user_info.email }}" ></div> | ||
</div> | ||
<div class="hr-line-dashed" ></div> | ||
<div class="form-group"> | ||
<label class="col-lg-2 control-label">角色:</label> | ||
<div class="col-lg-6"> | ||
<select name="role_id" class="form-control"> | ||
{% if user_info.role_id %} | ||
<option value="{{user_info.role_id}}">{% if user_info.role_id ==1 %}普通用户{% else %}管理员{% endif %}</option> | ||
<option value="1">普通用户</option> | ||
<option value="2">管理员</option> | ||
{% else %} | ||
<option value="">请选择</option> | ||
<option value="1">普通用户</option> | ||
<option value="2">管理员</option> | ||
{% endif %} | ||
</select> | ||
</div> | ||
</div> | ||
<div class="hr-line-dashed" ></div> | ||
<div class="form-group"> | ||
<div class="col-lg-2"> | ||
</div> | ||
<div class="col-lg-4"> | ||
<button type="submit" class="btn btn-primary" >保存</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<!--第四课内容 --> | ||
{% extends 'base/layout.html' %} | ||
|
||
<!--第四课内容 下面是正文--> | ||
{% block content %} | ||
<div class="wrapper wrapper-content"> | ||
<div class="row"> | ||
<div class="col-lg-12"> | ||
<div class="ibox float-e-margins"> | ||
<div class="ibox-title"> | ||
<h5>{{tag}}</h5> | ||
</div> | ||
<div class="ibox-content"> | ||
<div class="row"> | ||
|
||
<div class="table-responsive"> | ||
<table class="table table-striped table-bordered table-hover dataTables-example"> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>用户名</th> | ||
<th>Email</th> | ||
<th>角色</th> | ||
<th>操作</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% if current_user.role_id == 2 %} | ||
{% for user in users %} | ||
<tr> | ||
<td>{{user.id}}</td> | ||
<td>{{user.username}}</td> | ||
<td>{{user.email}}</td> | ||
<td>{{user.role.name}}</td> | ||
<td><a href="">修改密码</a> | <a href="/account/edituser?id={{user.id}}">编辑</a> | <a href="/account/deluser?id={{user.id}}">删除</a></td> | ||
</tr> | ||
{% endfor %} | ||
{% else %} | ||
{% for user in users %} | ||
{% if user.id == current_user.id %} | ||
<tr> | ||
<td>{{user.id}}</td> | ||
<td>{{user.username}}</td> | ||
<td>{{user.email}}</td> | ||
<td>{{user.role.name}}</td> | ||
<td><a href="">修改密码</a></td> | ||
</tr> | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
$(document).ready(function() { | ||
$('.dataTables-example').DataTable({ | ||
dom: '<"html5buttons"B>lTfgitp', | ||
buttons: [ | ||
{ extend: 'copy'}, | ||
{extend: 'csv'}, | ||
{extend: 'excel', title: 'ExampleFile'}, | ||
{extend: 'pdf', title: 'ExampleFile'}, | ||
|
||
{extend: 'print', | ||
customize: function (win){ | ||
$(win.document.body).addClass('white-bg'); | ||
$(win.document.body).css('font-size', '10px'); | ||
|
||
$(win.document.body).find('table') | ||
.addClass('compact') | ||
.css('font-size', 'inherit'); | ||
} | ||
} | ||
] | ||
}); | ||
}) | ||
|
||
|
||
</script> | ||
|
||
|
||
{% endblock %} | ||
|
||
|
Oops, something went wrong.