diff --git a/coopeV3/urls.py b/coopeV3/urls.py index b65889a..4b764f4 100644 --- a/coopeV3/urls.py +++ b/coopeV3/urls.py @@ -23,6 +23,7 @@ from . import views urlpatterns = [ path('', views.home, name="home"), path('home', views.homepage, name="homepage"), + path('about', views.about, name="about"), path('coope-runner', views.coope_runner, name="coope-runner"), path('admin/doc/', include('django.contrib.admindocs.urls')), path('admin/', admin.site.urls), diff --git a/coopeV3/views.py b/coopeV3/views.py index 39fc9e8..430d66b 100644 --- a/coopeV3/views.py +++ b/coopeV3/views.py @@ -1,5 +1,8 @@ +import os + from django.shortcuts import redirect, render from django.urls import reverse +from django.conf import settings from preferences.models import GeneralPreferences from gestion.models import Keg @@ -29,3 +32,22 @@ def coope_runner(request): Just an easter egg """ return render(request, "coope-runner.html") + + +def about(request): + """ + A page about the project + """ + os.system("git -C " + settings.BASE_DIR + " shortlog -n $@ | grep \"):\" | sed 's|:||' >> " + settings.BASE_DIR + "/contributors.txt") + contributors = [] + with open(settings.BASE_DIR + "/contributors.txt", "r") as f: + for line in f: + print(line) + print(line.split(" ")[0]) + contributors.append((line.split(" ")[0], int(line.split(" ")[1].replace("(", "").replace(")", "").replace("\n", "")))) + os.system("rm " + settings.BASE_DIR + "/contributors.txt") + license = [] + with open(settings.BASE_DIR + "/LICENSE", "r") as f: + for line in f: + license.append(line) + return render(request, "about.html", {"contributors": contributors, "license": license}) \ No newline at end of file diff --git a/templates/about.html b/templates/about.html new file mode 100644 index 0000000..b7096e3 --- /dev/null +++ b/templates/about.html @@ -0,0 +1,45 @@ +{% extends 'base.html' %} +{% block entete %}À propos{% endblock %} +{% block navbar %} + +{% endblock %} +{% block content %} +
+
+

CoopeV3

+
+
+ CoopeV3 est un logiciel codé avec le framework Django pour répondre aux besoins de l'association Coopé Technopôle Metz. Il implémente une gestion des + adhérents, des cotisations, des transactions etc... Le code source de ce projet peut être trouvé sur github : https://github.com/nanoy42/coope. +
+
+
+
+

License

+
+
+ Le code source est opensource et distribué sous la license MIT, dont voici le texte exact :
+ {% for l in license %} + {{l}}
+ {% endfor %} + (https://github.com/nanoy42/coope/blob/master/LICENSE). +
+
+
+
+

Contributeurs

+
+
+ Les contributeurs, triés par ordre décroissant de nombre de commits, sont: +
    + {% for contributor in contributors %} +
  1. {{contributor.0}} ({{contributor.1}} commits)
  2. + {% endfor %} +
+
+
+{% endblock %} diff --git a/templates/footer.html b/templates/footer.html index cf7c2ad..135c703 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -42,6 +42,6 @@
  • Facebook
  • - +