diff --git a/cotisations/templates/cotisations/aff_article.html b/cotisations/templates/cotisations/aff_article.html
index 2afe726d..558dd7a2 100644
--- a/cotisations/templates/cotisations/aff_article.html
+++ b/cotisations/templates/cotisations/aff_article.html
@@ -35,7 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% trans "Cotisation type" %} |
{% trans "Duration (month)" %} |
{% trans "Concerned users" %} |
- {% trans "Available for everyone" | tick %} |
+ {% trans "Available for everyone" %} |
|
@@ -46,7 +46,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{{ article.type_cotisation }} |
{{ article.duration }} |
{{ article.type_user }} |
- {{ article.available_for_everyone }} |
+ {{ article.available_for_everyone|tick }} |
{% can_edit article %}
diff --git a/re2o/context_processors.py b/re2o/context_processors.py
index 7cb965cc..6beac564 100644
--- a/re2o/context_processors.py
+++ b/re2o/context_processors.py
@@ -26,7 +26,7 @@ from __future__ import unicode_literals
import datetime
from django.contrib import messages
-
+from django.http import HttpRequest
from preferences.models import GeneralOption, OptionalMachine
from django.utils.translation import get_language
@@ -40,7 +40,10 @@ def context_user(request):
else:
global_message = GeneralOption.get_cached_value('general_message_en')
if global_message:
- messages.warning(request, global_message)
+ if isinstance(request, HttpRequest):
+ messages.warning(request, global_message)
+ else:
+ messages.warning(request._request, global_message)
if user.is_authenticated():
interfaces = user.user_interfaces()
else:
diff --git a/re2o/contributors.py b/re2o/contributors.py
index 92b349a5..ac663d9c 100644
--- a/re2o/contributors.py
+++ b/re2o/contributors.py
@@ -27,5 +27,7 @@ CONTRIBUTORS = [
'Hugo "Shaka" Hervieux',
'"Mikachu"',
'Thomas "Nymous" Gaudin',
- '"Esum"'
+ 'Benjamin "Esum" Graillot',
+ 'Gabriel "Boudy" Le Bouder',
+ 'Charlie "Le membre" Jacomme',
]
diff --git a/re2o/management/commands/gen_contrib.py b/re2o/management/commands/gen_contrib.py
index 6003b30f..9951a383 100644
--- a/re2o/management/commands/gen_contrib.py
+++ b/re2o/management/commands/gen_contrib.py
@@ -41,7 +41,7 @@ class Command(BaseCommand):
self.stdout.write(self.style.SUCCESS("Exportation Sucessfull"))
with open("re2o/contributors.py", "w") as contrib_file:
contrib_file.write("\"\"\"re2o.contributors\n")
- contrib_file.write("A list of the proud contributors to Re2o\n")
+ contrib_file.write("A list of the contributors to Re2o\n")
contrib_file.write("\"\"\"\n")
contrib_file.write("\n")
contrib_file.write("CONTRIBUTORS = " + str(contributeurs))
diff --git a/re2o/settings.py b/re2o/settings.py
index b68e4997..8c5476f6 100644
--- a/re2o/settings.py
+++ b/re2o/settings.py
@@ -179,7 +179,7 @@ STATIC_URL = '/static/'
# Directory where the media files served by the server are stored
MEDIA_ROOT = os.path.join(BASE_DIR, 'media').replace('\\', '/')
# The URL to access the static files
-MEDIA_URL = '/media/'
+MEDIA_URL = os.path.join(BASE_DIR,'/media/')
# Models to use for graphs
GRAPH_MODELS = {
diff --git a/re2o/templates/re2o/about.html b/re2o/templates/re2o/about.html
index 8e88f5bb..d960067a 100644
--- a/re2o/templates/re2o/about.html
+++ b/re2o/templates/re2o/about.html
@@ -42,9 +42,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
so it can be setup in "a few steps". This tool is entirely free and
available under a GNU Public License v2 (GPLv2) license on
FedeRez gitlab.
- Re2o's mainteners are proud volunteers mainly from French engineering
- schools (but not limited to) who have given a lot of their time to make
- this project possible. So please be kind with them.
+ Re2o's mainteners are volunteers mainly from French schools.
If you want to get involved in the development process, we will be glad to
welcome you so do not hesitate to contact us and come help us build the
future of Re2o.
diff --git a/re2o/templatetags/acl.py b/re2o/templatetags/acl.py
index 19bd0fae..6fd00e19 100644
--- a/re2o/templatetags/acl.py
+++ b/re2o/templatetags/acl.py
@@ -146,7 +146,7 @@ def get_callback(tag_name, obj=None):
if tag_name == 'can_view_app':
return acl_fct(
lambda x: (
- not any(not sys.modules[o].can_view(x) for o in obj),
+ not any(not sys.modules[o].can_view(x)[0] for o in obj),
None
),
False
@@ -154,7 +154,7 @@ def get_callback(tag_name, obj=None):
if tag_name == 'cannot_view_app':
return acl_fct(
lambda x: (
- not any(not sys.modules[o].can_view(x) for o in obj),
+ not any(not sys.modules[o].can_view(x)[0] for o in obj),
None
),
True
@@ -171,12 +171,12 @@ def get_callback(tag_name, obj=None):
)
if tag_name == 'can_view_any_app':
return acl_fct(
- lambda x: (any(sys.modules[o].can_view(x) for o in obj), None),
+ lambda x: (any(sys.modules[o].can_view(x)[0] for o in obj), None),
False
)
if tag_name == 'cannot_view_any_app':
return acl_fct(
- lambda x: (any(sys.modules[o].can_view(x) for o in obj), None),
+ lambda x: (any(sys.modules[o].can_view(x)[0] for o in obj), None),
True
)
diff --git a/re2o/views.py b/re2o/views.py
index 1f9e6ab8..c3f13332 100644
--- a/re2o/views.py
+++ b/re2o/views.py
@@ -70,7 +70,6 @@ def index(request):
}, 're2o/index.html', request)
-@cache_page(7 * 24 * 60 * 60)
def about_page(request):
""" The view for the about page.
Fetch some info about the configuration of the project. If it can't
@@ -108,7 +107,6 @@ def about_page(request):
}
)
-
def contact_page(request):
"""The view for the contact page
Send all the objects MailContact
diff --git a/search/views.py b/search/views.py
index 73333834..93aa1d0e 100644
--- a/search/views.py
+++ b/search/views.py
@@ -33,6 +33,7 @@ from django.contrib.auth.decorators import login_required
from django.db.models import Q
from users.models import User, Adherent, Club, Ban, Whitelist
from machines.models import Machine
+from cotisations.models import Cotisation
from topologie.models import Port, Switch, Room
from cotisations.models import Facture
from preferences.models import GeneralOption
@@ -44,6 +45,7 @@ from search.forms import (
initial_choices
)
from re2o.utils import SortTable
+from re2o.acl import can_view_all
def is_int(variable):
@@ -405,6 +407,7 @@ def get_results(query, request, params):
@login_required
+@can_view_all(User, Machine, Cotisation)
def search(request):
""" La page de recherche standard """
search_form = SearchForm(request.GET or None)
@@ -422,6 +425,7 @@ def search(request):
@login_required
+@can_view_all(User, Machine, Cotisation)
def searchp(request):
""" La page de recherche avancée """
search_form = SearchFormPlus(request.GET or None)
diff --git a/static/css/base.css b/static/css/base.css
index 2dc17770..5748f538 100644
--- a/static/css/base.css
+++ b/static/css/base.css
@@ -129,3 +129,21 @@ td.long_text{
th.long_text{
width: 60%;
}
+
+/* change color of panel heading on hover */
+
+.panel > .profil:hover {
+ background-image: none;
+ background-color: #e6e6e6;
+ color: black;
+}
+
+/* add padding under title in profile */
+.title-dashboard{
+ padding-bottom: 30px;
+}
+
+/* center the profil boxes */
+.dashboard{
+ text-align: center;
+}
diff --git a/templates/base.html b/templates/base.html
index 8a21a612..698195f7 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -76,15 +76,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|