update navbar in UI

This commit is contained in:
bohanjason 2019-10-06 22:57:14 -04:00 committed by Dana Van Aken
parent 63b7dd9a77
commit 924cccc459
1 changed files with 42 additions and 38 deletions

View File

@ -44,56 +44,60 @@
height: 32px; height: 32px;
width: 150px; width: 150px;
} }
</style> </style>
{% block extra_head %} {% block extra_head %}
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css"> <link rel="stylesheet" href="{{ STATIC_URL }}css/style.css">
{% endblock %} {% endblock %}
</head> </head>
<body> <body style="padding-top: 70px" >
<!-- Navigation --> <!-- Navigation -->
<nav class="navbar navbar-default fixed-top topnav" role="navigation"> <nav class="navbar navbar-default fixed-top topnav navbar-fixed-top " role="navigation">
<div class="container"> <div class="container">
<div class="navbar-header"> <div class="navbar-header">
<a class="navbar-brand .text-warning" href="{% url 'home_projects' %}">OtterTune</a> <a class="navbar-brand .text-warning" href="{% url 'home_projects' %}">OtterTune</a>
</div>
<div class="navbar-collapse collapse">
<div class="navbar-right">
{% if user.is_authenticated %}
<span class="navbar-text">Hello, {{ user.username }}</span>
<a class="btn btn-default navbar-btn2" href="{% url 'change_password' %}">Change Password</a>
<a class="btn btn-default navbar-btn2" href="{% url 'logout' %}">Sign Out</a>
{% else %}
<form class="form-inline navbar-form2" role="form" action="{% url 'login' %}" method="POST" style="margin:0 0 0 0">
{% csrf_token %}
<input type="text" placeholder="username" class="form-control form-control2" name="username">
<input type="password" placeholder="password" class="form-control form-control2" name="password">
<button type="submit" class="btn btn-default navbar-btn2"">Sign in</button>
</form>
</div>
{% endif %}
</div> </div>
</div> <div class="navbar-collapse collapse">
</div> {% if user.is_authenticated %}
<div class="dropdown navbar-right"><a class="dropdown-toggle navbar-text" style="font-size: 18px;" data-toggle="dropdown" href="#">Hello, {{ user.username }} <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="{% url 'change_password' %}">Change Password</a></li>
<li><a href="{% url 'logout' %}">Sign Out</a></li>
</ul>
</div>
{% else %}
<div class="navbar-right">
<form class="form-inline navbar-form2" role="form" action="{% url 'login' %}" method="POST" style="margin:0 0 0 0">
{% csrf_token %}
<input type="text" placeholder="username" class="form-control form-control2" name="username">
<input type="password" placeholder="password" class="form-control form-control2" name="password">
<button type="submit" class="btn btn-default navbar-btn2"">Sign in</button>
</form>
</div>
{% endif %}
</div>
</div>
</nav> </nav>
{% if form.errors %} {% if form.errors %}
{% for field in form %} {% for field in form %}
{% for error in field.errors %} {% for error in field.errors %}
<div class="alert alert-danger"> <div class="alert alert-danger">
<strong>{{ error|escape }}</strong> <strong>{{ error|escape }}</strong>
</div> </div>
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{% for error in form.non_field_errors %} {% for error in form.non_field_errors %}
<div class="alert alert-danger"> <div class="alert alert-danger">
<strong>{{ error|escape }}</strong> <strong>{{ error|escape }}</strong>
</div> </div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% block body %} {% endblock body %}
{% block body %} {% endblock body %}
</body> </body>
</html> </html>