changeset 71:a14845624e01

display a banner on top of all pages (but adhesion, adhesion_form and thank_you) to encourage people joining the association
author souliane <souliane@mailoo.org>
date Wed, 27 May 2015 18:56:16 +0200
parents d6bf5414c6c4
children ac83544a7645
files sat_website/local_settings.py sat_website/views.py static/css/sat_website.css templates/sat_website/adhesion.html templates/sat_website/base.html templates/sat_website/finance.html templates/sat_website/overview.html
diffstat 7 files changed, 71 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/sat_website/local_settings.py	Wed May 27 14:50:51 2015 +0200
+++ b/sat_website/local_settings.py	Wed May 27 18:56:16 2015 +0200
@@ -146,10 +146,3 @@
 ASSO_URL_STATUTES = 'http://repos.goffi.org/sat_docs/raw-file/tip/association/statuts.pdf'
 ASSO_URL_RULES = 'http://repos.goffi.org/sat_docs/raw-file/tip/association/r%C3%A8glement%20int%C3%A9rieur.pdf'
 
-# Import another settings file that can override these settings (for example to daily update the stats when you don't want a script to directly modify this file)
-from sys import path
-path.append('/home/souliane')
-try:
-    from sat_website_external_settings import *
-except ImportError:
-    pass
--- a/sat_website/views.py	Wed May 27 14:50:51 2015 +0200
+++ b/sat_website/views.py	Wed May 27 18:56:16 2015 +0200
@@ -74,6 +74,7 @@
                })
 
     context.update(csrf(request))
+    context.update(utils.get_asso_finance_status())
 
     if not category or category == "overview":
         context.update(utils.get_asso_finance_status())
@@ -86,7 +87,6 @@
     elif category == "downloads":
         context["projects_infos"] = utils.get_projects_infos(PROJECTS_INFOS)
     elif category in ("association", "adhesion"):
-        context.update(utils.get_asso_finance_status())
         context.update(utils.get_asso_urls())
     elif category == "adhesion_form":
         if request.method == 'POST':
--- a/static/css/sat_website.css	Wed May 27 14:50:51 2015 +0200
+++ b/static/css/sat_website.css	Wed May 27 18:56:16 2015 +0200
@@ -19,9 +19,8 @@
 
 /* Overriding Bootstrap styles */
 
-
 body {
-  padding-top: 70px;
+  padding-top: 50px;
   padding-bottom: 30px;
 }
 
@@ -84,6 +83,26 @@
     color: #bbb;
 }
 
+/* prevent collapsing to overlap the body when the navbar is fixed to top */
+@media (max-width: 991px) {
+    .navbar-header {
+        float: none;
+    }
+    .navbar-toggle {
+        display: block;
+    }
+    .navbar-collapse.collapse {
+        display: none !important;
+    }
+    .navbar-collapse.collapse.in { 
+        display: block !important;
+    }
+    .collapsing {
+        overflow: hidden !important;
+    }
+}
+
+
 /* sat_website own styles */
 
 
@@ -215,4 +234,15 @@
 
 .presstitle {
     font-style: italic;
+}
+
+.banner {
+    border-radius: 0px;
+    border-left: 0px;
+    border-right: 0px;
+    min-height: 20px;
+}
+
+.banner a {
+    float: right;
 }
\ No newline at end of file
--- a/templates/sat_website/adhesion.html	Wed May 27 14:50:51 2015 +0200
+++ b/templates/sat_website/adhesion.html	Wed May 27 18:56:16 2015 +0200
@@ -51,6 +51,7 @@
             Which makes, with an average annual contribution of 10 € per subscription, {{ asso_members_target }} members before December, 31<sup>st</sup> 2015!
             {% endblocktrans %}
         </p>
+        {% include "sat_website/finance.html" with obj="members" %}
         {% include "sat_website/finance.html" %}
         <p>{% trans "The membership lasts exactly one year and isn't automatically renewed: you have to renew it yourself and you can change the amount of your subscription every year." %}</p>
         <p>
