@@ -98,7 +98,7 | |||||
98 | MIDDLEWARE_CLASSES = ( |
|
98 | MIDDLEWARE_CLASSES = ( | |
99 | 'django.middleware.common.CommonMiddleware', |
|
99 | 'django.middleware.common.CommonMiddleware', | |
100 | 'django.contrib.sessions.middleware.SessionMiddleware', |
|
100 | 'django.contrib.sessions.middleware.SessionMiddleware', | |
101 |
|
|
101 | 'django.middleware.csrf.CsrfViewMiddleware', | |
102 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
102 | 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
103 | 'django.contrib.messages.middleware.MessageMiddleware', |
|
103 | 'django.contrib.messages.middleware.MessageMiddleware', | |
104 | # Uncomment the next line for simple clickjacking protection: |
|
104 | # Uncomment the next line for simple clickjacking protection: |
@@ -17,6 +17,7 | |||||
17 | url(r'^admin/', include(admin.site.urls)), |
|
17 | url(r'^admin/', include(admin.site.urls)), | |
18 | url(r'^abscontrol/', include('abscontrol.urls')), |
|
18 | url(r'^abscontrol/', include('abscontrol.urls')), | |
19 | url(r'^accounts/login/$', 'django.contrib.auth.views.login'), |
|
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 | from django.utils.encoding import smart_str |
|
4 | from django.utils.encoding import smart_str | |
5 | from django.core.servers.basehttp import FileWrapper |
|
5 | from django.core.servers.basehttp import FileWrapper | |
6 | import mimetypes |
|
6 | import mimetypes | |
|
7 | from django.contrib.auth.decorators import login_required | |||
7 |
|
8 | |||
8 | from datetime import datetime |
|
9 | from datetime import datetime | |
9 |
|
10 | |||
@@ -70,6 +71,7 | |||||
70 |
|
71 | |||
71 | arrayUes = ["0.533333","0.00000","1.06667","0.00000"] |
|
72 | arrayUes = ["0.533333","0.00000","1.06667","0.00000"] | |
72 |
|
73 | |||
|
74 | @login_required(login_url='/accounts/login/') | |||
73 | def index(request): |
|
75 | def index(request): | |
74 | #latest_poll_list = profileAntenna.objects.all().order_by('-pub_date')[:5] |
|
76 | #latest_poll_list = profileAntenna.objects.all().order_by('-pub_date')[:5] | |
75 | profile_list = Profile.objects.filter(state=1) |
|
77 | profile_list = Profile.objects.filter(state=1) |
@@ -569,9 +569,81 | |||||
569 | background: #666; |
|
569 | background: #666; | |
570 | color: #fff; } |
|
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 | /****** FOOTER *************/ |
|
587 | /****** FOOTER *************/ | |
574 | /****************************************************************************************/ |
|
588 | /****************************************************************************************/ | |
575 | footer p { |
|
589 | footer p { | |
576 | font-family: 'Roboto Condensed', sans-serif; |
|
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 | {% if profile_list %} |
|
5 | {% if profile_list %} | |
6 | <script src="/static/static/js/profiles.js"></script> |
|
6 | <script src="/static/static/js/profiles.js"></script> | |
7 | {% endif %} |
|
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 | {% endblock %} |
|
16 | {% endblock %} | |
9 | {% block content %} |
|
17 | {% block content %} | |
10 | <div id="content"> |
|
18 | <div id="content"> |
@@ -26,14 +26,11 | |||||
26 | <body> |
|
26 | <body> | |
27 | <div id="schema"> |
|
27 | <div id="schema"> | |
28 | <header> |
|
28 | <header> | |
29 |
|
|
29 | {% block header %} | |
30 |
|
|
30 | <div id="Main_Head"> | |
31 | <a href="/abscontrol/" class="selected">ABS</a> |
|
31 | <label class="Main_Title">Jicamarca Radio Observatory</label> | |
32 | <a href="#">CR</a> |
|
32 | </div> | |
33 | <a href="#">DDS</a> |
|
33 | {% endblock %} | |
34 | <a href="#">JARS</a> |
|
|||
35 | </nav> |
|
|||
36 | {% endblock %} |
|
|||
37 | </header> |
|
34 | </header> | |
38 | {% block content %} |
|
35 | {% block content %} | |
39 | <div id="content"></div> |
|
36 | <div id="content"></div> |
@@ -2,27 +2,38 | |||||
2 | {% load url from future %} |
|
2 | {% load url from future %} | |
3 |
|
3 | |||
4 | {% block content %} |
|
4 | {% block content %} | |
5 |
|
5 | <div id="contentLogin"> | ||
6 | {% if form.errors %} |
|
6 | <div class="content_message"> | |
7 | <p>Your username and password didn't match. Please try again.</p> |
|
7 | {% if form.errors %} | |
8 | {% endif %} |
|
8 | <p>Your username and password didn't match. Please try again.</p> | |
9 |
|
9 | {% endif %} | ||
10 | <form method="post" action="{% url 'django.contrib.auth.views.login' %}"> |
|
10 | </div> | |
11 | {% csrf_token %} |
|
11 | <div id="MainColumnLogin"> | |
12 | <table> |
|
12 | <form method="post" action="{% url 'django.contrib.auth.views.login' %}"> | |
13 | <tr> |
|
13 | {% csrf_token %} | |
14 | <td>{{ form.username.label_tag }}</td> |
|
14 | <div class="row_reg"> | |
15 | <td>{{ form.username }}</td> |
|
15 | <label id="lblTitleLogin">Access</label> | |
16 | </tr> |
|
16 | <div class="cleardivs"></div> | |
17 | <tr> |
|
17 | </div> | |
18 | <td>{{ form.password.label_tag }}</td> |
|
18 | <div class="cleardivs"></div> | |
19 | <td>{{ form.password }}</td> |
|
19 | <div class="row_reg"> | |
20 | </tr> |
|
20 | <label>{{ form.username.label_tag }}</label> | |
21 | </table> |
|
21 | {{ form.username }} | |
22 |
|
22 | <div class="cleardivs"></div> | ||
23 | <input type="submit" value="login" /> |
|
23 | </div> | |
24 | <input type="hidden" name="next" value="{{ next }}" /> |
|
24 | <div class="cleardivs"></div> | |
25 | </form> |
|
25 | <div class="row_reg"> | |
26 |
|
26 | <label>{{ form.password.label_tag }}</label> | ||
27 | {% endblock %} |
|
27 | {{ form.password }} | |
28 |
|
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