merge with master
authorSofia Papagiannaki <papagian@gmail.com>
Fri, 23 Mar 2012 16:28:15 +0000 (18:28 +0200)
committerSofia Papagiannaki <papagian@gmail.com>
Fri, 23 Mar 2012 16:28:15 +0000 (18:28 +0200)
12 files changed:
snf-astakos-app/Changelog
snf-astakos-app/astakos/im/context_processors.py
snf-astakos-app/astakos/im/settings.py
snf-astakos-app/astakos/im/static/im/css/styles.css
snf-astakos-app/astakos/im/static/im/css/styles.less
snf-astakos-app/astakos/im/static/im/less/xtra.less
snf-astakos-app/astakos/im/synnefo_settings.py
snf-astakos-app/astakos/im/templates/im/account_base.html
snf-astakos-app/astakos/im/templates/im/base.html
snf-astakos-app/astakos/im/templates/im/login.html
snf-astakos-app/astakos/im/templates/im/login_base.html [new file with mode: 0644]
snf-astakos-app/conf/20-snf-astakos-app-settings.conf

index 108bbda..77fa21b 100644 (file)
@@ -1,3 +1,18 @@
+v0.3.7
+======
+
+- New ASTAKOS_PROFILE_EXTRA_LINKS setting to display additional buttons on
+  account pages.
+
+
+v0.3.6
+======
+
+- New ASTAKOS_LOGIN_MESSAGES setting to display messages on the login page
+  header
+- login_base.html to make it easy override the login.html template
+
+
 v0.3.5
 ======
 
index d19e105..cfc8c09 100644 (file)
@@ -32,7 +32,7 @@
 # or implied, of GRNET S.A.
 
 from astakos.im.settings import IM_MODULES, INVITATIONS_ENABLED, IM_STATIC_URL, \
-        COOKIE_NAME
+        COOKIE_NAME, LOGIN_MESSAGES, PROFILE_EXTRA_LINKS
 from astakos.im.api import get_menu
 
 from django.conf import settings
@@ -55,6 +55,12 @@ def invitations(request):
 def media(request):
     return {'IM_STATIC_URL' : IM_STATIC_URL}
 
+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)
     resp = get_menu(request, True, False)
index 40fa8bf..9d7f1ff 100644 (file)
@@ -70,3 +70,10 @@ LOGOUT_NEXT = getattr(settings, 'ASTAKOS_LOGOUT_NEXT', '')
 
 # Set user email patterns that are automatically activated
 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', {})
