@@ -98,7 +98,7 | |||
|
98 | 98 | MIDDLEWARE_CLASSES = ( |
|
99 | 99 | 'django.middleware.common.CommonMiddleware', |
|
100 | 100 | 'django.contrib.sessions.middleware.SessionMiddleware', |
|
101 |
|
|
|
101 | 'django.middleware.csrf.CsrfViewMiddleware', | |
|
102 | 102 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
103 | 103 | 'django.contrib.messages.middleware.MessageMiddleware', |
|
104 | 104 | # Uncomment the next line for simple clickjacking protection: |
@@ -17,6 +17,7 | |||
|
17 | 17 | url(r'^admin/', include(admin.site.urls)), |
|
18 | 18 | url(r'^abscontrol/', include('abscontrol.urls')), |
|
19 | 19 | url(r'^accounts/login/$', 'django.contrib.auth.views.login'), |
|
20 | url(r'^$', 'abscontrol.views.index'), | |
|
20 | 21 | |
|
21 | 22 | ) |
|
22 | 23 |
@@ -4,6 +4,7 | |||
|
4 | 4 | from django.utils.encoding import smart_str |
|
5 | 5 | from django.core.servers.basehttp import FileWrapper |
|
6 | 6 | import mimetypes |
|
7 | from django.contrib.auth.decorators import login_required | |
|
7 | 8 | |
|
8 | 9 | from datetime import datetime |
|
9 | 10 | |
@@ -70,6 +71,7 | |||
|
70 | 71 | |
|
71 | 72 | arrayUes = ["0.533333","0.00000","1.06667","0.00000"] |
|
72 | 73 | |
|
74 | @login_required(login_url='/accounts/login/') | |
|
73 | 75 | def index(request): |
|
74 | 76 | #latest_poll_list = profileAntenna.objects.all().order_by('-pub_date')[:5] |
|
75 | 77 | profile_list = Profile.objects.filter(state=1) |
@@ -569,9 +569,81 | |||
|
569 | 569 | background: #666; |
|
570 | 570 | color: #fff; } |
|
571 | 571 | |
|
572 | #Main_Head { | |
|
573 | margin: 0 auto; | |
|
574 | height: 100%; | |
|
575 | border: 1px solid #ddd !important; | |
|
576 | box-shadow: 1px 1px 2px #ddd; | |
|
577 | border-radius: 5px; | |
|
578 | display: block; } | |
|
579 | ||
|
580 | .Main_Title { | |
|
581 | font-size: 2em; | |
|
582 | letter-spacing: 0.06em; | |
|
583 | color: #444; | |
|
584 | text-shadow: 2px 2px #ccc; } | |
|
585 | ||
|
572 | 586 | /****************************************************************************************/ |
|
573 | 587 | /****** FOOTER *************/ |
|
574 | 588 | /****************************************************************************************/ |
|
575 | 589 | footer p { |
|
576 | 590 | font-family: 'Roboto Condensed', sans-serif; |
|
577 | font-size: 0.98em; } No newline at end of file | |
|
591 | font-size: 0.98em; } | |
|
592 | ||
|
593 | /****************************************************************************************/ | |
|
594 | /****** LOGIN *************/ | |
|
595 | /****************************************************************************************/ | |
|
596 | #contentLogin { | |
|
597 | margin: 0; | |
|
598 | padding: 0; | |
|
599 | border: 0px solid #1cc; } | |
|
600 | ||
|
601 | #MainColumnLogin { | |
|
602 | margin: 2px auto; | |
|
603 | border: 0px solid #f00 !important; | |
|
604 | box-shadow: 1px 1px 2px #ddd; | |
|
605 | border-radius: 2px; | |
|
606 | background-color: #eee; | |
|
607 | width: 100%; | |
|
608 | padding: 5px 0px; | |
|
609 | } | |
|
610 | ||
|
611 | .row_reg { | |
|
612 | margin: 5px auto; | |
|
613 | display: block; | |
|
614 | width: 90%; | |
|
615 | border: 0px solid #1cc !important; | |
|
616 | line-height: 22px; | |
|
617 | } | |
|
618 | ||
|
619 | .row_reg label, .row_reg input[type=text] { | |
|
620 | float: left; | |
|
621 | line-height: 22px; | |
|
622 | } | |
|
623 | ||
|
624 | #id_username, #id_password { | |
|
625 | width: 160px; | |
|
626 | line-height: 22px; | |
|
627 | } | |
|
628 | ||
|
629 | .row_reg label { | |
|
630 | width: 400px; | |
|
631 | text-align: right; | |
|
632 | padding-right: 10px; | |
|
633 | border: 0px solid #d22 !important; | |
|
634 | } | |
|
635 | ||
|
636 | .row_reg input[type=submit], .row_reg input[type=button] { | |
|
637 | margin-left: 410px; | |
|
638 | width: 80px; | |
|
639 | } | |
|
640 | ||
|
641 | #lblTitleLogin { | |
|
642 | width: 100%; | |
|
643 | text-align: center; | |
|
644 | font-size: 1.2em; | |
|
645 | font-weight: normal; | |
|
646 | color: #222; | |
|
647 | border: 0px solid #f00 !important; | |
|
648 | background-color: #ccc; | |
|
649 | } No newline at end of file |
@@ -5,6 +5,14 | |||
|
5 | 5 | {% if profile_list %} |
|
6 | 6 | <script src="/static/static/js/profiles.js"></script> |
|
7 | 7 | {% endif %} |
|
8 | {% endblock %} | |
|
9 | {% block header %} | |
|
10 | <nav id="header"> | |
|
11 | <a href="{% url abscontrol.views.index %}" class="selected">ABS</a> | |
|
12 | <a href="#">CR</a> | |
|
13 | <a href="#">DDS</a> | |
|
14 | <a href="#">JARS</a> | |
|
15 | </nav> | |
|
8 | 16 | {% endblock %} |
|
9 | 17 | {% block content %} |
|
10 | 18 | <div id="content"> |
@@ -26,14 +26,11 | |||
|
26 | 26 | <body> |
|
27 | 27 | <div id="schema"> |
|
28 | 28 | <header> |
|
29 |
|
|
|
30 |
|
|
|
31 | <a href="/abscontrol/" class="selected">ABS</a> | |
|
32 | <a href="#">CR</a> | |
|
33 | <a href="#">DDS</a> | |
|
34 | <a href="#">JARS</a> | |
|
35 | </nav> | |
|
36 | {% endblock %} | |
|
29 | {% block header %} | |
|
30 | <div id="Main_Head"> | |
|
31 | <label class="Main_Title">Jicamarca Radio Observatory</label> | |
|
32 | </div> | |
|
33 | {% endblock %} | |
|
37 | 34 | </header> |
|
38 | 35 | {% block content %} |
|
39 | 36 | <div id="content"></div> |
@@ -2,27 +2,38 | |||
|
2 | 2 | {% load url from future %} |
|
3 | 3 | |
|
4 | 4 | {% block content %} |
|
5 | ||
|
6 | {% if form.errors %} | |
|
7 | <p>Your username and password didn't match. Please try again.</p> | |
|
8 | {% endif %} | |
|
9 | ||
|
10 | <form method="post" action="{% url 'django.contrib.auth.views.login' %}"> | |
|
11 | {% csrf_token %} | |
|
12 | <table> | |
|
13 | <tr> | |
|
14 | <td>{{ form.username.label_tag }}</td> | |
|
15 | <td>{{ form.username }}</td> | |
|
16 | </tr> | |
|
17 | <tr> | |
|
18 | <td>{{ form.password.label_tag }}</td> | |
|
19 | <td>{{ form.password }}</td> | |
|
20 | </tr> | |
|
21 | </table> | |
|
22 | ||
|
23 | <input type="submit" value="login" /> | |
|
24 | <input type="hidden" name="next" value="{{ next }}" /> | |
|
25 | </form> | |
|
26 | ||
|
27 | {% endblock %} | |
|
28 | ||
|
5 | <div id="contentLogin"> | |
|
6 | <div class="content_message"> | |
|
7 | {% if form.errors %} | |
|
8 | <p>Your username and password didn't match. Please try again.</p> | |
|
9 | {% endif %} | |
|
10 | </div> | |
|
11 | <div id="MainColumnLogin"> | |
|
12 | <form method="post" action="{% url 'django.contrib.auth.views.login' %}"> | |
|
13 | {% csrf_token %} | |
|
14 | <div class="row_reg"> | |
|
15 | <label id="lblTitleLogin">Access</label> | |
|
16 | <div class="cleardivs"></div> | |
|
17 | </div> | |
|
18 | <div class="cleardivs"></div> | |
|
19 | <div class="row_reg"> | |
|
20 | <label>{{ form.username.label_tag }}</label> | |
|
21 | {{ form.username }} | |
|
22 | <div class="cleardivs"></div> | |
|
23 | </div> | |
|
24 | <div class="cleardivs"></div> | |
|
25 | <div class="row_reg"> | |
|
26 | <label>{{ form.password.label_tag }}</label> | |
|
27 | {{ form.password }} | |
|
28 | <div class="cleardivs"></div> | |
|
29 | </div> | |
|
30 | <div class="cleardivs"></div> | |
|
31 | <div class="row_reg"> | |
|
32 | <input type="submit" value="Ok" /> | |
|
33 | </div> | |
|
34 | <div class="cleardivs"></div> | |
|
35 | <input type="hidden" name="next" value="{% url 'abscontrol.views.index' %}" /> | |
|
36 | </form> | |
|
37 | </div> | |
|
38 | </div> | |
|
39 | {% endblock %} No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now