Commit 4e5ec886 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'feature/fancier_loginpage' into 'master'

Make the login page somewhat nicer

Make the login page nicer

See merge request !59
parents 12da4fed ff665fa3
......@@ -4967,4 +4967,15 @@ ul.rslides > li {
-o-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
\ No newline at end of file
}
.loginForm {
text-align: center;
}
.loginForm table {
margin-left: auto;
margin-right: auto;
}
.loginForm input {
margin: .5em;
}
+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown",h),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=" li:not(.divider):visible a",i=f.find("[role=menu]"+h+", [role=listbox]"+h);if(i.length){var j=i.index(i.filter(":focus"));38==b.keyCode&&j>0&&j--,40==b.keyCode&&j<i.length-1&&j++,~j||(j=0),i.eq(j).focus()}}}};var g=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new f(this)),"string"==typeof b&&d[b].call(c)})},a.fn.dropdown.Constructor=f,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=g,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e+", [role=menu], [role=listbox]",f.prototype.keydown)}(jQuery);
\ No newline at end of file
......@@ -158,14 +158,28 @@
{% if not user.is_authenticated %}
<div class="btn-group open" id="thimbus-account-menu">
<a class="btn btn-default" href="/account"><i class="fa fa-user"></i>{% trans "Login" %}</a>
<a class="btn btn-default" href="{% url 'login' %}"><i class="fa fa-user"></i>{% trans "Login" %}</a>
</div>
{% endif %}
{% else %}
<div class="btn-group" id="thimbus-account-menu">
<a class="btn btn-default" href="/nyi"><i class="fa fa-user"></i> My Account</a>
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu">
<li><a href="/nyi">{% trans "Edit Profile" %}</a></li>
<li><a href="/nyi">{% trans "Profile Picture" %}</a></li>
<li class="divider"></li>
<li><a href="{% url 'logout' %}"><i class="fa fa-sign-out"></i>{% trans "Log Out" %}</a></li>
</ul>
</div>
{% endif %}
</div>
{% block js_footer %}
<script type="text/javascript" src="{% static "js/footer.js" %}"></script>
{% endblock %}
{% block js_footer %}
<script type="text/javascript" src="{% static "js/footer.js" %}"></script>
<script type="text/javascript" src="{% static "js/bootstrap-dropdown.js" %}"></script>
{% endblock %}
</body>
<!-- /body -->
......
......@@ -6,24 +6,28 @@
{% block title %}{% trans "Login" %}{% endblock %}
{% block body %}
<h1>{% trans "Log in" %}</h1>
{% if next %}
{% if user.is_authenticated %}
{% blocktrans %}
<p>Your account does not have access to this page. To proceed, please
log in with an account that has access.</p>
{% endblocktrans %}
{% else %}
{% blocktrans %}
<p>Please log in to see this page.</p>
{% endblocktrans %}
{% endif %}
{% if user.is_authenticated %}
{% blocktrans %}
<p>Your account does not have access to this page. To proceed, please
log in with an account that has access.</p>
{% endblocktrans %}
{% else %}
{% blocktrans %}
<p>Please log in to see this page.</p>
{% endblocktrans %}
{% endif %}
<form method="POST" action="{% url 'login' %}">
{% csrf_token %}
<table>
{{ form }}
</table>
<input type="hidden" name="next" value="{{ next }}">
<input type="submit" value="{% trans "Login" %}">
{% endif %}
<div class="loginForm">
<form method="POST" action="{% url 'login' %}">
{% csrf_token %}
<table>
{{ form }}
</table>
<input type="hidden" name="next" value="{{ next }}">
<input type="submit" value="{% trans "Login" %}">
</form>
</form>
</div>
{% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment