Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maxime Bombar
Note Kfet 2015 django
Commits
4c581574
Commit
4c581574
authored
Feb 18, 2018
by
Praibait
Browse files
Fix de divers choses sur la page activités
parent
31585f2e
Changes
6
Hide whitespace changes
Inline
Side-by-side
note/templates/note/activite_gestion.html
View file @
4c581574
...
...
@@ -4,11 +4,11 @@
{% block title %}{% blocktrans with id=activite.id%}Gestion de l'activité n°{{ id }}{% endblocktrans %}{% endblock %}
{% block applets %}
<li
role=
"presentation"
{%
if
not
i
sadmin
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/"
>
{% trans "Activités" %}
</a></li>
<li
role=
"presentation"
{%
if
not
ha
sadmin
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/"
>
{% trans "Activités" %}
</a></li>
<li
role=
"presentation"
><a
href=
"{{ NOTE_ROOT_URL }}mes_activites/"
>
{% trans "Mes activités" %}
</a></h5></li>
{% if hasadmin %}
<li
role=
"presentation"
{%
if
i
sadmin
and
not
isold
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/admin/"
>
{% trans "Administration" %}
</a></h5></li>
<li
role=
"presentation"
{%
if
i
sadmin
and
isold
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/admin/old"
>
{% trans "Activités passées" %}
</a></li>
<li
role=
"presentation"
{%
if
ha
sadmin
and
not
isold
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/admin/"
>
{% trans "Administration" %}
</a></h5></li>
<li
role=
"presentation"
{%
if
ha
sadmin
and
isold
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/admin/old"
>
{% trans "Activités passées" %}
</a></li>
{% endif %}
{% endblock %}
...
...
note/templates/note/activite_modifier.html
View file @
4c581574
...
...
@@ -3,11 +3,11 @@
{% block title %}{% blocktrans with id=activite.id %}Modification de l'activité n°{{ id }}{% endblocktrans %}{% endblock %}
{% block applets %}
<li
role=
"presentation"
{%
if
not
i
sadmin
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/"
>
{% trans "Activités" %}
</a></li>
<li
role=
"presentation"
{%
if
not
ha
sadmin
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/"
>
{% trans "Activités" %}
</a></li>
<li
role=
"presentation"
><a
href=
"{{ NOTE_ROOT_URL }}mes_activites/"
>
{% trans "Mes activités" %}
</a></li>
{% if hasadmin %}
<li
role=
"presentation"
{%
if
i
sadmin
and
not
isold
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/admin/"
>
{% trans "Administration" %}
</a></li>
<li
role=
"presentation"
{%
if
i
sadmin
and
isold
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/admin/old"
>
{% trans "Activités Passées" %}
</a></li>
<li
role=
"presentation"
{%
if
ha
sadmin
and
not
isold
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/admin/"
>
{% trans "Administration" %}
</a></li>
<li
role=
"presentation"
{%
if
ha
sadmin
and
isold
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/admin/old"
>
{% trans "Activités Passées" %}
</a></li>
{% endif %}
{% endblock %}
...
...
note/templates/note/invitation.html
View file @
4c581574
...
...
@@ -47,6 +47,7 @@ function put_note(itself, affiche, idbde, _, __, ___) {
<li
role=
"presentation"
><a
href=
"{{ NOTE_ROOT_URL }}mes_activites/"
>
{% trans "Mes activités" %}
</a></li>
{% if hasadmin %}
<li
role=
"presentation"
{%
if
isadmin
%}
class=
"active"
{%
endif
%}
><a
href=
"{{ NOTE_ROOT_URL }}activites/admin/"
>
{% trans "Administration" %}
</a></li>
<li
role=
"presentation"
><a
href=
"{{ NOTE_ROOT_URL }}activites/admin/old"
>
{% trans "Activités passées" %}
</a></li>
{% endif %}
{% endblock %}
...
...
@@ -129,14 +130,14 @@ function put_note(itself, affiche, idbde, _, __, ___) {
</div>
<div
class=
"col-sm-1"
></div>
{% if isadmin %}
{# L'admin doit en plus spécifier le responsable #}
<div
class=
"form-group col-sm-3"
>
{% trans "Responsable :" %}
<div
class=
"search"
>
<input
type=
"text"
name=
"recherche"
id=
"id_search_field"
autocomplete=
"off"
value=
""
onkeyup=
"search_field_moved();return(false);"
/>
<ul
id=
"liste_notes"
class=
"liste_notes hidden"
></ul>
</div>
{% endif %}
{# L'admin doit en plus spécifier le responsable #}
<div
class=
"form-group col-sm-3"
>
{% trans "Responsable :" %}
<div
class=
"search"
>
<input
type=
"text"
name=
"recherche"
id=
"id_search_field"
autocomplete=
"off"
value=
""
onkeyup=
"search_field_moved();return(false);"
/>
<ul
id=
"liste_notes"
class=
"liste_notes hidden"
></ul>
</div>
{% endif %}
</div>
{# On ajoute à la main le champ caché idrespo #}
<input
type=
"hidden"
name=
"idrespo"
id=
"id_output_idbde"
value=
"{{ whoami.idbde }}"
/>
...
...
note/templates/note/pot_accueil.html
View file @
4c581574
...
...
@@ -29,7 +29,6 @@
</div>
{% if isadmin %}
<h3>
État de l'interface :
<span
style=
"color: green"
>
Fonctionnelle !
</span></h3>
<div
style=
"text-align:left"
>
<p><h4
style=
"color:red"
>
BUGS :
</h4></p>
...
...
note/templatetags/note_templatetags.py
View file @
4c581574
...
...
@@ -87,7 +87,7 @@ def render_activite(activite, isadmin=False, isgestion=False, ismine=False, hasn
'Valider'
,
'%sactivites/%s/gestion/validate/'
%
(
settings
.
NOTE_ROOT_URL
,
activite
[
"id"
]),
'success'
))
if
hasnote
and
activite
[
"ouvert"
]:
if
hasnote
and
activite
[
"ouvert"
]
and
not
isadmin
:
boutons
.
append
(
Link
(
"Accéder à la page d'entrée"
,
"%spot/entree/%s/"
%
(
settings
.
NOTE_ROOT_URL
,
activite
[
"id"
]),
...
...
note/views.py
View file @
4c581574
...
...
@@ -300,9 +300,15 @@ def activite_gestion(request, sock, kwargs):
# suppression de l'activité effectuée par une fonction dédiée
utilities
.
_del_activite
(
sock
,
request
,
idact
)
return
HttpResponseRedirect
(
'%sactivites/'
%
(
settings
.
NOTE_ROOT_URL
,))
sock
.
write
(
json
.
dumps
([
"mayi"
,
"activites_admin"
]))
hasadmin
=
nk
.
full_read
(
sock
)[
"msg"
]
if
not
hasadmin
:
messages
.
add_error
(
request
,
_
(
u
"Tu n'as pas le droit activites_admin !"
))
return
HttpResponseRedirect
(
"%sindex/"
%
settings
.
NOTE_ROOT_URL
)
activite
=
utilities
.
_get_activite
(
sock
,
idact
,
request
,
computecandelete
=
True
,
whoami
=
variables_standard
[
"whoami"
],
isadmin
=
True
)
variables
=
{}
variables
[
"activite"
]
=
activite
variables
[
"hasadmin"
]
=
hasadmin
if
validation
==
"/validate"
:
action
,
data
,
succmsg
=
"valider_activite"
,
idact
,
messages
.
SUCCMSG_VALIDACT
elif
validation
==
"/invalidate"
:
...
...
@@ -332,10 +338,18 @@ def activite_gestion_modifier(request, sock, kwargs):
Dans ``kwargs`` :
* ``idact`` : n° de l'activité à modifier
"""
sock
.
write
(
json
.
dumps
([
"mayi"
,
"activites_admin"
]))
hasadmin
=
nk
.
full_read
(
sock
)[
"msg"
]
if
not
hasadmin
:
messages
.
add_error
(
request
,
_
(
u
"Tu n'as pas le droit activites_admin !"
))
return
HttpResponseRedirect
(
"%sindex/"
%
settings
.
NOTE_ROOT_URL
)
idact
=
kwargs
[
"idact"
]
variables
=
{}
activite
=
utilities
.
_get_activite
(
sock
,
idact
,
request
)
variables
[
"activite"
]
=
activite
variables
[
"hasadmin"
]
=
hasadmin
if
request
.
method
==
"GET"
:
form
=
forms
.
ActiviteForm
(
label_suffix
=
" :"
,
initial
=
activite
)
variables
[
"form"
]
=
form
...
...
@@ -2136,7 +2150,7 @@ def pot_accueil(request,sock,kwargs):
note
,
isadmin
=
"note"
in
droits
,
"activites_admin"
in
droits
if
not
note
:
messages
.
add_error
(
request
,
_
(
u
"Tu n'as pas le droit
consos
!"
))
messages
.
add_error
(
request
,
_
(
u
"Tu n'as pas le droit
note
!"
))
return
HttpResponseRedirect
(
"%sindex/"
%
settings
.
NOTE_ROOT_URL
)
liste_activites
=
utilities
.
_get_activites
(
sock
,
isadmin
,
request
,
invites
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment