diff options
author | CruiseDevice | 2018-10-26 13:38:48 +0530 |
---|---|---|
committer | CruiseDevice | 2018-10-26 13:46:16 +0530 |
commit | a438fee238995d2d691bf6b6f71d0b67a7d58ca2 (patch) | |
tree | 4364183ecfb3a148a9cbe5af03bce1ae057d4d34 | |
parent | 00f02432ba31aadb4da46aab9804112d1fb8c9de (diff) | |
download | sbhs_server-a438fee238995d2d691bf6b6f71d0b67a7d58ca2.tar.gz sbhs_server-a438fee238995d2d691bf6b6f71d0b67a7d58ca2.tar.bz2 sbhs_server-a438fee238995d2d691bf6b6f71d0b67a7d58ca2.zip |
fix UI issues in website
- separate header, body and footer using css ids in base.html to avoid text hiding in header and footer
- remove unnecessary script tag and div tag from account/home.html
- use django-crispy-forms to fix design issues in password_change_form, user_registration_form and user_login_form
- fix UI issues in pages/info.html and pages_index.html
-rw-r--r-- | sbhs/static/css/base.css | 28 | ||||
-rw-r--r-- | sbhs/templates/account/account_index.html | 14 | ||||
-rw-r--r-- | sbhs/templates/account/home.html | 6 | ||||
-rw-r--r-- | sbhs/templates/account/registration/password_change_form.html | 4 | ||||
-rw-r--r-- | sbhs/templates/base.html | 128 | ||||
-rw-r--r-- | sbhs/templates/pages/info.html | 3 | ||||
-rw-r--r-- | sbhs/templates/pages/pages_index.html | 10 |
7 files changed, 101 insertions, 92 deletions
diff --git a/sbhs/static/css/base.css b/sbhs/static/css/base.css index dd9ab77..6e356f7 100644 --- a/sbhs/static/css/base.css +++ b/sbhs/static/css/base.css @@ -1,5 +1,6 @@ .content { padding-top: 65px; + padding-bottom: 100px; } .footer{ position: fixed; @@ -12,18 +13,23 @@ box-sizing: border-box; width: 100%; font: bold 12px; - overflow: auto; - clear:both; - padding-top: 2px; - height: 10%; } - html, body{ - font-size:10px; - overflow:auto; + margin:0; + padding:0; height:100%; - overflow-x:hidden; - text-align:center; - width:1024px; - margin: 0px auto 0px auto; +} + +#container{ + min-height: 100%; + position: relative; +} + +#header{ + +} + +#body{ + padding: 10px; + padding-bottom: 60px: } diff --git a/sbhs/templates/account/account_index.html b/sbhs/templates/account/account_index.html index 60fece6..ce0754e 100644 --- a/sbhs/templates/account/account_index.html +++ b/sbhs/templates/account/account_index.html @@ -1,5 +1,5 @@ {% extends "base.html" %} - +{% load crispy_forms_tags %} {% block content %} <div class="container"> <div class="row"> @@ -8,9 +8,9 @@ <br> <form action="{% url 'account_login' %}" method="POST"> {% csrf_token %} - {{login_form.as_p}} - - <input type="submit" class="btn btn-primary" value="Login"> + {{login_form|crispy}} + <br> + <input type="submit" class="btn btn-inverse" value="Login"> <a href="{% url "password_reset" %}">Forgot Password?</a> </form> </div> @@ -18,10 +18,8 @@ <h2>Create Account</h2> <form action="{% url 'account_create' %}" method="POST"> {% csrf_token %} - {{registration_form.as_p}} - {% for field in registration_form %} - - {% endfor %} + {{registration_form|crispy}} + <input type="submit" class="btn btn-inverse" value="New User? Sign-Up"> </form> </div> diff --git a/sbhs/templates/account/home.html b/sbhs/templates/account/home.html index 5f647bb..66dae1c 100644 --- a/sbhs/templates/account/home.html +++ b/sbhs/templates/account/home.html @@ -1,12 +1,8 @@ {% extends "base.html" %} - {% block content %} <div class="container"> <div class="row"> - <script type="text/javascript"> - document.getElementById("home-nav").classList.add("active"); - </script> - <div class="span12"> + <div> <h2>Welcome to Single Board Heater System Lab</h2> <br> You can: diff --git a/sbhs/templates/account/registration/password_change_form.html b/sbhs/templates/account/registration/password_change_form.html index 6fc6546..925b776 100644 --- a/sbhs/templates/account/registration/password_change_form.html +++ b/sbhs/templates/account/registration/password_change_form.html @@ -1,5 +1,5 @@ {% extends "base.html" %} - +{% load crispy_forms_tags %} {% block title %}Change you password{% endblock %} {% block content %} @@ -7,7 +7,7 @@ <h1>Change you password</h1> <p>Use the form below to change your password.</p> <form action="." method="post"> - {{ form.as_p }} + {{ form|crispy}} <p><input type="submit" class = "btn btn-inverse" value="Change"></p> {% csrf_token %} </form> diff --git a/sbhs/templates/base.html b/sbhs/templates/base.html index a1e36f2..099488b 100644 --- a/sbhs/templates/base.html +++ b/sbhs/templates/base.html @@ -20,73 +20,82 @@ {% endblock %} </head> <body> - {% block nav %} - <nav class="navbar navbar-fixed-top navbar-inverse"> - <div class="container"> - - <div class="navbar-header"> - <a class="navbar-brand navbar-left" href="{% url 'pages_index' %}" class="brand">Single Board Heater System Lab</a> - </div> + <div id = "header"> + {% block nav %} - <div id="navbar" class="collapse navbar-collapse"> - <ul class="nav navbar-nav navbar-right"> - {% if user.is_authenticated %} - <li id="book-slot-nav"><a href="{% url 'slot_new' %}">Book slot</a></li> - <li id="download-log-nav"><a href="{% url 'experiment_logs' %}">Download log files</a></li> - <li id="video-nav"><a href="">Show video</a></li> - {% if user.profile.is_moderator %} - <li id="admin-nav"><a href="{% url 'moderator_dashboard' %}">Moderator Dashboard</a></li> - {% endif %} - {% endif %} - <li class="nav-item dropdown"> - <a class="dropdown-toggle nav-link" id="info_dropdown" data-toggle="dropdown" href="#">SBHS InfoCentre - <span class="caret"></span></a> - <div class="dropdown-menu"> - <ul class="nav"> - <li><a class="dropdown-item" href="{% url 'pages_info'%}#info">Info</a></li> - <li><a class="dropdown-item" href="{% url 'pages_info'%}#theory">Theory</a><li> - <li><a class="dropdown-item" href="{% url 'pages_info'%}#procedure">Procedure</a></li> - </ul> - </div> - </li> + <nav class="navbar navbar-fixed-top navbar-inverse"> + <div class="container"> + + <div class="navbar-header"> + <a class="navbar-brand navbar-left" href="{% url 'pages_index' %}" class="brand">Single Board Heater System Lab</a> + </div> + <div id="navbar" class="collapse navbar-collapse"> + <ul class="nav navbar-nav navbar-right"> {% if user.is_authenticated %} + <li id="book-slot-nav"><a href="{% url 'slot_new' %}">Book slot</a></li> + <li id="download-log-nav"><a href="{% url 'experiment_logs' %}">Download log files</a></li> + <li id="video-nav"><a href="">Show video</a></li> + {% if user.profile.is_moderator %} + <li id="admin-nav"><a href="{% url 'moderator_dashboard' %}">Moderator Dashboard</a></li> + {% endif %} + {% endif %} <li class="nav-item dropdown"> - <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#">{{ user.username|title }} <span class="caret"></span></a> - <div class="dropdown-menu"> - <ul class="nav"> - <li><a class="dropdown-item" href="{% url 'password_change'%}">Change Password</a></li> - <li><a>Request machine change</a></li> - <li><a href="{% url 'account_logout' %}">Logout</a></li> - </ul> - </div> + <a class="dropdown-toggle nav-link" id="info_dropdown" data-toggle="dropdown" href="#">SBHS InfoCentre + <span class="caret"></span></a> + <div class="dropdown-menu"> + <ul class="nav"> + <li><a class="dropdown-item" href="{% url 'pages_info'%}#info">Info</a></li> + <li><a class="dropdown-item" href="{% url 'pages_info'%}#theory">Theory</a><li> + <li><a class="dropdown-item" href="{% url 'pages_info'%}#procedure">Procedure</a></li> + </ul> + </div> </li> - {% else %} - <li><a href="{% url 'account_enter' %}">Log In</a></li> - {% endif %} - </div><!-- /.navbar --> - </div><!-- /.container --> - </nav><!-- /.navbar --> -{% endblock %} - {% if messages %} - <div class = "container"> - {% for message in messages %} - <div class = "alert alert-{{message.tags}}"> - {{message|safe}} - <a href="#" data-dismiss="alert" class="close">x</a> - </div> - {% endfor %} - </div> - {% endif %} - <div class="content"> - {% block content %} + {% if user.is_authenticated %} + <li class="nav-item dropdown"> + <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#">{{ user.username|title }} <span class="caret"></span></a> + <div class="dropdown-menu"> + <ul class="nav"> + <li><a class="dropdown-item" href="{% url 'password_change'%}">Change Password</a></li> + <li><a>Request machine change</a></li> + <li><a href="{% url 'account_logout' %}">Logout</a></li> + </ul> + </div> + </li> + {% else %} + <li><a href="{% url 'account_enter' %}">Log In</a></li> + {% endif %} + </div><!-- /.navbar --> + </div><!-- /.container --> + </nav><!-- /.navbar --> {% endblock %} </div> + + <div id = "body"> + <div class="content"> + + {% if messages %} + <div class = "container"> + {% for message in messages %} + <div class = "alert alert-{{message.tags}}"> + {{message|safe}} + <a href="#" data-dismiss="alert" class="close">x</a> + </div> + {% endfor %} + </div> + {% endif %} + + {% block content %} + {% endblock %} + + </div> + </div> + - <div class="footer"> - {% block footer %} - <div class="footer-left"> + <div class="footer" id = "footer"> + {% block footer %} + <div class="footer-left text-center"> <p>Server time: <span id="timer">{% now "jS M Y h:i:s A" %}</span> <span>Copyright © {% now "Y" %}</span></p> </div> @@ -126,6 +135,9 @@ </script> {% endblock %} + </div> </div> + + </body> </html> diff --git a/sbhs/templates/pages/info.html b/sbhs/templates/pages/info.html index 0dffbbd..3d4b792 100644 --- a/sbhs/templates/pages/info.html +++ b/sbhs/templates/pages/info.html @@ -4,9 +4,6 @@ {% block content %} <div class="container"> <div class="row"> - {% if user.is_authenticated %} - {#{% include 'account/sub_nav.html' %}#} - {% endif %} <div class="span12"> <div class="page-header"> <h1>Welcome to Single Board Heater System Lab!</h1> diff --git a/sbhs/templates/pages/pages_index.html b/sbhs/templates/pages/pages_index.html index d7c96c8..9579b57 100644 --- a/sbhs/templates/pages/pages_index.html +++ b/sbhs/templates/pages/pages_index.html @@ -4,11 +4,11 @@ <div class="container"> <div class="row"> <div class="span12"> - <div class="page-header"> - <div class="span1" style="margin-left: 0; margin-right: 20px;"> + <div> + <div class="span1" style="margin-left: 10px; margin-right: 40px;"> <img src="{% static 'img/iitbLogo.png' %}" alt="IITB"> </div> - <h1>Single Board Heater System Lab</h1> + <h1 style="padding-top:20px;">Single Board Heater System Lab</h1> <p>By <a href="http://www.iitb.ac.in/" target="_blank">Indian Institute of Technology, Bombay</a></p> </div> </div> @@ -16,7 +16,7 @@ <h3>Welcome to Virtual Labs (SBHS)</h3> <p style="text-align: justify;">The Virtual Labs Project was started as an initiative from the Ministry of Human Resource and Development (MHRD) to create online interactive media which would help students learn and experiment with difficult concepts in various domains. As a part of this initiative, a virtual laboratory for Single Board Heater System (SBHS) has been developed. The objective of this lab is to help students, teachers or in general enthusiasts perform experiments in the Instrumentation and Control System labs virtually, and yet have close to real life experience. The platform is focused on learning aspects as much as on performing the experiments.</p> </div> - <div class="span6"> + <div class="span4"> <div id="slider" class="carousel slide" data-interval="4000"> <ol class="carousel-indicators"> <li data-target="#slider" data-slide-to="0" class="active"></li> @@ -48,7 +48,7 @@ <li>Users are given two slots of 55 minute duration for performing the tests every day. They can also make use of vacant current slots, if any, in addition to this. The relatively small time constant of the SBHS allows the user to complete one or more experiments within the 55 minute duration.</li> </ul> </div> - <div class="span6"> + <div class="span4"> <h3>SBHS Discussion Forum</h3> <p style="text-align: justify;">We provide you extensive documentation and spoken tutorials on the SBHS and how to access it using Virtual Labs. You can find the links in the downloads section. Support is given for Scilab based experiments on the SBHS. The Scilab based experiments on SBHS. Sample Scilab code for Step Test is also available in the downloads section. Join us also in the SBHS discussion forum (<a href="http://sbhs.os-hardware.in/node/5" target="_blank">here</a>).</p> </div> |