--- a/templates/sat_website/base.html	Wed May 27 14:50:51 2015 +0200
+++ b/templates/sat_website/base.html	Wed May 27 18:56:16 2015 +0200
@@ -35,6 +35,21 @@
     <title>{% block title %}{% trans "Salut à Toi: the multi frontend, multipurpose communication tool" %}{% endblock %}</title>
 </head>
 <body role="document">
+    {% if category != "adhesion" and category != "adhesion_form" and category != "thank_you" %}
+	    <div class="alert alert-info banner">
+	        <div class="container"><div class="row">
+	            <div class="col-md-10">
+			        {% trans "We need your support to continue and move forward! Take the time to read about what we do. If you like it, please join the association." %}
+			        {% include "sat_website/finance.html" %}
+	            </div>
+	            <div class="col-md-2">
+	                <a class="btn btn-default" href="adhesion.html" role="button">{% trans "Adhesion" %}</a>
+	            </div>
+	        </div></div>
+	    </div>
+	{% else %}
+	    <div class="banner"></div>
+    {% endif %}
     <nav class="navbar navbar-inverse navbar-fixed-top">
         <div class="container">
             <div class="navbar-header" id="navbar-header">
--- a/templates/sat_website/finance.html	Wed May 27 14:50:51 2015 +0200
+++ b/templates/sat_website/finance.html	Wed May 27 18:56:16 2015 +0200
@@ -20,7 +20,26 @@
 
 {% load i18n %}
 
+{% if obj == "members" %}
+
 <div class="progress">
-    <div class="progress-bar progress-bar-success progress-bar-striped" style="width: {{ asso_members_perc }}%">{% blocktrans with members_actual=asso_members_actual %}{{members_actual}} members{% endblocktrans %}</div>
-    <div class="progress-bar progress-bar-left progress-bar-striped active" style="width: {{ asso_members_perc_left }}%">{% blocktrans with members_left=asso_members_left %}{{members_left}} left{% endblocktrans %}</div>
+    <div class="progress-bar progress-bar-info progress-bar-striped" style="width: {{ asso_members_perc }}%">
+        {% blocktrans with actual=asso_members_actual %}{{ actual }} members{% endblocktrans %}
+    </div>
+    <div class="progress-bar progress-bar-left progress-bar-striped active" style="width: {{ asso_members_perc_left }}%">
+        {% blocktrans with left=asso_members_left %}{{ left }} members left{% endblocktrans %}
+    </div>
 </div>
+
+{% else %}
+
+<div class="progress">
+    <div class="progress-bar progress-bar-success progress-bar-striped" style="width: {{ asso_finance_perc }}%">
+        {% blocktrans with actual=asso_finance_actual %}{{ actual }} €{% endblocktrans %}
+    </div>
+    <div class="progress-bar progress-bar-left progress-bar-striped active" style="width: {{ asso_finance_perc_left }}%">
+        {% blocktrans with left=asso_finance_left %}{{ left }} € left{% endblocktrans %}
+    </div>
+</div>
+
+{% endif %}
\ No newline at end of file
--- a/templates/sat_website/overview.html	Wed May 27 14:50:51 2015 +0200
+++ b/templates/sat_website/overview.html	Wed May 27 18:56:16 2015 +0200
@@ -95,6 +95,7 @@
         <div class="well">
             <h4>{% trans "The association" %}</h4>
             <p>{% blocktrans %}Salut à Toi and Libervia are developed by a non-profit and self-managed association. We are fighting against the hold-up of the Internet by private corporations and abusive governmental control. Do you want to help us? The membership is open to everybody and the amount of the contribution is up to you, from 0 to 100€. Even joining for free means something to us, it is moral support! {% endblocktrans %}</p>
+            {% include "sat_website/finance.html" with obj="members" %}
             {% include "sat_website/finance.html" %}
             <p>
                 <a class="btn btn-default" href="adhesion.html" role="button">{% trans "Adhesion" %}</a>