Commit b78fc030 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Display additional actions in account pages forms

Configurable by the ASTAKOS_PROFILE_EXTRA_LINKS
parent 49210315
v0.3.7
======
- New ASTAKOS_PROFILE_EXTRA_LINKS setting to display additional buttons on
account pages.
v0.3.6
======
......
......@@ -32,7 +32,7 @@
# or implied, of GRNET S.A.
from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, IM_STATIC_URL, \
COOKIE_NAME, LOGIN_MESSAGES
COOKIE_NAME, LOGIN_MESSAGES, PROFILE_EXTRA_LINKS
from astakos.im.api import get_menu
from django.conf import settings
......@@ -54,8 +54,11 @@ def invitations(request):
def media(request):
return {'IM_STATIC_URL' : IM_STATIC_URL}
def login_messages(request):
return {'LOGIN_MESSAGES' : LOGIN_MESSAGES }
def custom_messages(request):
return {
'LOGIN_MESSAGES' : LOGIN_MESSAGES,
'PROFILE_EXTRA_LINKS' : PROFILE_EXTRA_LINKS
}
def menu(request):
absolute = lambda (url): request.build_absolute_uri(url)
......
......@@ -68,3 +68,6 @@ RE_USER_EMAIL_PATTERNS = getattr(settings, 'ASTAKOS_RE_USER_EMAIL_PATTERNS', [])
# messages to display on login page header
LOGIN_MESSAGES = getattr(settings, 'ASTAKOS_LOGIN_MESSAGES', {})
# messages to display on login page header
PROFILE_EXTRA_LINKS = getattr(settings, 'ASTAKOS_PROFILE_EXTRA_LINKS', {})
......@@ -208,6 +208,25 @@ textarea {
.button:hover {
background-color: #f89a1c;
}
.button.back {
text-decoration: none;
bottom: 0;
float: right;
z-index: 500;
}
.button.back.right {
right: 0;
}
.buttons-list {
z-index: 300;
position: relative;
}
.buttons-list .button {
margin-left: 10px;
}
.buttons-list.fixpos {
margin-top: -42px;
}
a.button {
text-align: center !important;
color: #fff !important;
......@@ -451,6 +470,25 @@ table .headerSortUp.purple, table .headerSortDown.purple {
.button:hover {
background-color: #f89a1c;
}
.button.back {
text-decoration: none;
bottom: 0;
float: right;
z-index: 500;
}
.button.back.right {
right: 0;
}
.buttons-list {
z-index: 300;
position: relative;
}
.buttons-list .button {
margin-left: 10px;
}
.buttons-list.fixpos {
margin-top: -42px;
}
a.button {
text-align: center !important;
color: #fff !important;
......@@ -955,6 +993,7 @@ form .form-row {
}
form .form-row.submit {
margin-top: 22px;
z-index: 10;
}
form .form-row .extra-link {
color: #808080;
......@@ -1047,9 +1086,27 @@ form input.submit, form input[type="submit"] {
form input.submit:hover, form input[type="submit"]:hover {
background-color: #f89a1c;
}
form input.submit.back, form input[type="submit"].back {
text-decoration: none;
bottom: 0;
float: right;
z-index: 500;
}
form input.submit.back.right, form input[type="submit"].back.right {
right: 0;
}
form input.submit:hover, form input[type="submit"]:hover {
background-color: #f89a1c;
}
form input.submit.back, form input[type="submit"].back {
text-decoration: none;
bottom: 0;
float: right;
z-index: 500;
}
form input.submit.back.right, form input[type="submit"].back.right {
right: 0;
}
form textarea {
height: 200px;
width: 350px !important;
......@@ -1427,46 +1484,6 @@ table tr.consumed td.consumed {
.initial_hidden {
display: none;
}
/*resources styles*/
.resources .categories ul {
zoom: 1;
}
.resources .categories ul:before, .resources .categories ul:after {
display: table;
content: "";
zoom: 1;
}
.resources .categories ul:after {
clear: both;
}
.resources .categories ul li {
float: left;
}
.resources .categories .title {
margin-bottom: 7.333333333333333px;
}
.resources .categories ul li a {
text-decoration: none;
color: #faaf40;
margin-right: 22px;
}
.resources .list {
margin-top: 58.666666666666664px;
}
.resources .list .resource {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
*behavior: url(boxsizing.htc);
width: 33%;
padding: 29.333333333333332px;
float: left;
border: 1px solid #faaf40;
height: 176px;
}
.resources .list .resource .description {
display: none;
}
/* recaptcha */
#recaptcha_widget_div {
margin-top: 10px;
......
......@@ -428,6 +428,7 @@ form {
position: relative;
&.submit {
margin-top: 1.5*@verticalSpacing;
z-index: 10;
}
.extra-link {
......@@ -763,45 +764,6 @@ table {
display: none;
}
/*resources styles*/
@resCol: #FAAF40;
.resources {
.categories {
ul { .clearfix() }
ul li { float: left; }
.title {
margin-bottom: @verticalSpacing/2;
}
ul li a {
text-decoration: none;
color: @resCol;
margin-right: @gridGutterWidth;
}
}
.list {
margin-top: 4*@verticalSpacing;
.resource {
.border-box();
width: 33%;
padding: 2*@verticalSpacing;
float: left;
border: 1px solid @resCol;
height: 12*@verticalSpacing;
.description {
display: none;
}
}
}
}
/* recaptcha */
#recaptcha_widget_div {
......
......@@ -24,6 +24,26 @@
&:hover {
background-color: @linkColor;
}
&.back {
text-decoration: none;
bottom: 0;
float: right;
&.right { right: 0}
z-index: 500;
}
}
.buttons-list {
z-index: 300;
position: relative;
.button {
margin-left: 10px;
}
&.fixpos {
margin-top: -42px;
}
}
// specific styles for A buttons
......
......@@ -54,7 +54,7 @@ context_processors = [
'astakos.im.context_processors.code',
'astakos.im.context_processors.invitations',
'astakos.im.context_processors.menu',
'astakos.im.context_processors.login_messages',
'astakos.im.context_processors.custom_messages',
'synnefo.lib.context_processors.cloudbar'
]
......
......@@ -22,5 +22,15 @@
{% block page.body %}
<div class="maincol {% block innerpage.class %}full{% endblock %}">
{% block body %}{% endblock %}
{% if PROFILE_EXTRA_LINKS %}
<div class="extra-buttons buttons-list fixpos">
{% for href, name in PROFILE_EXTRA_LINKS.items %}
<a class="button back right" href="{{ href }}">{{ name }}</a>
{% endfor %}
</div>
{% endif %}
</div>
{% endblock %}
......@@ -69,3 +69,8 @@
# Messages to display on login page header
# e.g. {'warning': 'This warning message will be displayed on the top of login page'}
#ASTAKOS_LOGIN_MESSAGES = {}
# messages to display as extra actions in account forms
# e.g. {'https://cms.okeanos.grnet.gr/': 'Back to ~okeanos'}
#ASTAKOS_PROFILE_EXTRA_LINKS = {}
Markdown is supported
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