Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bonnegent Sebastien
cours_django
Commits
928e81dc
Commit
928e81dc
authored
Jan 12, 2021
by
Bonnegent Sebastien
Browse files
cours 6
parent
97761a49
Pipeline
#9526
passed with stages
in 21 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cours6.md
View file @
928e81dc
...
...
@@ -2,23 +2,16 @@
author
:
-
Sébastien Bonnegent
title
:
Django par la pratique 6/7
lang
:
fr
---
# Départ
##
Suppor
t
-
cours6.
html
##
Lancemen
t
https://gitlab.insa-rouen.fr/bonnegent/cours_django/-/blob/master/
cours6.
md
## Préparation
### L'ancien
~~~
~~~
bash
$
git pull
$ cd fwm5
$ pipenv --rm
~~~
### Le nouveau
~~~
$ cd fwm6
$ pipenv install
$
cp
-r
fwm6 fwm6-tmp
$
cd
fwm6-tmp
~~~
## Au programme
...
...
@@ -28,7 +21,6 @@ $ pipenv install
-
utilisation avancée des templates
# Règle
## Liste #1
*
https://fontawesome.com/
...
...
@@ -57,23 +49,21 @@ $ pipenv install
### webui/templates/webui/regle_list.html
~~~
python
{
%
for
regle
in
regle_list
%
}
<
tr
{
%
if
not
regle
.
actif
%
}
class
=
"text-muted"
{
%
endif
%
}
>
<
td
>
{{
regle
.
priorite
}}
</
td
>
<
td
>
{
%
if
regle
.
groupe
%
}{{
regle
.
groupe
}}{
%
endif
%
}
</
td
>
<
td
>
{{
regle
.
liste_des_services
}}
</
td
>
<
td
>
{{
regle
.
interface
}}
</
td
>
<
td
>
{
%
if
regle
.
actif
%
}
<
i
class
=
"far fa-check-circle"
></
i
>
{
%
else
%
}
<
i
class
=
"fas fa-ban"
></
i
>
{
%
endif
%
}
</
td
>
<
td
>
{{
regle
.
get_sens_display
}}
</
td
>
</
tr
>
<
tr
{
%
if
not
regle
.
actif
%
}
class
=
"text-muted"
{
%
endif
%
}
>
<
td
>
{{
regle
.
priorite
}}
</
td
>
<
td
>
{
%
if
regle
.
groupe
%
}{{
regle
.
groupe
}}{
%
endif
%
}
</
td
>
<
td
>
{{
regle
.
liste_des_services
}}
</
td
>
<
td
>
{{
regle
.
interface
}}
</
td
>
<
td
>
{
%
if
regle
.
actif
%
}
<
i
class
=
"far fa-check-circle"
></
i
>
{
%
else
%
}
<
i
class
=
"fas fa-ban"
></
i
>
{
%
endif
%
}
</
td
>
<
td
>
{{
regle
.
get_sens_display
}}
</
td
>
</
tr
>
~~~
## Liste #
3
## Liste #
4
### webui/templates/webui/regle_list.html
~~~
python
{
%
empty
%
}
...
...
@@ -103,7 +93,6 @@ $ pipenv install
~~~
# Activer une règle
## En bref
*
une seule fonction
*
vérifier les permissions
...
...
@@ -172,7 +161,6 @@ def regle_activable(request, pk):
~~~
# Priorité
## En bref
*
faire un +1/-1 sur une règle
...
...
@@ -326,7 +314,7 @@ path("parefeu/<int:parefeu_id>/regle/add/",
## Templates
### webui/templates/webui/regle_list.html
~~~
~~~
python
...
<
h4
>
Ajout
d
'une règle</h4>
<form method="post" action="{% url '
regle
-
create
' parefeu.id %}">
...
...
fwm6/db.sqlite3
View file @
928e81dc
No preview for this file type
Write
Preview
Supports
Markdown
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