User menu, css cleanups

This commit is contained in:
nikolark committed 2014-10-06 20:01:52 +02:00
1 parent 9641b66346
commit d8a750151b
9 files changed
+3194 -2745

No files matched your search

+7
View File
@@ -128,6 +128,13 @@ class UserProfile(models.Model):
else: else:
return datetime.min return datetime.min
def profile_image_url(self):
from django.templatetags.static import static
if self.image:
return static('img/unknown_person.png')
return self.image
def __unicode__(self): def __unicode__(self):
return u"{0}".format(self.user) return u"{0}".format(self.user)
View File
Whitespace-only changes.
View File
Whitespace-only changes.
+39 -24
View File
@@ -6,12 +6,32 @@
@import "datepicker"; @import "datepicker";
body { body {
h2 { h2 {
margin-top: 0; margin-top: 0;
} }
.glyphicon .white {
color: white;
}
}
#header {
.dropdown-toggle {
padding-top: 0;
padding-bottom: 0;
#customer { img {
width: 40px;
@include border-radius(50% 50%);
}
.name {
display: inline-block;
padding-top: 15px;
padding-bottom: 15px;
padding-left: 8px;
}
}
}
#customer {
ul { ul {
@include inline-block-list; @include inline-block-list;
@@ -37,9 +57,9 @@ body {
} }
} }
} }
} }
#register { #register {
#products { #products {
margin-bottom:2em; margin-bottom:2em;
ul { ul {
@@ -86,8 +106,8 @@ body {
input[name=customer_name] { input[name=customer_name] {
display: block; display: block;
} }
} }
#log { #log {
h2 { h2 {
display:inline-block; display:inline-block;
} }
@@ -100,8 +120,8 @@ body {
font-weight: bold; font-weight: bold;
} }
} }
} }
#inventory { #inventory {
tr { tr {
&.info { &.info {
border-left: 8px solid #d9edf7; border-left: 8px solid #d9edf7;
@@ -126,8 +146,8 @@ body {
color: #888; color: #888;
} }
} }
} }
#inventory-report { #inventory-report {
.form-control { .form-control {
width: auto; width: auto;
} }
@@ -139,20 +159,6 @@ body {
color: #da7878; color: #da7878;
} }
} }
}
/* General styles*/
.glyphicon .white {
color: white;
}
}
.form-login {
max-width: 320px;
margin: 4em auto;
[type=submit] {
display: block;
width: 100%;
}
} }
#footer .credits { #footer .credits {
text-align: center; text-align: center;
@@ -175,3 +181,12 @@ body {
height: 32px; height: 32px;
} }
} }
.form-login {
max-width: 320px;
margin: 4em auto;
[type=submit] {
display: block;
width: 100%;
}
}
View File
Whitespace-only changes.
View File
Whitespace-only changes.
+3147 -2716
View File
File diff suppressed because it is too large. Load diff
-4
View File
@@ -6,10 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="x-django-static-url" content="{{ STATIC_URL }}"> <meta name="x-django-static-url" content="{{ STATIC_URL }}">
<link rel="stylesheet" href="{{ STATIC_URL }}stylesheets/screen.css" type="text/css" media="screen, projection"> <link rel="stylesheet" href="{{ STATIC_URL }}stylesheets/screen.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="{{ STATIC_URL }}stylesheets/print.css" type="text/css" media="print">
<!--[if lt IE 8]>
<link rel="stylesheet" href="{{ STATIC_URL }}stylesheets/ie.css" type="text/css" media="screen, projection">
<![endif]-->
{%block headinc %} {%block headinc %}
{%endblock%} {%endblock%}
</head> </head>
+1 -1
View File
@@ -22,7 +22,7 @@
<li><a href="{% url 'login' %}">Logg inn</a></li> <li><a href="{% url 'login' %}">Logg inn</a></li>
{% else %} {% else %}
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Innstillinger <b class="caret"></b></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="{{ user.get_profile.profile_image_url }}" /><span class="name">{{ user.first_name }}</span> <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li class="{% if active = "create_user" %}active{% endif %}"><a href="{% url 'create-user' %}"><i class="glyphicon glyphicon-plus"></i> Ny bruker</a></li> <li class="{% if active = "create_user" %}active{% endif %}"><a href="{% url 'create-user' %}"><i class="glyphicon glyphicon-plus"></i> Ny bruker</a></li>
{% if request.user.is_superuser %}<li><a href="/admin"><i class="glyphicon glyphicon-cog"></i> Administrasjon</a></li>{% endif %} {% if request.user.is_superuser %}<li><a href="/admin"><i class="glyphicon glyphicon-cog"></i> Administrasjon</a></li>{% endif %}