This commit is contained in:
Lucie Galland 2021-05-27 14:27:30 +02:00
parent 7b19a581cf
commit ab120e5e63
10 changed files with 226 additions and 388 deletions

View file

@ -29,6 +29,9 @@ urlpatterns += i18n_patterns(
path("change", gestion_views.ChangeMembre.as_view(), name="change_membre"),
path("password", gestion_views.ChangePassword.as_view(), name="change_password"),
path("thanks", gestion_views.Thanks.as_view(), name="thanks"),
path("social", gestion_views.Social.as_view(), name="social"),
path("chef", gestion_views.Chef.as_view(), name="chef"),
path("profil", gestion_views.Profil.as_view(), name="profile"),
path("changename", gestion_views.ChangeName.as_view(), name="change-doodle-name"),
path("logout", auth_views.LogoutView.as_view(next_page="home"), name="logout"),
path("login", gestion_views.MyLoginView.as_view(), name="login"),

View file

@ -10,6 +10,10 @@
*/
/* Instagram feed*/
#app{
display: grid;
grid-gap: var(--spacing);
@ -1584,9 +1588,7 @@
width: device-width;
}
body {
-ms-overflow-style: scrollbar;
}
@media screen and (max-width: 480px) {
@ -1600,16 +1602,7 @@
background: #e4522f;
}
body.is-loading *, body.is-loading *:before, body.is-loading *:after {
-moz-animation: none !important;
-webkit-animation: none !important;
-ms-animation: none !important;
animation: none !important;
-moz-transition: none !important;
-webkit-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}
/* Type */
@ -2310,7 +2303,7 @@ div.spoiler
display: block;
float: left;
margin-right: -2em;
opacity: 0;
height: 1em;
width: 1em;
z-index: -1;
}
@ -2730,31 +2723,7 @@ div.spoiler
text-align: center;
}
header p {
position: relative;
margin: 0 0 1.5em 0;
}
header h2 + p {
font-size: 1.25em;
margin-top: -1em;
}
header h3 + p {
font-size: 1.1em;
margin-top: -0.8em;
}
header h4 + p,
header h5 + p,
header h6 + p {
font-size: 0.9em;
margin-top: -0.6em;
}
header p {
color: #676d71;
}
/* Tab */
@ -2914,17 +2883,8 @@ div.spoiler
z-index: 99;
}
.wrapper header {
margin-bottom: 4em;
}
@media screen and (max-width: 736px) {
.wrapper header {
margin-bottom: 2em;
}
}
.wrapper.style1 {
background-color: #e39576;
@ -3130,9 +3090,7 @@ div.spoiler
border-top-color: rgba(255, 255, 255, 0.15);
}
.wrapper.style1 header p {
color: #ffffff;
}
.wrapper.style1 table tbody tr {
border-color: rgba(255, 255, 255, 0.15);
@ -3353,9 +3311,7 @@ div.spoiler
border-top-color: rgba(255, 255, 255, 0.15);
}
.wrapper.style2 header p {
color: #9ba2a8;
}
.wrapper.style2 table tbody tr {
border-color: rgba(255, 255, 255, 0.15);
@ -3489,281 +3445,7 @@ div.spoiler
display: none;
}
/* Header */
body.subpage {
padding-top: 3.125em;
}
#header {
background: #e4522f;
color: #e4522f;
cursor: default;
height: 3.25em;
left: 0;
line-height: 3.25em;
position: fixed;
text-align: right;
top: 0;
width: 100%;
z-index: 10001;
}
#header > h1 {
color:#000000;
display: inline-block;
height: inherit;
left: 1.25em;
line-height: inherit;
margin: 0;
padding: 0;
position: absolute;
top: 0;
}
#header > h1 a {
font-size: 1.25em;
}
#header > h1 a:hover {
color: #ffffff;
}
#header > h1 span {
font-weight: 300;
font-size: .8em;
}
#header > a {
-moz-transition: color 0.2s ease-in-out;
-webkit-transition: color 0.2s ease-in-out;
-ms-transition: color 0.2s ease-in-out;
transition: color 0.2s ease-in-out;
display: inline-block;
padding: 0 0.75em;
color: #ffffff;
text-decoration: none;
}
#header > a:hover {
color: #e4522f;
}
#header > a[href="#menu"]:hover {
color: #000000;
}
#header > a[href="#menu"] {
text-decoration: none;
font-size: larger;
-webkit-tap-highlight-color: transparent;
}
#header > a[href="#menu"]:before {
content: "";
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-transform: none !important;
}
#header > a[href="#menu"]:before {
margin: 0 0.5em 0 0;
}
#header > a + a[href="#menu"]:last-child {
border-left: solid 1px rgba(228, 82, 47, 0.15);
padding-left: 1.25em;
margin-left: 0.5em;
}
#header > a:last-child {
padding-right: 1.25em;
}
#logo
{
position: absolute;
left:0;
top:0;
}
@media screen and (max-width: 736px) {
#header > a {
padding: 0 0.5em;
}
#header > a + a[href="#menu"]:last-child {
padding-left: 1em;
margin-left: 0.25em;
}
#header > a:last-child {
padding-right: 1em;
}
}
@media screen and (max-width: 980px) {
body {
padding-top: 44px;
}
#header {
height: 44px;
line-height: 44px;
}
#header > h1 {
left: 1em;
}
#header > h1 a {
font-size: 1em;
}
}
@media screen and (max-width: 480px) {
#header {
min-width: 320px;
}
}
/* Menu */
#menu {
-moz-transform: translateX(20em);
-webkit-transform: translateX(20em);
-ms-transform: translateX(20em);
transform: translateX(20em);
-moz-transition: -moz-transform 0.5s ease, box-shadow 0.5s ease, visibility 0.5s;
-webkit-transition: -webkit-transform 0.5s ease, box-shadow 0.5s ease, visibility 0.5s;
-ms-transition: -ms-transform 0.5s ease, box-shadow 0.5s ease, visibility 0.5s;
transition: transform 0.5s ease, box-shadow 0.5s ease, visibility 0.5s;
-webkit-overflow-scrolling: touch;
background: #e4522f;
box-shadow: none;
color: #ffffff;
height: 100%;
max-width: 80%;
overflow-y: auto;
padding: 3em 2em;
position: fixed;
font-size: larger;
right: 0;
top: 0;
visibility: hidden;
width: 20em;
z-index: 10002;
}
#menu > ul {
margin: 0 0 1em 0;
}
#menu > ul.links {
list-style: none;
padding: 0;
}
#menu > ul.links > li {
padding: 0;
}
#menu > ul.links > li > a:not(.button) {
border: 0;
border-top: solid 1px rgba(255, 255, 255, 0.15);
color: inherit;
display: block;
line-height: 3.5em;
text-decoration: none;
}
#menu > ul.links > li > .button {
display: block;
margin: 0.5em 0 0 0;
}
#menu > ul.links > li > a:not(.button):hover {
color: rgba(255,255,255,0.2);
}
#menu > ul.links > li:first-child > a:not(.button) {
border-top: 0 !important;
}
#menu .close {
text-decoration: none;
-moz-transition: color 0.2s ease-in-out;
-webkit-transition: color 0.2s ease-in-out;
-ms-transition: color 0.2s ease-in-out;
transition: color 0.2s ease-in-out;
-webkit-tap-highlight-color: transparent;
border: 0;
color: #ffffff;
cursor: pointer;
display: block;
height: 2.75em;
line-height: 3.25em;
padding-right: 1.25em;
position: absolute;
right: 0;
text-align: right;
top: 0;
vertical-align: middle;
width: 2.75em;
}
#menu .close:before {
content: "";
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-transform: none !important;
}
#menu .close:before {
font-size: 1.25em;
}
#menu .close:hover {
color: rgba(255,255,255,0.2);
}
@media screen and (max-width: 736px) {
#menu .close {
height: 4em;
line-height: 4em;
}
}
#menu.visible {
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
box-shadow: 0 0 1.5em 0 rgba(0, 0, 0, 0.2);
visibility: visible;
}
@media screen and (max-width: 736px) {
#menu {
padding: 2.5em 1.75em;
}
}
/* Banner */
@ -3910,6 +3592,9 @@ div.spoiler
/* Main */
/* Footer */