+
index 77c3b49..6bc75f2 100644 (file)
@@ -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;
index 1b765d8..ec1997a 100644 (file)
@@ -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 {
index ba0db52..02d50a1 100644 (file)
@@ -16,7 +16,6 @@
 .button {
     #font.main();
     background-color: @buttonBg;
-    .transit(background-color);
     color: @buttonColor;
     border: none;
     padding: 0.8em @gridGutterWidth;
         background-color: @linkColor;    
     }
 
-    a {
-        color: @white !important;
-        text-decoration: none !important;
-        border: none !important;
+    &.back {
+        text-decoration: none;
+        bottom: 0;
+        float: right;
+        &.right { right: 0}
+        z-index: 500;
     }
 }
 
-a.button {
-    color: @white !important;
-    text-decoration: none !important;
-    border: none !important;
-}
-
-// specific styles for A buttons
-a.button {
-    text-align: center !important;
-    color: #fff !important;
-    border: none !important;
-    display: block !important;
-
-    &:hover {
-        color: #fff !important;    
-    }
-}
-
-// specific styles for A buttons
-a.button {
-    text-align: center !important;
-    color: #fff !important;
-    border: none !important;
-    display: block !important;
+.buttons-list {
+    z-index: 300;
+    position: relative;
+    .button {
+        margin-left: 10px;    
+    }    
 
-    &:hover {
-        color: #fff !important;    
+    &.fixpos {
+        margin-top: -42px;    
     }
 }
 
index 36cdc18..afd1545 100644 (file)
@@ -54,6 +54,7 @@ context_processors = [
     'astakos.im.context_processors.code',
     'astakos.im.context_processors.invitations',
     'astakos.im.context_processors.menu',
+    'astakos.im.context_processors.custom_messages',
     'synnefo.lib.context_processors.cloudbar'
 ]
 
index ebfb26d..98ceb36 100644 (file)
 {% 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 %}
index 8fcbaa8..a55f501 100644 (file)
@@ -89,8 +89,9 @@
             </div>
             {% endblock %}
         </div>
-        {% if messages %}
+        {% if messages or LOGIN_MESSAGES %}
         <ul class="messages">
+            {% block extra_messages %}{% endblock %}
             {% for message in messages %}
             <li{% if message.tags %} 
                 class="{{ message.tags }}"{% endif %}>
         </div>
     </div>
     <div class="footer">
+        {% block footer_content %}
+        <div class="last row">
+            Copyright 2011-2012 <a href="http://www.grnet.gr" alt="GRNET S.A.">GRNET S.A.</a> All rights reserved.
+        </div>
+        {% endblock %}
     </div>
 </body>
 </html>
index abfd1d7..b7e1e37 100644 (file)
@@ -1,55 +1 @@
-{% extends 'im/base_two_cols.html'%}
-
-{% block signup_class %}hidden{% endblock %}
-{% block page.title %}
-Login
-{% endblock %}
-
-{% block body %}
-<div class="section">
-    <img class="pic" src="{{ IM_STATIC_URL }}images/pictures/login_pic.png" />
-</div>
-{% comment %}{% include "im/services_description.html" %}{% endcomment %}
-{% endblock body %}
-    
-{% block body.right %}
-<div class="section">
-     {% if "local" in im_modules %}
-        <form action="{% url astakos.im.target.local.login %}" method="post"
-            class="login innerlabels">{% csrf_token %}
-            <h2 class="formheader"><span>LOGIN</span></h2>
-            {% include "im/form_render.html" %}
-            <input type="hidden" name="next" value="{{ next }}">
-            <div class="form-row submit">
-                <input type="submit" class="submit altcol" value="SUBMIT" />
-                <a class="extra-link" href="{% url django.contrib.auth.views.password_reset %}">Forgot your password?</a>
-            </div>
-        </form>
-      {% endif %}
-
-          <div class="extralogin">
-              {% for o in im_modules %}
-              <div>
-            {% if o != 'local' %}
-            LOGIN using 
-            <a href="/im/login/{{ o }}{% ifnotequal next "" %}?next={{ next|urlencode }}{% endifnotequal %}" 
-                alt="{{ o|title }}">{{ o }}</a>
-            {% endif %}
-            </div>
-            {% endfor %}
-        </div>
-        {% block body.signup %}
-        {% for o in im_modules %}
-            {% if o != 'local' %}
-            <br />
-            {% endif %}
-        {% endfor %}
-        <div class="bottom">
-            {% block body.login.signup %}
-                new to okeanos ? <a href="{% url astakos.im.views.signup %}">CREATE ACCOUNT</a>
-            {% endblock %}
-            </div>
-        </div>
-        {% endblock %}
-    </div>
-{% endblock %}
+{% extends "im/login_base.html" %}
diff --git a/snf-astakos-app/astakos/im/templates/im/login_base.html b/snf-astakos-app/astakos/im/templates/im/login_base.html
new file mode 100644 (file)
index 0000000..8be10cf
--- /dev/null
@@ -0,0 +1,63 @@
+{% extends 'im/base_two_cols.html'%}
+
+{% block extra_messages %}
+    {% if not messages %}
+        {% for msg_type, msg in LOGIN_MESSAGES.items %}
+            <li class="{{ msg_type }}">{{ msg|safe }}</li>
+        {% endfor %}
+    {% endif %}
+{% endblock %}
+
+{% block signup_class %}hidden{% endblock %}
+{% block page.title %}
+Login
+{% endblock %}
+
+{% block body %}
+<div class="section">
+    <img class="pic" src="{{ IM_STATIC_URL }}images/pictures/login_pic.png" />
+</div>
+{% comment %}{% include "im/services_description.html" %}{% endcomment %}
+{% endblock body %}
+    
+{% block body.right %}
+<div class="section">
+     {% if "local" in im_modules %}
+        <form action="{% url astakos.im.target.local.login %}" method="post"
+            class="login innerlabels">{% csrf_token %}
+            <h2 class="formheader"><span>LOGIN</span></h2>
+            {% include "im/form_render.html" %}
+            <input type="hidden" name="next" value="{{ next }}">
+            <div class="form-row submit">
+                <input type="submit" class="submit altcol" value="SUBMIT" />
+                <a class="extra-link" href="{% url django.contrib.auth.views.password_reset %}">Forgot your password?</a>
+            </div>
+        </form>
+      {% endif %}
+
+          <div class="extralogin">
+              {% for o in im_modules %}
+              <div>
+            {% if o != 'local' %}
+            LOGIN using 
+            <a href="/im/login/{{ o }}{% ifnotequal next "" %}?next={{ next|urlencode }}{% endifnotequal %}" 
+                alt="{{ o|title }}">{{ o }}</a>
+            {% endif %}
+            </div>
+            {% endfor %}
+        </div>
+        {% block body.signup %}
+        {% for o in im_modules %}
+            {% if o != 'local' %}
+            <br />
+            {% endif %}
+        {% endfor %}
+        <div class="bottom">
+            {% block body.login.signup %}
+                new to okeanos ? <a href="{% url astakos.im.views.signup %}">CREATE ACCOUNT</a>
+            {% endblock %}
+            </div>
+        </div>
+        {% endblock %}
+    </div>
+{% endblock %}
index a18fc67..38095de 100644 (file)
 #ASTAKOS_LOGOUT_NEXT = ''
 
 # Set user email patterns that are automatically activated
-#RE_USER_EMAIL_PATTERNS = getattr(settings, 'ASTAKOS_RE_USER_EMAIL_PATTERNS', [])
+#ASTAKOS_RE_USER_EMAIL_PATTERNS = []
+
+# 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 = {}