diff --git a/readme.md b/readme.md index ba904092e8a4aa86b0b3ce913c80feaad4370106..01d8a7868e425892cac5f1f2997a39498226eb22 100644 --- a/readme.md +++ b/readme.md @@ -14,7 +14,7 @@ - `virtualenv env` to create new virtualenv (contains clean python working environment) - `. env/bin/activate` (to start using virtualenv) - `pip install -r requirements.txt` to install project's dependencies - - Create `local_settings.py` file in `/scheduling-system/smash/web` directory, containing: + - Create `local_settings.py` file in `/scheduling-system/smash/smash` directory (see template below), and change your connection data: ``` # SECURITY WARNING: keep the secret key used in production secret! diff --git a/smash/web/templates/_base.html b/smash/web/templates/_base.html index 835157199c244c4b4f1d1435b11e1db7a0ef3b3f..d495471a21c2c8dcb2131a272ae166df3b6fdc69 100644 --- a/smash/web/templates/_base.html +++ b/smash/web/templates/_base.html @@ -246,35 +246,35 @@ desired effect <li class="header">Pages</li> <li data-desc="subjects"> - <a href="#"> + <a href="{% url 'web.views.subjects' %}"> <i class="fa fa-users"></i> <span>Subjects</span> </a> </li> <li data-desc="assignments"> - <a href="#"> + <a href="{% url 'web.views.assignments' %}"> <i class="fa fa-calendar"></i> <span>Assignments</span> </a> </li> <li data-desc="doctors"> - <a href="#"> + <a href="{% url 'web.views.doctors' %}"> <i class="fa fa-user-md"></i> <span>Doctors</span> </a> </li> - <li data-desc="equipment-and-rooms"> - <a href="#"> + <li data-desc="equipment_and_rooms"> + <a href="{% url 'web.views.equipment_and_rooms' %}"> <i class="fa fa-building-o"></i> <span>Equipment&rooms</span> </a> </li> - <li data-desc="mail-templates"> - <a href="#"> + <li data-desc="mail_templates"> + <a href="{% url 'web.views.mail_templates' %}"> <i class="fa fa-envelope-o"></i> <span>Mail templates</span> </a> @@ -304,8 +304,8 @@ desired effect <!-- Content Header (Page header) --> <section class="content-header"> <h1> - {{ page_header }} - <small>{{ page_description }}</small> + {% block page_header %}{% endblock page_header %} + <small>{% block page_description %}{% endblock page_description %}</small> </h1> <ol class="breadcrumb"> @@ -431,6 +431,16 @@ desired effect <!-- AdminLTE App --> <script src="{% static 'AdminLTE/js/app.min.js' %}"></script> + <script> + var activate = function(page_to_activate) { + var $e = $(".sidebar-menu > li[data-desc='" + page_to_activate + "']"); + $e.addClass("active"); + }; + + activate({% block page_title %}{% endblock page_title %}); + + </script> + {% comment "TODO: Check, and add if works %} <!-- Optionally, you can add Slimscroll and FastClick plugins. Both of these plugins are recommended to enhance the diff --git a/smash/web/templates/assignments/index.html b/smash/web/templates/assignments/index.html new file mode 100644 index 0000000000000000000000000000000000000000..3cd45b540d649e09dcc34efb961ae50b7e9e5c63 --- /dev/null +++ b/smash/web/templates/assignments/index.html @@ -0,0 +1,5 @@ +{% extends "_base.html" %} + +{% block page_title %}'assignments'{% endblock page_title %} +{% block page_header %}Assignments{% endblock page_header %} +{% block page_description %}{% endblock page_description %} diff --git a/smash/web/templates/doctors/index.html b/smash/web/templates/doctors/index.html new file mode 100644 index 0000000000000000000000000000000000000000..0cd98ef3db356803bd00af27d920e5601e19dd24 --- /dev/null +++ b/smash/web/templates/doctors/index.html @@ -0,0 +1,5 @@ +{% extends "_base.html" %} + +{% block page_title %}'doctors'{% endblock page_title %} +{% block page_header %}Doctors'{% endblock page_header %} +{% block page_description %}information{% endblock page_description %} diff --git a/smash/web/templates/equipment_and_rooms/index.html b/smash/web/templates/equipment_and_rooms/index.html new file mode 100644 index 0000000000000000000000000000000000000000..730be7482d2b9434cba9d9a99bba6ddd790aa3e5 --- /dev/null +++ b/smash/web/templates/equipment_and_rooms/index.html @@ -0,0 +1,5 @@ +{% extends "_base.html" %} + +{% block page_title %}'equipment_and_rooms'{% endblock page_title %} +{% block page_header %}Equipment and rooms{% endblock page_header %} +{% block page_description %}{% endblock page_description %} diff --git a/smash/web/templates/index.html b/smash/web/templates/index.html index 5e1abb2c293f5bc782df2790a184b87c706aa822..5c824cd38fa8af34c55ba4fd5424bfd7d60d7e1d 100644 --- a/smash/web/templates/index.html +++ b/smash/web/templates/index.html @@ -1,5 +1,5 @@ {% extends "_base.html" %} -{% block content %} - <h3>Smart scheduling</h3> -{% endblock content %} +{% block page_title %}'subjects'{% endblock page_title %} +{% block page_header %}Welcome page{% endblock page_header %} +{% block page_description %}Short description{% endblock page_description %} diff --git a/smash/web/templates/mail_templates/index.html b/smash/web/templates/mail_templates/index.html new file mode 100644 index 0000000000000000000000000000000000000000..69bb5c01c7f97ffa86c3bee116fa82b129f81027 --- /dev/null +++ b/smash/web/templates/mail_templates/index.html @@ -0,0 +1,5 @@ +{% extends "_base.html" %} + +{% block page_title %}'mail_templates'{% endblock page_title %} +{% block page_header %}Mail templates{% endblock page_header %} +{% block page_description %}{% endblock page_description %} diff --git a/smash/web/templates/subjects/index.html b/smash/web/templates/subjects/index.html new file mode 100644 index 0000000000000000000000000000000000000000..16a2be3f5a13b2a7d227e3fd159572ec63724f70 --- /dev/null +++ b/smash/web/templates/subjects/index.html @@ -0,0 +1,5 @@ +{% extends "_base.html" %} + +{% block page_title %}'subjects'{% endblock page_title %} +{% block page_header %}Subjects{% endblock page_header %} +{% block page_description %}{% endblock page_description %} diff --git a/smash/web/urls.py b/smash/web/urls.py index 7cad1d27476a349da0745d9920f82325a1141a46..448169327abde36c0cb2c4cd8780632b33c92706 100644 --- a/smash/web/urls.py +++ b/smash/web/urls.py @@ -17,5 +17,10 @@ from django.conf.urls import url from web import views urlpatterns = [ - url(r'$', views.index, name='web.views.index') + url(r'assignments$', views.assignments, name='web.views.assignments'), + url(r'subjects$', views.subjects, name='web.views.subjects'), + url(r'doctors$', views.doctors, name='web.views.doctors'), + url(r'equipment_and_rooms$', views.equipment_and_rooms, name='web.views.equipment_and_rooms'), + url(r'mail_templates$', views.mail_templates, name='web.views.mail_templates'), + url(r'$', views.index, name='web.views.index') ] diff --git a/smash/web/views.py b/smash/web/views.py index 47ea6b7e350bbbd16fc5b0d0e3cc0de6b27f3696..48a6c3c76137861466b352a4654f4a96d42d1648 100644 --- a/smash/web/views.py +++ b/smash/web/views.py @@ -6,8 +6,35 @@ from django.template import loader # Create your views here. def index(request): template = loader.get_template("index.html") - return HttpResponse(template.render({ - 'page_header': 'Header', - 'page_description': 'Test' + return HttpResponse(template.render({ }), request) + +def assignments(request): + template = loader.get_template("assignments/index.html") + return HttpResponse(template.render({ + }), request) + + +def subjects(request): + template = loader.get_template("subjects/index.html") + return HttpResponse(template.render({ + }), request) + + +def doctors(request): + template = loader.get_template("doctors/index.html") + return HttpResponse(template.render({ + }), request) + + +def equipment_and_rooms(request): + template = loader.get_template("equipment_and_rooms/index.html") + return HttpResponse(template.render({ + }), request) + + +def mail_templates(request): + template = loader.get_template("mail_templates/index.html") + return HttpResponse(template.render({ + }), request)