Merge branch 'master' of 10.7.100.160:/job/safesite
This commit is contained in:
commit
5c3d5b204f
|
@ -1,4 +1,4 @@
|
|||
from django.contrib import admin
|
||||
from . import models
|
||||
# Register your models here.
|
||||
admin.site.register(models.Groups)
|
||||
admin.site.register(models.Groups)
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
from django import forms
|
||||
from captcha.fields import CaptchaField
|
||||
|
||||
class GroupsForm(forms.Form):
|
||||
username = forms.CharField(label="用户名", max_length=128, widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': "Username",'autofocus': ''}))
|
||||
password = forms.CharField(label="密码", max_length=256, widget=forms.PasswordInput(attrs={'class': 'form-control','placeholder': "Password"}))
|
||||
captcha = CaptchaField(label='验证码', error_messages={"invalid":"验证码错误"})
|
Binary file not shown.
After Width: | Height: | Size: 465 B |
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
|
@ -0,0 +1,41 @@
|
|||
body {
|
||||
height: 100%;
|
||||
background-image: url('../images/pic1.jpg');
|
||||
}
|
||||
.form-login {
|
||||
width: 100%;
|
||||
max-width: 330px;
|
||||
padding: 15px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.form-login{
|
||||
margin-top:80px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.form-login .form-control {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
|
||||
}
|
||||
.form-login .form-control:focus {
|
||||
z-index: 2;
|
||||
}
|
||||
.form-login input[type="text"] {
|
||||
margin-bottom: -1px;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.form-login input[type="password"] {
|
||||
margin-bottom: 10px;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
}
|
||||
form a{
|
||||
display: inline-block;
|
||||
margin-top:25px;
|
||||
font-size: 12px;
|
||||
line-height: 10px;
|
||||
}
|
|
@ -0,0 +1,210 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{% load static %}
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{% block title %} title {% endblock %}</title>
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<link rel="stylesheet" href="{% static 'groups/bower_components/bootstrap/dist/css/bootstrap.min.css' %}">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="{% static 'groups/bower_components/font-awesome/css/font-awesome.min.css' %}">
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="{% static 'groups/bower_components/Ionicons/css/ionicons.min.css' %}">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="{% static 'groups/dist/css/AdminLTE.min.css' %}">
|
||||
<!-- AdminLTE Skins. Choose a skin from the css/skins
|
||||
folder instead of downloading all of them to reduce the load. -->
|
||||
<link rel="stylesheet" href="{% static 'groups/dist/css/skins/_all-skins.min.css' %}">
|
||||
<!-- Morris chart -->
|
||||
<link rel="stylesheet" href="{% static 'groups/bower_components/morris.js/morris.css' %}">
|
||||
<!-- jvectormap -->
|
||||
<link rel="stylesheet" href="{% static 'groups/bower_components/jvectormap/jquery-jvectormap.css' %}">
|
||||
<!-- Date Picker -->
|
||||
<link rel="stylesheet" href="{% static 'groups/bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css' %}">
|
||||
<!-- Daterange picker -->
|
||||
<link rel="stylesheet" href="{% static 'groups/bower_components/bootstrap-daterangepicker/daterangepicker.css' %}">
|
||||
<!-- bootstrap wysihtml5 - text editor -->
|
||||
<link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Google Font -->
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
|
||||
<header class="main-header">
|
||||
<!-- Logo -->
|
||||
<a href="index2.html" class="logo">
|
||||
<!-- mini logo for sidebar mini 50x50 pixels -->
|
||||
<span class="logo-mini"></span>
|
||||
<!-- logo for regular state and mobile devices -->
|
||||
<span class="logo-lg"><b>集团后台</b></span>
|
||||
</a>
|
||||
<!-- Header Navbar: style can be found in header.less -->
|
||||
<nav class="navbar navbar-static-top">
|
||||
<!-- Sidebar toggle button-->
|
||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="hidden-xs">{{ request.session.user_name }}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<div class="pull-right">
|
||||
<a href="{% url 'groups_logout' %}" class="btn btn-default btn-flat">退出</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<!-- Left side column. contains the logo and sidebar -->
|
||||
<aside class="main-sidebar">
|
||||
<!-- sidebar: style can be found in sidebar.less -->
|
||||
<section class="sidebar">
|
||||
<!-- Sidebar user panel -->
|
||||
<div class="user-panel">
|
||||
<div class="pull-left image">
|
||||
<img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
|
||||
</div>
|
||||
<div class="pull-left info">
|
||||
<p>{{ request.session.user_name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- sidebar menu: : style can be found in sidebar.less -->
|
||||
<ul class="sidebar-menu" data-widget="tree">
|
||||
<li class="header">导航</li>
|
||||
<li>
|
||||
<a href="{% url 'groups_index' %}">
|
||||
<i class="fa fa-th"></i> <span>主页</span>
|
||||
<span class="pull-right-container">
|
||||
<small class="label pull-right bg-green"></small>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'groups_company' %}">
|
||||
<i class="fa fa-th"></i> <span>公司列表</span>
|
||||
<span class="pull-right-container">
|
||||
<small class="label pull-right bg-green"></small>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-pie-chart"></i>
|
||||
<span>统计信息</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li><a href="{% url 'groups_job' %}"><i class="fa fa-circle-o"></i> 作业</a></li>
|
||||
<li><a href="{% url 'groups_job' %}"><i class="fa fa-circle-o"></i> 行为</a></li>
|
||||
<li><a href="{% url 'groups_job' %}"><i class="fa fa-circle-o"></i> 未遂</a></li>
|
||||
<li><a href="{% url 'groups_job' %}"><i class="fa fa-circle-o"></i> 风险</a></li>
|
||||
<li><a href="{% url 'groups_job' %}"><i class="fa fa-circle-o"></i> 培训</a></li>
|
||||
<li><a href="{% url 'groups_job' %}"><i class="fa fa-circle-o"></i> 考试</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
Dashboard
|
||||
<small>Control panel</small>
|
||||
</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
|
||||
<li class="active">Dashboard</li>
|
||||
</ol>
|
||||
</section>
|
||||
|
||||
{% block content %}
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<h3>content</h3>
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
{% endblock %}
|
||||
</div>
|
||||
<!-- /.content-wrapper -->
|
||||
<footer class="main-footer">
|
||||
<div class="pull-right hidden-xs">
|
||||
<b>Version</b> 2.4.18
|
||||
</div>
|
||||
<strong>Copyright © 2014-2019 <a href="https://adminlte.io">AdminLTeeeeeeeeeeE</a>.</strong> All rights
|
||||
reserved.
|
||||
</footer>
|
||||
|
||||
<!-- Add the sidebar's background. This div must be placed
|
||||
immediately after the control sidebar -->
|
||||
<div class="control-sidebar-bg"></div>
|
||||
</div>
|
||||
<!-- ./wrapper -->
|
||||
|
||||
<!-- jQuery 3 -->
|
||||
<script src="{% static 'groups/bower_components/jquery/dist/jquery.min.js' %}"></script>
|
||||
<!-- jQuery UI 1.11.4 -->
|
||||
<script src="{% static 'groups/bower_components/jquery-ui/jquery-ui.min.js' %}"></script>
|
||||
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
|
||||
<script>
|
||||
$.widget.bridge('uibutton', $.ui.button);
|
||||
</script>
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<script src="{% static 'groups/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
|
||||
<!-- Morris.js charts -->
|
||||
<script src="{% static 'groups/bower_components/raphael/raphael.min.js' %}"></script>
|
||||
<script src="{% static 'groups/bower_components/morris.js/morris.min.js' %}"></script>
|
||||
<!-- Sparkline -->
|
||||
<script src="{% static 'groups/bower_components/jquery-sparkline/dist/jquery.sparkline.min.js' %}"></script>
|
||||
<!-- jvectormap -->
|
||||
<script src="{% static 'groups/plugins/jvectormap/jquery-jvectormap-1.2.2.min.js' %}"></script>
|
||||
<script src="{% static 'groups/plugins/jvectormap/jquery-jvectormap-world-mill-en.js' %}"></script>
|
||||
<!-- jQuery Knob Chart -->
|
||||
<script src="{% static 'groups/bower_components/jquery-knob/dist/jquery.knob.min.js' %}"></script>
|
||||
<!-- daterangepicker -->
|
||||
<script src="{% static 'groups/bower_components/moment/min/moment.min.js' %}"></script>
|
||||
<script src="{% static 'groups/bower_components/bootstrap-daterangepicker/daterangepicker.js' %}"></script>
|
||||
<!-- datepicker -->
|
||||
<script src="{% static 'groups/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js' %}"></script>
|
||||
<!-- Bootstrap WYSIHTML5 -->
|
||||
<script src="{% static 'groups/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js' %}"></script>
|
||||
<!-- Slimscroll -->
|
||||
<script src="{% static 'groups/bower_components/jquery-slimscroll/jquery.slimscroll.min.js' %}"></script>
|
||||
<!-- FastClick -->
|
||||
<script src="{% static 'groups/bower_components/fastclick/lib/fastclick.js' %}"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="{% static 'groups/dist/js/adminlte.min.js' %}"></script>
|
||||
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
|
||||
<script src="{% static 'groups/dist/js/pages/dashboard.js' %}"></script>
|
||||
<!-- AdminLTE for demo purposes -->
|
||||
<script src="{% static 'groups/dist/js/demo.js' %}"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,56 @@
|
|||
{% extends "./base.html" %}
|
||||
|
||||
{% block title %}company list{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<!-- /.box -->
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Data Table With Full Features</h3>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div id="example1_wrapper" class="dataTables_wrapper form-inline dt-bootstrap"><div class="row"><div class="col-sm-6"><div class="dataTables_length" id="example1_length"><label>Show <select name="example1_length" aria-controls="example1" class="form-control input-sm"><option value="10">10</option><option value="25">25</option><option value="50">50</option><option value="100">100</option></select> entries</label></div></div><div class="col-sm-6"><div id="example1_filter" class="dataTables_filter"><label>Search:<input type="search" class="form-control input-sm" placeholder="" aria-controls="example1"></label></div></div></div><div class="row"><div class="col-sm-12"><table id="example1" class="table table-bordered table-striped dataTable" role="grid" aria-describedby="example1_info">
|
||||
<thead>
|
||||
<tr role="row"><th class="sorting_asc" tabindex="0" aria-controls="example1" rowspan="1" colspan="1" style="width: 164.933px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">Rendering engine</th><th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1" style="width: 204.15px;" aria-label="Browser: activate to sort column ascending">Browser</th><th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1" style="width: 179.933px;" aria-label="Platform(s): activate to sort column ascending">Platform(s)</th><th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1" style="width: 140.467px;" aria-label="Engine version: activate to sort column ascending">Engine version</th><th class="sorting" tabindex="0" aria-controls="example1" rowspan="1" colspan="1" style="width: 99.1833px;" aria-label="CSS grade: activate to sort column ascending">CSS grade</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr role="row" class="odd">
|
||||
<td class="sorting_1">Gecko</td>
|
||||
<td>Firefox 1.0</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td>1.7</td>
|
||||
<td>A</td>
|
||||
</tr><tr role="row" class="even">
|
||||
<td class="sorting_1">Gecko</td>
|
||||
<td>Camino 1.5</td>
|
||||
<td>OSX.3+</td>
|
||||
<td>1.8</td>
|
||||
<td>A</td>
|
||||
</tr><tr role="row" class="even">
|
||||
<td class="sorting_1">Gecko</td>
|
||||
<td>Mozilla 1.0</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td>1</td>
|
||||
<td>A</td>
|
||||
</tr></tbody>
|
||||
<tfoot>
|
||||
<tr><th rowspan="1" colspan="1">Rendering engine</th><th rowspan="1" colspan="1">Browser</th><th rowspan="1" colspan="1">Platform(s)</th><th rowspan="1" colspan="1">Engine version</th><th rowspan="1" colspan="1">CSS grade</th></tr>
|
||||
</tfoot>
|
||||
</table></div></div><div class="row"><div class="col-sm-5"><div class="dataTables_info" id="example1_info" role="status" aria-live="polite">Showing 1 to 10 of 57 entries</div></div><div class="col-sm-7"><div class="dataTables_paginate paging_simple_numbers" id="example1_paginate"><ul class="pagination"><li class="paginate_button previous disabled" id="example1_previous"><a href="#" aria-controls="example1" data-dt-idx="0" tabindex="0">Previous</a></li><li class="paginate_button active"><a href="#" aria-controls="example1" data-dt-idx="1" tabindex="0">1</a></li><li class="paginate_button "><a href="#" aria-controls="example1" data-dt-idx="2" tabindex="0">2</a></li><li class="paginate_button "><a href="#" aria-controls="example1" data-dt-idx="3" tabindex="0">3</a></li><li class="paginate_button "><a href="#" aria-controls="example1" data-dt-idx="4" tabindex="0">4</a></li><li class="paginate_button "><a href="#" aria-controls="example1" data-dt-idx="5" tabindex="0">5</a></li><li class="paginate_button "><a href="#" aria-controls="example1" data-dt-idx="6" tabindex="0">6</a></li><li class="paginate_button next" id="example1_next"><a href="#" aria-controls="example1" data-dt-idx="7" tabindex="0">Next</a></li></ul></div></div></div></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
<!-- /.col -->
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
{% endblock %}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,98 @@
|
|||
{% extends "./base.html" %}
|
||||
|
||||
{% block title %}jobs{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="callout callout-warning">
|
||||
<h4>Warning!</h4>
|
||||
|
||||
<p><b>Morris.js</b> charts are no longer maintained by its author. We would recommend using any of the other
|
||||
charts that come with the template.</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<!-- AREA CHART -->
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Area Chart</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body chart-responsive">
|
||||
<div class="chart" id="revenue-chart" style="height: 300px;"></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
|
||||
<!-- DONUT CHART -->
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Donut Chart</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body chart-responsive">
|
||||
<div class="chart" id="sales-chart" style="height: 300px; position: relative;"></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
|
||||
</div>
|
||||
<!-- /.col (LEFT) -->
|
||||
<div class="col-md-6">
|
||||
<!-- LINE CHART -->
|
||||
<div class="box box-info">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Line Chart</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body chart-responsive">
|
||||
<div class="chart" id="line-chart" style="height: 300px;"></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
|
||||
<!-- BAR CHART -->
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Bar Chart</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body chart-responsive">
|
||||
<div class="chart" id="bar-chart" style="height: 300px;"></div>
|
||||
</div>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
|
||||
</div>
|
||||
<!-- /.col (RIGHT) -->
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
{% endblock %}
|
|
@ -0,0 +1,66 @@
|
|||
{% load static %}
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<!-- 上述meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="{% static 'groups/bower_components/bootstrap/dist/css/bootstrap.min.css' %}" rel="stylesheet"/>
|
||||
<link href="{% static 'groups/login/login.css' %}" rel="stylesheet"/>
|
||||
<title>登录</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="col">
|
||||
<form class="form-login" action="/groups/login/" method="post">
|
||||
{% if groups_form.captcha.errors %}
|
||||
<div class="alert alert-warning">{{ groups_form.captcha.error_messages }}</div>
|
||||
{% elif message %}
|
||||
<div class="alert alert-warning">{{ message }}</div>
|
||||
{% endif %}
|
||||
{% csrf_token %}
|
||||
<h3 class="text-center">欢迎登录</h3>
|
||||
<div class="form-group">
|
||||
{{ groups_form.username.label_tag }}
|
||||
{{ groups_form.username}}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ groups_form.password.label_tag }}
|
||||
{{ groups_form.password }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
{{ groups_form.captcha.label_tag }}
|
||||
{{ groups_form.captcha }}
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" class="btn btn-primary float-right">登录</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div> <!-- /container -->
|
||||
|
||||
<!-- Optional JavaScript -->
|
||||
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
|
||||
<script src="{% static 'groups/bower_components/jquery/dist/jquery.js' %}"></script>
|
||||
<script src="https://cdn.bootcss.com/popper.js/1.15.0/umd/popper.js"></script>
|
||||
<script src="{% static 'groups/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<script>
|
||||
$(function(){
|
||||
$('#id_captcha_1').addClass('form-control');
|
||||
<<<<<<< HEAD
|
||||
})
|
||||
=======
|
||||
});
|
||||
>>>>>>> dev
|
||||
$('.captcha').click(function () {
|
||||
$.getJSON("/groups/refresh_captcha/", function (result) {
|
||||
$('.captcha').attr('src', result['image_url']);
|
||||
$('#id_captcha_0').val(result['key'])
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -1,6 +1,14 @@
|
|||
from django.urls import path
|
||||
from django.urls import include
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.index, name='index'),
|
||||
path('', views.index, name='groups_index'),
|
||||
path('index/', views.index, name='groups_index'),
|
||||
path('login/', views.login, name='groups_login'),
|
||||
path('logout/', views.logout, name='groups_logout'),
|
||||
path('captcha/', include('captcha.urls')),
|
||||
path('company/', views.company, name='groups_company'),
|
||||
path('job/', views.job, name='groups_job'),
|
||||
path('refresh_captcha/', views.refresh_captcha),
|
||||
]
|
|
@ -1,8 +1,62 @@
|
|||
from django.http import HttpResponse
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import redirect
|
||||
from .models import Groups
|
||||
from .forms import GroupsForm
|
||||
|
||||
|
||||
|
||||
def index(request):
|
||||
#latest_question_list = Question.objects.order_by('-pub_date')[:5]
|
||||
if not request.session.get('is_login', None):
|
||||
return redirect('/groups/login/')
|
||||
return render(request, 'groups/index.html')
|
||||
|
||||
def login(request):
|
||||
# 不允许重复登录
|
||||
if request.session.get('is_login', None):
|
||||
return redirect('/groups/index/')
|
||||
if request.method == "POST":
|
||||
groups_form = GroupsForm(request.POST)
|
||||
message = '请检查填写的内容!'
|
||||
if groups_form.is_valid():
|
||||
username = groups_form.cleaned_data.get('username')
|
||||
password = groups_form.cleaned_data.get('password')
|
||||
|
||||
try:
|
||||
user = Groups.objects.get(name=username)
|
||||
except:
|
||||
message = '用户不存在!'
|
||||
return render(request, 'groups/login.html', locals())
|
||||
if user.password == password:
|
||||
request.session['is_login'] = True
|
||||
request.session['user_id'] = user.id
|
||||
request.session['user_name'] = user.name
|
||||
return redirect('/groups/index/')
|
||||
else:
|
||||
message = '密码不正确!'
|
||||
return render(request, 'groups/login.html', locals())
|
||||
else:
|
||||
return render(request, 'groups/login.html', locals())
|
||||
groups_form = GroupsForm()
|
||||
return render(request, 'groups/login.html', locals())
|
||||
|
||||
def logout(request):
|
||||
if not request.session.get('is_login', None):
|
||||
return redirect('/groups/login')
|
||||
request.session.flush()
|
||||
return redirect('/groups/login')
|
||||
|
||||
import json
|
||||
from captcha.models import CaptchaStore
|
||||
from captcha.helpers import captcha_image_url
|
||||
def refresh_captcha(request):
|
||||
hashkey = CaptchaStore.generate_key()
|
||||
image_url = captcha_image_url(hashkey)
|
||||
return HttpResponse(json.dumps({'key': hashkey, 'image_url': image_url}), content_type='application/json')
|
||||
|
||||
|
||||
def company(request):
|
||||
return render(request, 'groups/company.html', locals())
|
||||
|
||||
def job(request):
|
||||
return render(request, 'groups/job.html', locals())
|
||||
|
|
|
@ -39,6 +39,7 @@ INSTALLED_APPS = [
|
|||
'django.contrib.staticfiles',
|
||||
'safesite',
|
||||
'groups',
|
||||
'captcha',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
# Generated by Django 2.1.4 on 2019-09-12 15:10
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0264_auto_20190909_0916'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CompanyInfo',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=64, verbose_name='公司名称')),
|
||||
('nature', models.SmallIntegerField(choices=[(0, '国企'), (1, '私企')], default=0, verbose_name='企业性质')),
|
||||
('address', models.CharField(max_length=128, verbose_name='公司地址')),
|
||||
('fixed_assets', models.IntegerField(blank=True, null=True, verbose_name='固定资产')),
|
||||
('website', models.CharField(blank=True, max_length=64, null=True, verbose_name='公司网址')),
|
||||
('peoplenum', models.IntegerField(blank=True, null=True, verbose_name='公司人数')),
|
||||
('legalperson', models.CharField(blank=True, max_length=24, null=True, verbose_name='法人代表')),
|
||||
('legalperson_phone', models.CharField(blank=True, max_length=24, null=True, verbose_name='法人电话')),
|
||||
('liaison', models.CharField(max_length=24, verbose_name='联系人')),
|
||||
('liaison_phone', models.CharField(max_length=24, verbose_name='联系人电话')),
|
||||
('liaison_fax', models.CharField(blank=True, max_length=10, null=True, verbose_name='联系人传真')),
|
||||
('introduce', models.TextField(blank=True, null=True, verbose_name='公司概况')),
|
||||
('createtime', models.DateTimeField(auto_now_add=True)),
|
||||
('modifytime', models.DateTimeField(auto_now=True)),
|
||||
('partment', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='safesite.Partment', verbose_name='公司ID')),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -0,0 +1,15 @@
|
|||
# Generated by Django 2.1.4 on 2019-10-09 09:52
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0265_auto_20190917_1716'),
|
||||
('safesite', '0267_auto_20190917_1543'),
|
||||
('safesite', '0265_companyinfo'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
Loading…
Reference in New Issue