forked from jackfrued/Python-100-Days
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
9 changed files
with
130 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
venv | ||
.idea | ||
*.pyc | ||
__pycache__ | ||
|
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
from django.urls import path | ||
|
||
from hrs import views | ||
|
||
urlpatterns = [ | ||
path('depts', views.depts, name='depts'), | ||
path('depts/emps', views.emps, name='empsindept'), | ||
path('deldepts', views.del_dept, name='ddel') | ||
] |
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,60 @@ | ||
<!DOCTYPE html> | ||
{% load static %} | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>员工</title> | ||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="row clearfix"> | ||
<div class="col-md-12 column"> | ||
<h3>{{ dept_name }}员工信息</h3> | ||
<hr> | ||
</div> | ||
</div> | ||
<div class="row clearfix"> | ||
<div class="col-md-8 column"> | ||
{% if emp_list %} | ||
<table id="dept" class="table table-striped table-hover"> | ||
<thead> | ||
<tr> | ||
<th>编号</th> | ||
<th>姓名</th> | ||
<th>职位</th> | ||
<th>月薪</th> | ||
<th>部门名称</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for emp in emp_list %} | ||
<tr> | ||
<td>{{ emp.no }}</td> | ||
<td>{{ emp.name }}</td> | ||
<td>{{ emp.job }}</td> | ||
<td>{{ emp.sal }}</td> | ||
<td>{{ dept_name }}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% else %} | ||
<h2>此部门暂时没有员工!</h2> | ||
{% endif %} | ||
</div> | ||
<div class="col-md-4 column"> | ||
</div> | ||
</div> | ||
<a href="{% url 'depts' %}">返回部门列表</a> | ||
</div> | ||
<script src="{% static 'js/jquery.min.js' %}"></script> | ||
<script src="{% static 'js/bootstrap.min.js' %}"></script> | ||
<script> | ||
$(function() { | ||
$('#dept tbody tr:even').addClass('info'); | ||
$('#dept tbody tr:odd').addClass('warning'); | ||
}); | ||
</script> | ||
</body> | ||
</html> |