View file

@ -1,6 +1,7 @@
{% load static %}
{% load i18n %}
{% load changelang %}
{% load avatar_tags %}
{% get_current_language as current_language %}
<!DOCTYPE HTML>
@ -21,66 +22,105 @@
<body class="subpage">
<!-- Header -->
<header id="header">
<a href="{% url 'home' %}"><img src="{% static 'images/Ernestophone_white.png' %}"
style="float: left; width: auto; height: 3.1em;" alt="L'Ernestophone" title="white_esnesto" id="logo"></a>
<a href="#menu">Menu</a>
</header>
<nav class="navbar navbar-expand-md">
<div class="container-fluid">
<!-- Brand -->
<a class="navbar-brand" href="{% url 'home' %}"><img style='float:left;height:3em;width:auto' src='{% static "images/Ernestophone_white.png" %}'/></a>
<!-- Nav -->
<nav id="menu">
<ul class="links">
<li>{% ifequal current_language "fr" %}
<a href="{% changelang "en" %}" >English<span class="image right"><img src="{% static "images/en_flag.jpg" %}"></span></a>
{% else %}
<a href="{% changelang "fr" %}">Français<span class="image right"><img src="{% static "images/fr_flag.jpg" %}"></span></a>
{% endifequal %}</li>
<!-- Links -->
<ul class="navbar-nav mr-auto" >
{% if not user.is_authenticated %}
<li><a href="{% url 'home' %}">{% trans "Accueil" %}</a></li>
<li><a href="{% url 'calendrier:liste' %}">{% trans "Agenda" %}</a></li>
<li class="nav-item">
<a class="nav-link" href="{% url 'home' %}"><b>{% trans "Accueil" %}</b></a>
</li>
<li class="nav-item">
<a class="nav-link"href="{% url 'calendrier:liste' %}"><b>{% trans "Agenda" %}</b></a>
</li>
{% else %}
<li><a href="{% url 'calendrier:home' %}">{% trans "Agenda" %}</a></li>
<li class="nav-item">
<a class="nav-link" href="{% url 'calendrier:home' %}"><b>{% trans "Agenda" %}</b></a>
</li>
{% endif %}
<li><a href="{% url 'partitions:liste' %}">{% trans "Répertoire" %}</a></li>
<li class="nav-item">
<a class="nav-link" href="{% url 'partitions:liste' %}"><b>{% trans "Répertoire" %}</b></a>
</li>
{% if user.is_authenticated %}
<li><a href="{% url 'instruments:liste' %}">{% trans "Instruments" %}</a></li>
<li><a href="{% url 'pads:list' %}">{% trans "Pads" %}</a></li>
</ul>
<h1>{% trans "Social :" %}</h1>
<ul class ="links">
<li><a href="{% url 'trombonoscope:view' %}">{% trans "Trombonoscope" %}</a></li>
<li><a href="https://photos.cof.ens.fr/index.php/Clubs-du-COF/L'Ernestophone" target="_blank">{% trans "Galerie Photo" %}</a></li>
</ul>
<h1> {% trans "Mon profil :" %}</h1>
<ul class = 'links'>
<li><a href="{% url 'change_membre' %}">{% trans "Modification du profil" %}</a></li>
<li><a href="{% url 'logout' %}">{% trans "Déconnexion" %}</a></li>
</ul>
<li class="nav-item">
<a class="nav-link" href="{% url 'instruments:liste' %}"><b>{% trans "Instruments" %}</b></a>
</li>
<li class="nav-item">
<a class="nav-link" href="{% url 'pads:list' %}"><b>{% trans "Pads" %}</b></a>
</li>
<!-- Dropdown -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="{% url 'social' %}" id="navbardrop" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<b>{% trans 'Social'%}
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="{% url 'trombonoscope:view' %}">{% trans "Trombonoscope" %}</a>
<a class="dropdown-item" href="https://photos.cof.ens.fr/index.php/Clubs-du-COF/L'Ernestophone" target="_blank">{% trans "Galerie Photo" %}</a>
</div>
</li>
{% if user.is_superuser or user.profile.is_chef %}
</ul>
<h1>{% trans "Le pouvoir des chef·fe·s :" %}</h1>
<ul class="links">
<li><a href="/admin/">{% trans "Administration" %}</a></li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="{% url 'chef' %}" id="navbardrop" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<b>{% trans 'Le pouvoir des cheff·e·s'%}</b>
</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="/admin/">{% trans "Administration" %}</a>
{% if user.profile.is_chef %}
<li><a href="{% url 'actu:liste' %}">{% trans "Modifier les actualités" %}</a></li>
{% endif %}
</ul>
<a class="dropdown-item" href="{% url 'calendrier:create_event' %}">{% trans "Ajouter un événement" %}</a>
<a class="dropdown-item" href="{% url 'actu:liste' %}">{% trans "Modifier les actualités" %}</a>
{% endif %}
</ul>
</div>
</li>
{% endif %}
{% else %}
<li><a href="{% url 'login' %}">{% trans "Se connecter" %}</a></li>
<li><a href="{% url 'registration' %}">{% trans "Créer un compte" %}</a></li>
<li class="nav-item">
<a class="nav-link" href="{% url 'home' %}#contact"><b>{% trans "Contact" %}</b></a>
</li>
{% endif %}
</ul>
<ul class="navbar-nav" style="float:right">
{% if user.is_authenticated %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="{% url 'profile' %}" id="navbardrop" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{% if request.user|has_avatar %}
{% avatar request.user 50 class="rounded-circle"%}
{% else %}
<img src="{% static "images/Ernestophone_logo.png" %}" width="50" height="50" class="rounded-circle">
{% endif %}
</a>
<div class="dropdown-menu" >
<a class="dropdown-item" href="{% url 'change_membre' %}">{% trans "Modifier le profil" %}</a>
<a class="dropdown-item" href="{% url 'trombonoscope:change' %}">{% trans "Modifier le Trombo" %}</a>
<a class="dropdown-item" href="{% url 'logout' %}">{% trans "Déconnexion" %}</a>
</div>
</li>
{% else %}
<li class="nav-item"><a class="nav-link" href="{% url 'login' %}"><b>{% trans "Se connecter" %}</b></a></li>
<li class="nav-item"><a class="nav-link" href="{% url 'registration' %}"><b>{% trans "Créer un compte" %}</a></li>
{% endif %}
<li class="nav-item">
{% ifequal current_language "fr" %}
<a class="nav-link" href="{% changelang "en" %}" ><img src="{% static 'images\en_flag.jpg' %}" width="60" height="40" class="rounded-circle"></a>
{% else %}
<a class="nav-link" href="{% changelang "fr" %}" ><img src="{% static 'images\fr_flag.jpg' %}" width="60" height="40" class="rounded-circle"></a>
{% endifequal %}
</li>
</ul>
</div>
</nav>
@ -117,8 +157,41 @@
<script src="{% static 'js/main.js' %}"></script>
<script src="{% static 'js/InstagramFeed.js' %}"></script>
<script>
const $dropdown = $(".dropdown");
const $dropdownToggle = $(".dropdown-toggle");
const $dropdownMenu = $(".dropdown-menu");
const showClass = "show";
$(window).on("load resize", function() {
if (this.matchMedia("(min-width: 768px)").matches) {
$dropdown.hover(
function() {
const $this = $(this);
$this.addClass(showClass);
$this.find($dropdownToggle).attr("aria-expanded", "true");
$this.find($dropdownMenu).addClass(showClass);
},
function() {
const $this = $(this);
$this.removeClass(showClass);
$this.find($dropdownToggle).attr("aria-expanded", "false");
$this.find($dropdownMenu).removeClass(showClass);
}
);
} else {
$dropdown.off("mouseenter mouseleave");
}
});
</script>
<script type="text/javascript">
function ouvrirFermerSpoiler(div)
{
var divContenu = div.getElementsByTagName('div')[1];

View file

@ -0,0 +1,23 @@
{% extends "gestion/base.html" %}
{% load i18n %}
{% block titre %}{% trans "Cheff·e·s" %}{% endblock %}
{% block content %}
<div id="main">
<section class="wrapper style1">
<div class="inner">
<div class="row">
<div class="6u 12u$(small)">
<h2>{% trans "Le pouvoir des cheff·e·s" %} :</h2>
<ul>
<li> <a href="/admin/">{% trans "Administration" %}</a></li>
<li> <a href="{% url 'calendrier:create_event' %}">{% trans "Ajouter un événement" %}</a></li>
<li><a href="{% url 'actu:liste' %}">{% trans "Modifier les actualités" %}</a></li>
</ul>
</div>
</div>
</div>
</section>
</div>
{% endblock %}

View file

@ -91,7 +91,7 @@
<!-- Two -->
<section class="wrapper style2" >
<div class="inner">
<div class="inner" id="contact">
<header>
<h2>{% trans "L'Ernestophone in a nutshell" %}</h2>
<div id="instagram-feed" class="instagram_feed"> </div>
@ -241,7 +241,7 @@
{% endif %}
</span></div><p style="color:white" align="center">{% blocktrans %}Vous préparez un
évenement et vous recherchez une fanfare dynamique ? N'hésitez
pas à nous envoyer un message nous serons ravis de venir
pas à nous envoyer un message par mail ou sur Facebook. Nous serons ravis de venir
fanfaronner pour vous !! Vérifiez notre{% endblocktrans %} <a href="{% url 'calendrier:liste' %}" class="text">{% trans "agenda" %}</a>. <br />
<a target="_blank" href="https://www.facebook.com/ernestophone"

View file

@ -0,0 +1,23 @@
{% extends "gestion/base.html" %}
{% load i18n %}
{% block titre %}{% trans "Profil" %}{% endblock %}
{% block content %}
<div id="main">
<section class="wrapper style1">
<div class="inner">
<div class="row">
<div class="6u 12u$(small)">
<h2>{% trans "Profil" %} :</h2>
<ul>
<li> <a href="{% url 'login' %}">{% trans "Se connecter" %}</a></li>
<li> <a href="{% url 'trombonoscope:change' %}">{% trans "Modifier le Trombo" %}</a></li>
<li><a href="{% url 'registration' %}">{% trans "Créer un compte" %}</a></li>
</ul>
</div>
</div>
</div>
</section>
</div>
{% endblock %}

View file

@ -0,0 +1,22 @@
{% extends "gestion/base.html" %}
{% load i18n %}
{% block titre %}{% trans "Social" %}{% endblock %}
{% block content %}
<div id="main">
<section class="wrapper style1">
<div class="inner">
<div class="row">
<div class="6u 12u$(small)">
<h2>{% trans "Social" %} :</h2>
<ul>
<li> <a href="{% url 'trombonoscope:view' %}">{% trans "Trombonoscope" %}</a></li>
<li><a href="https://photos.cof.ens.fr/index.php/Clubs-du-COF/L'Ernestophone" target="_blank">{% trans "Galerie Photo" %}</a></li>
</ul>
</div>
</div>
</div>
</section>
</div>
{% endblock %}

View file

@ -12,6 +12,7 @@ from django.views.generic import TemplateView
from calendrier.forms import ChangeDoodleName
from gestion.forms import (ChangeFormUser, ChangeMembreForm,
InscriptionMembreForm, RegistrationFormUser)
from gestion.mixins import ChefRequiredMixin
from gestion.models import ErnestoUser, Photo, VideoGallery
from partitions.models import Category
@ -62,6 +63,18 @@ class Thanks(TemplateView):
template_name = "gestion/thanks.html"
class Social(LoginRequiredMixin, TemplateView):
template_name = "gestion/social.html"
class Profil(LoginRequiredMixin, TemplateView):
template_name = "gestion/profile.html"
class Chef(ChefRequiredMixin, TemplateView):
template_name = "gestion/chef.html"
class ChangeName(LoginRequiredMixin, TemplateView):
form_class = ChangeDoodleName
template_name = "gestion/changename.html"

View file

@ -38,7 +38,7 @@
{% for instrument in instrus_dispo %}
<tr>
<td> <a href="{% url "instruments:fiche_instru" instrument.id %}">{{ instrument.type }} </a></td>
<td> <u> <a href="{% url "instruments:fiche_instru" instrument.id %}">{{ instrument.type }} </a></u></td>
<td> {{ instrument.owner }} </td>
<td> {{ instrument.etat }} </td>
<td>
@ -74,7 +74,7 @@
{% for instrument in instrus_prete %}
<tr>
<td> <a href="{% url "instruments:fiche_instru" instrument.id %}">{{ instrument.type }} </a> </td>
<td> <u><a href="{% url "instruments:fiche_instru" instrument.id %}">{{ instrument.type }}</a></u></td>
<td> {{ instrument.owner }} </td>
<td> {{ instrument.user }} </td>
<td> {{ instrument.etat}} </td>

View file

@ -45,13 +45,9 @@ class CreateRep(ChefRequiredMixin, TemplateView):
def post(self, request, *args, **kwargs):
form = self.form_class(request.POST)
if form.is_valid():
rep = Reparation()
rep.date = form.cleaned_data["date"]
rep.description = form.cleaned_data["description"]
rep.description_en = form.cleaned_data["description_en"]
rep.prix = form.cleaned_data["prix"]
rep.lieux = form.cleaned_data["lieux"]
rep = form.save(commit=False)
rep.instru = get_object_or_404(Instrument, id=self.kwargs["pk"])
rep.save()
return redirect("instruments:fiche_instru", pk=self.kwargs["pk"])