Compare commits

...

5 commits

3 changed files with 218 additions and 124 deletions

View file

@ -25,15 +25,17 @@ p, h1, h2, h3, h4, h5, h6 {
/* Variables */ /* Variables */
:root { :root {
/* Colors */ /* Colors */
--light : #fff; --light : #ffffff;
--light-dust : #f6f6f6; --light-dust : #fefef9;
--dust : #f1f1f1; --dust : #f4f1ef;
--medium-dust : #dadada; --medium-dust : #dadada;
--dark-dust : #bfbfbf; --dark-dust : #bfbfbf;
--fade : #878787; --fade : #878787;
--twilight : #4a4a4a; --twilight : #4a4a4a;
--dark : #2a2a2a; --dark : #2a2a2a;
--light-custard : #eee7d5;
--custard : #f0dcac; --custard : #f0dcac;
--dark-custard : #d4c7a9;
--water : #a8f3f4; --water : #a8f3f4;
--splash : #4b3aba; --splash : #4b3aba;
@ -53,6 +55,7 @@ p, h1, h2, h3, h4, h5, h6 {
html, body { html, body {
height : 100%; height : 100%;
font-size : 1.05em;
} }
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
@ -64,6 +67,14 @@ a {
font-weight : 500; font-weight : 500;
color : var(--splash); color : var(--splash);
text-decoration : none; text-decoration : none;
cursor : pointer;
}
hr {
margin : var(--double-space) 0;
height : 0;
border : 0;
border-bottom : 1px solid var(--dark-custard);
} }
body { body {
@ -102,7 +113,7 @@ header > a.logout:hover {
} }
aside { aside {
padding : var(--double-space) var(--outer-space); padding : 0 var(--outer-space) var(--double-space) var(--outer-space);
background : var(--light); background : var(--light);
} }
@ -141,7 +152,7 @@ aside > div > dl > dt {
nav { nav {
display : block; display : block;
border-bottom : 1px solid var(--dark-dust); border-bottom : 1px solid var(--dark-custard);
background : var(--light); background : var(--light);
} }
@ -188,14 +199,14 @@ article {
padding : var(--double-space) var(--outer-space); padding : var(--double-space) var(--outer-space);
} }
article > div { article > div.content-view {
background : var(--dust); background : var(--dust);
padding : var(--double-space); padding : var(--double-space);
margin-bottom : var(--double-space); margin-bottom : var(--space);
} }
div.content-view > h2 { div.content-view > h2 {
margin : 0 0 var(--double-space) 0; margin : 0 0 var(--space) 0;
} }
div.services { div.services {
@ -236,22 +247,32 @@ button {
color : var(--light); color : var(--light);
background : var(--splash); background : var(--splash);
padding : var(--space) var(--double-space); padding : var(--space) var(--double-space);
border-radius : 3px; border-radius : var(--quarter-space);
opacity : 0.9; opacity : 0.85;
cursor : pointer; cursor : pointer;
text-align : center; text-align : center;
border : 0; border : 0;
font-weight : 600; font-weight : 600;
letter-spacing : 0.03em;
text-decoration : none; text-decoration : none;
} }
button.small {
font-size : 0.78em;
padding : var(--half-space) var(--space);
}
div.services > div > a:hover, div.services > div > a:hover,
a.button:hover, a.button:hover,
button:hover { button:hover {
opacity : 1.0; opacity : 1.0;
} }
button:disabled {
opacity : 0.6;
background : var(--twilight);
cursor : default;
}
article table { article table {
width : 100%; width : 100%;
border-spacing : 0; border-spacing : 0;
@ -259,16 +280,47 @@ article table {
} }
article table thead th { article table thead th {
text-align : left; background : var(--twilight);
color : var(--medium-dust);
}
article table thead th a {
color : var(--light);
}
article table thead th:first-child {
border-radius : var(--half-space) 0 0 0;
}
article table thead th:last-child {
border-radius : 0 var(--half-space) 0 0;
}
article table tbody {
background : var(--light-dust);
} }
article table tbody tr:nth-child(odd) { article table tbody tr:nth-child(odd) {
background : var(--medium-dust); background : var(--light-custard);
} }
article table tbody tr:nth-child(odd) td {
border-top : 1px solid var(--dark-custard);
border-bottom : 1px solid var(--dark-custard);
}
article table tbody tr:last-child td {
border-bottom : var(--half-space) solid var(--twilight);
}
article table thead th, article table thead th,
article table tbody td { article table tbody td {
padding : var(--half-space); padding : var(--space);
text-align : left;
}
article table#user_email_table tbody tr td:first-child {
text-align : center;
} }
form > div { form > div {
@ -281,7 +333,8 @@ form > div >label {
} }
form > div > input[type="text"], form > div > input[type="text"],
form > div > input[type="password"] { form > div > input[type="password"],
input[type="email"] {
border : 2px solid var(--twilight); border : 2px solid var(--twilight);
border-radius : 6px; border-radius : 6px;
padding : 8px; padding : 8px;
@ -289,6 +342,19 @@ form > div > input[type="password"] {
width : 100%; width : 100%;
} }
form fieldset {
border : 0;
padding : 0;
margin : 0;
}
form div.buttonHolder {
}
form div.buttonHolder button {
display : inline-block;
}
#login { #login {
height : 100%; height : 100%;
display : flex; display : flex;
@ -375,10 +441,48 @@ span.time_remaining {
display : flex; display : flex;
justify-content : center; justify-content : center;
list-style : none; list-style : none;
padding : 0; padding : var(--half-space) 0;
margin : 0; margin : 0;
} }
.pagination > li { .pagination > li {
margin : 0 6px; margin : 0 var(--half-space);
}
.pagination > li:first-child {
margin-right : var(--double-space);
}
.pagination > li:last-child {
margin-left : var(--double-space);
}
.pagination .page-item {
border : 1px solid var(--fade);
padding : var(--quarter-space) var(--half-space);
border-radius : var(--half-space);
background : var(--light-dust);
font-size : 0.78em;
}
.pagination .page-link {
padding : var(--half-space);
color : var(--twilight);
}
.pagination .page-item.active {
background : var(--twilight);
}
.pagination .page-item.active .page-link {
color : var(--light-dust);
font-weight : bold;
}
.pagination .page-item.disabled {
opacity : 0.6;
}
.pagination .page-item.disabled .page-link {
cursor : default;
} }

View file

@ -2,115 +2,96 @@
{% load i18n %} {% load i18n %}
{% block head_title %}{% trans "E-mail Addresses" %}{% endblock %} {% block head_title %}{% trans "Email Addresses" %}{% endblock %}
{% block content %} {% block content %}
<div class="content-view">
<h2>{% trans "Email Addresses" %}</h2>
<p>Her kan du tilføje og ændre emailadresser tilknyttet din konto.</p>
<p>{% trans 'The following email addresses are associated with your account:' %}</p>
<div class="row"> <hr />
<div class="col-md-12">
<div class="panel panel-default"> {% if user.emailaddress_set.all %}
<div class="panel-heading"> <form action="{% url 'account_email' %}" class="email_list" method="post">
<h4>{% trans "E-mail Addresses" %}</h4> {% csrf_token %}
</div> <fieldset class="blockLabels">
<div class="panel-body"> <div class="buttonHolder">
<button class="small" type="submit" name="action_primary" style="float:right">+ Add Email</button>
<button class="small" disabled type="submit" id="action_primary" name="action_primary">Make Primary</button>
<button class="small" type="submit" name="action_send">Re-send Verification</button>
<button class="small" type="submit" name="action_remove">Remove</button>
</div>
<table class="table" id="user_email_table">
<thead>
<tr>
<th></th>
<th>{% trans "Address" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "Primary" %}</th>
</tr>
</thead>
<tbody>
{% for emailaddress in user.emailaddress_set.all %}
<tr>
<label for="email_radio_{{ forloop.counter }}"
class="{% if emailaddress.primary %}primary_email{% endif %}">
<td>
<input
id="email_radio_{{ forloop.counter }}"
type="radio"
name="email"
value="{{ emailaddress.email }}"
{% if emailaddress.primary or user.emailaddress_set.count == 1 %}
checked="checked"
{% endif %}
class="{% if emailaddress.primary %}primary_email{% endif %}"
/>
</td>
<td>
{{ emailaddress.email }}
</td>
<td>
{% if emailaddress.verified %}
<span class="label label-success">{% trans "Verified" %}</span>
{% else %}
<span class="label label-danger">{% trans "Unverified" %}</span>
{% endif %}
</td>
<td>
{% if emailaddress.primary %}
<span class="label label-primary">{% trans "Primary" %}</span>
{% endif %}
</td>
</label>
</tr>
{% endfor %}
{% if user.emailaddress_set.all %} </tbody>
<p>{% trans 'The following e-mail addresses are associated with your account:' %}</p> </table>
<form action="{% url 'account_email' %}" class="email_list" </fieldset>
method="post"> </form>
{% csrf_token %} {% else %}
<fieldset class="blockLabels"> <p>
<strong>{% trans 'Warning:' %}</strong>
<table class="table"> {% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
<thead> </p>
<tr> {% endif %}
<th></th> <!--
<th>{% trans "Address" %}</th> <hr />
<th>{% trans "Status" %}</th>
<th>{% trans "Primary" %}</th>
</tr>
</thead>
<tbody>
{% for emailaddress in user.emailaddress_set.all %}
<tr class="ctrlHolder">
<label for="email_radio_{{ forloop.counter }}"
class="{% if emailaddress.primary %}primary_email{% endif %}">
<td>
<input
id="email_radio_{{ forloop.counter }}"
type="radio"
name="email"
value="{{ emailaddress.email }}"
{% if emailaddress.primary or user.emailaddress_set.count == 1 %}
checked="checked"
{% endif %}
/>
</td>
<td>
{{ emailaddress.email }}
</td>
<td>
{% if emailaddress.verified %}
<span class="label label-success">Verified</span>
{% else %}
<span class="label label-danger">Unverified</span>
{% endif %}
</td>
<td>
{% if emailaddress.primary %}
<span class="label label-primary">Primary</span>{% endif %}
</td>
</label>
</tr>
{% endfor %}
</tbody>
</table>
<div class="buttonHolder">
<button class="btn btn-success" type="submit"
name="action_primary">Make Primary
</button>
<button class="btn btn-primary" type="submit"
name="action_send">Re-send Verification
</button>
<button class="btn btn-danger" type="submit"
name="action_remove">Remove
</button>
</div>
</fieldset>
</form>
{% else %}
<p>
<strong>{% trans 'Warning:' %}</strong>
{% trans "You currently do not have any e-mail address set up. You should really add an e-mail address so you can receive notifications, reset your password, etc." %}
</p>
{% endif %}
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4>{% trans "Add E-mail" %}</h4>
</div>
<div class="panel-body">
<form method="post" action="{% url 'account_email' %}"
class="add_email">
{% csrf_token %}
{{ form.as_p }}
<button name="action_add" class="btn btn-success" type="submit">
{% trans "Add E-mail" %}
</button>
</form>
</div>
</div>
<h3>{% trans "Add E-mail" %}</h3>
<div class="panel-body">
<form method="post" action="{% url 'account_email' %}"
class="add_email">
{% csrf_token %}
{{ form.as_p }}
<button name="action_add" class="btn btn-success" type="submit">
{% trans "Add E-mail" %}
</button>
</form>
</div> </div>
-->
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
@ -124,6 +105,15 @@
} }
}); });
} }
let radio_actions = document.getElementsByName('email');
if (radio_actions.length) {
for (radio of radio_actions) {
radio.addEventListener("change", function (e) {
document.getElementById('action_primary').disabled = e.target.classList.contains('primary_email')
});
}
}
})(); })();
</script> </script>

