diff --git a/smash/web/models.py b/smash/web/models.py index bd76a27ea2a10549213fdcee844933e1e5e3f273..9b33e4d891102199dec1704b9117db17f33fd185 100644 --- a/smash/web/models.py +++ b/smash/web/models.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.db import models from django.utils import timezone -from django.contrib.auth.models import User +from django.contrib.auth.models import User, AnonymousUser import datetime @@ -236,7 +236,11 @@ class Worker (models.Model): @staticmethod def get_details(the_user): + if the_user.is_authenticated == False: + return ('Guest', 'Test account') + person = Worker.objects.filter(user=the_user) + if len(person) == 0: return ('Guest', 'Test account') else: diff --git a/smash/web/templates/_base.html b/smash/web/templates/_base.html index b105fb84d44843e3c75033590fd64a61d34d0cdd..17b58ca0f95ed302442f5509c89ab4247c4ab2c0 100644 --- a/smash/web/templates/_base.html +++ b/smash/web/templates/_base.html @@ -258,6 +258,13 @@ desired effect </a> </li> + <li data-desc="visits"> + <a href="{% url 'web.views.visits' %}"> + <i class="fa fa-id-card-o"></i> + <span>Visits</span> + </a> + </li> + <li data-desc="assignments"> <a href="{% url 'web.views.assignments' %}"> <i class="fa fa-calendar"></i> @@ -336,13 +343,14 @@ desired effect <footer class="main-footer"> {% block footer %} <!-- To the right --> - <div class="pull-right hidden-xs"> + <!--<div class="pull-right hidden-xs"> - - </div> + </div>--> + <!-- Default to the left --> - Footer text (eg. <small> + 2017, Parkinson Research Clinic <!--(eg. <small> <strong>Copyright © 2016 <a href="#">Company</a>.</strong> All rights reserved. - </small>) + </small>)--> {% endblock footer %} </footer> diff --git a/smash/web/templates/equipment_and_rooms/index.html b/smash/web/templates/equipment_and_rooms/index.html index df28518d1d661e400d8e57b59bcadc7a2ab962f0..286d3775d0692276a4660214813bb9a6a701e281 100644 --- a/smash/web/templates/equipment_and_rooms/index.html +++ b/smash/web/templates/equipment_and_rooms/index.html @@ -10,6 +10,23 @@ {% endblock breadcrumb %} {% block maincontent %} +<div class="box box-danger box-solid"> + <div class="box-header with-border"> + <h3 class="box-title">Not yet implemented</h3> + + <div class="box-tools pull-right"> + <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button> + </div> + <!-- /.box-tools --> + </div> + <!-- /.box-header --> + <div class="box-body"> + This is only a static page to show, how the system would look like. + Any changes to the system (eg. adding new flying team, modifying list of visit types) can be made by the administrator in the administration panel. + </div> + <!-- /.box-body --> +</div> + <div class="row"> <div class="col-md-3"> <div class="bg-red-active small-box"> diff --git a/smash/web/templates/login.html b/smash/web/templates/login.html index b6f8aa220bc29639c585fe91fd23ffbba950c781..1cdc90f5f1873ce649bce6ae8e710345fdb4838a 100644 --- a/smash/web/templates/login.html +++ b/smash/web/templates/login.html @@ -6,21 +6,21 @@ <title>Scheduling System | Log in</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"> - {% block styles %} + {% block styles %} <!-- Bootstrap 3.3.6 --> <link rel="stylesheet" href="{% static 'AdminLTE/css/bootstrap.min.css' %}"> - + <!-- Font Awesome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> - + <!-- Ionicons --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css"> - + <!-- Theme style --> <link rel="stylesheet" href="{% static 'AdminLTE/css/AdminLTE.min.css' %}"> - + <link rel="stylesheet" href="{% static 'AdminLTE/css/skins/skin-green.min.css' %}"> - + <!-- iCheck --> <link rel="stylesheet" href="{% static 'AdminLTE/plugins/iCheck/square/blue.css' %}"> @@ -29,7 +29,7 @@ <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]--> - + <style> .login-logo-h5 { margin-top: -10px; @@ -48,7 +48,7 @@ <h5 class="login-logo-h5">(Smart Scheduling)</h5> </div> <!-- /.login-logo --> - + {% if state == "logout" %} <div class="callout callout-info"> <h4>Success!</h4> @@ -70,14 +70,14 @@ {% else %} <hr /> {% endif %} - + <p class="login-box-msg">Please sign in</p> <form action="{% url 'web.views.login' %}" method="post"> {% csrf_token %} - + <div class="form-group has-feedback"> - <input type="text" name="username" class="form-control" placeholder="E-mail"> + <input type="text" name="username" class="form-control" placeholder="Login"> <span class="glyphicon glyphicon-envelope form-control-feedback"></span> </div> <div class="form-group has-feedback"> @@ -99,7 +99,7 @@ <!-- /.col --> </div> </form> - + <hr /> <a href="#">I forgot my password</a><br> @@ -114,8 +114,8 @@ <!-- jQuery 2.2.3 --> <script src="{% static 'AdminLTE/plugins/jQuery/jquery-2.2.3.min.js' %}"></script> <!-- Bootstrap 3.3.6 --> - <script src="{% static 'AdminLTE/js/bootstrap.min.js' %}"></script> - + <script src="{% static 'AdminLTE/js/bootstrap.min.js' %}"></script> + <!-- iCheck --> <script src="{% static 'AdminLTE/plugins/iCheck/icheck.min.js' %}"></script> <script> diff --git a/smash/web/templates/mail_templates/index.html b/smash/web/templates/mail_templates/index.html index 453afb8dd9e6b452976d8076307237604b855847..57d5de7fdc76aae80f965aa62125f5252c502b0b 100644 --- a/smash/web/templates/mail_templates/index.html +++ b/smash/web/templates/mail_templates/index.html @@ -16,6 +16,23 @@ {% endblock breadcrumb %} {% block maincontent %} +<div class="box box-danger box-solid"> + <div class="box-header with-border"> + <h3 class="box-title">Not yet implemented</h3> + + <div class="box-tools pull-right"> + <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button> + </div> + <!-- /.box-tools --> + </div> + <!-- /.box-header --> + <div class="box-body"> + This is only a static page to show, how the system would look like. + A comprehensive system for template editing and generation has to be developed. + </div> + <!-- /.box-body --> +</div> + <div> <a class="btn btn-app"> <i class="fa fa-plus"></i> Add new letter @@ -74,10 +91,10 @@ {% block scripts %} {{ block.super }} - + <script src="{% static 'AdminLTE/plugins/datatables/jquery.dataTables.min.js' %}"></script> <script src="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.min.js' %}"></script> - + <script> $(function () { $('#table').DataTable({ diff --git a/smash/web/templates/visits/breadcrumb.html b/smash/web/templates/visits/breadcrumb.html new file mode 100644 index 0000000000000000000000000000000000000000..e2222c988bae7c38812d64f3dd4d38a831a5d75a --- /dev/null +++ b/smash/web/templates/visits/breadcrumb.html @@ -0,0 +1,4 @@ +<li><a href="{% url 'web.views.assignments' %}"><i class="fa fa-dashboard"></i> Dashboard</a></li> +<li class="active"> + <a href="{% url 'web.views.visits' %}">Visits</a> +</li> diff --git a/smash/web/templates/visits/index.html b/smash/web/templates/visits/index.html new file mode 100644 index 0000000000000000000000000000000000000000..db29aed4a0c2f5b42c4fcc46f9e204a717dbb67a --- /dev/null +++ b/smash/web/templates/visits/index.html @@ -0,0 +1,42 @@ +{% extends "_base.html" %} +{% load static %} + +{% block styles %} +{{ block.super }} + <!-- DataTables --> + <link rel="stylesheet" href="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.css' %}"> + + <!-- fullCalendar 2.2.5--> + <link rel="stylesheet" href="{% static 'AdminLTE/plugins/fullcalendar/fullcalendar.min.css' %}"> + <link rel="stylesheet" href="{% static 'AdminLTE/plugins/fullcalendar/fullcalendar.print.css' %}" media="print"> +{% endblock styles %} + +{% block page_title %}'visits'{% endblock page_title %} +{% block page_header %}Visits{% endblock page_header %} +{% block page_description %}{% endblock page_description %} + +{% block title %}{{ block.super }} - Visits{% endblock %} + +{% block breadcrumb %} +{% include "visits/breadcrumb.html" %} +{% endblock breadcrumb %} + +{% block maincontent %} +<div class="row"> + <div class="col-md-12"> + <h3>Planning</h3> + + None + </div> +</div> +{% endblock maincontent %} + +{% block scripts %} + {{ block.super }} + + <script src="{% static 'AdminLTE/plugins/datatables/jquery.dataTables.min.js' %}"></script> + <script src="{% static 'AdminLTE/plugins/datatables/dataTables.bootstrap.min.js' %}"></script> + <script src="{% static 'AdminLTE/plugins/moment.js/moment.min.js' %}"></script> + <script src="{% static 'AdminLTE/plugins/fullcalendar/fullcalendar.min.js' %}"></script> + +{% endblock scripts %} diff --git a/smash/web/views.py b/smash/web/views.py index 8249c76a6e6e774f1078707c13d23c5edb869bdf..1f8dfb6b38f377114136aa908e5c0d33fd85136d 100644 --- a/smash/web/views.py +++ b/smash/web/views.py @@ -36,6 +36,9 @@ def login(request): Saturates response with information about logged user """ def wrap_response(request, template, params): + print request + print request.user + person, role = Worker.get_details(request.user) final_params = params.copy() @@ -56,6 +59,10 @@ def assignments(request): return wrap_response(request, 'assignments/index.html', {}) +def visits(request): + return wrap_response(request, 'visits/index.html', {}) + + def subjects(request): subjects_list = Subject.objects.order_by('-lastName') context = {