View file

@ -13,20 +13,20 @@
</div> </div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
<h2>Log in</h2> <h2>Login</h2>
<form method="post" action=""> <form method="post" action="">
{% csrf_token %} {% csrf_token %}
<div> <div>
<label for="id_username" <label for="id_username"
class="visually-hidden"> class="visually-hidden">
{% trans "E-mail" %} {% trans "Email" %}
</label> </label>
<input type="text" <input type="text"
id="id_username" id="id_username"
name="login" name="login"
class="form-control mb-lg-2" class="form-control mb-lg-2"
placeholder="{% trans "E-mail" %}" placeholder="{% trans "Email" %}"
required required
autofocus> autofocus>
</div> </div>
@ -42,7 +42,7 @@
required> required>
</div> </div>
<div> <div>
<button type="submit">{% trans "Sign in" %}</button> <button type="submit">{% trans "Login" %}</button>
</div> </div>
</form> </form>
<div> <div>
@ -55,7 +55,7 @@
<div class="signup"> <div class="signup">
<img src="https://data.coop/static/img/logo_da.svg" alt="data.coop logo"> <img src="https://data.coop/static/img/logo_da.svg" alt="data.coop logo">
<div class="new_here"> <div class="new_here">
<h2> Are you new here? </h2> <h2>{% trans "Are you new here?" %}</h2>
<a class="button" href="{% url "account_signup" %}">{% trans "Become a member" %}</a> <a class="button" href="{% url "account_signup" %}">{% trans "Become a member" %}</a>
</div> </div>
</div> </div>