Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
site-kwei
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediatek
site-kwei
Commits
56d7a066
Commit
56d7a066
authored
4 years ago
by
Dorian Lesbre
Browse files
Options
Downloads
Patches
Plain Diff
Small changes
parent
a50f26da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
home/urls.py
+6
-5
6 additions, 5 deletions
home/urls.py
home/views.py
+5
-4
5 additions, 4 deletions
home/views.py
with
11 additions
and
9 deletions
home/urls.py
+
6
−
5
View file @
56d7a066
from
django.contrib.sitemaps.views
import
sitemap
from
django.views.generic
import
RedirectView
from
django.urls
import
path
,
include
from
.
import
views
from
home
import
views
sitemaps
=
{
"
static_pages
"
:
views
.
StaticViewSitemap
}
urlpatterns
=
[
path
(
''
,
views
.
static_view
,
{
"
slug
"
:
"
home
"
},
name
=
'
home
'
),
path
(
'
inscription/
'
,
views
.
static_view
,
{
"
slug
"
:
"
inscription
"
},
name
=
'
inscription
'
),
path
(
'
activites/
'
,
views
.
static_view
,
{
"
slug
"
:
"
activites
"
},
name
=
'
activites
'
),
path
(
'
faq/
'
,
views
.
static_view
,
{
"
slug
"
:
"
faq
"
},
name
=
'
FAQ
'
),
path
(
''
,
views
.
static_view
,
{
"
template
"
:
"
home
.html
"
},
name
=
'
home
'
),
path
(
'
inscription/
'
,
views
.
static_view
,
{
"
template
"
:
"
inscription
.html
"
},
name
=
'
inscription
'
),
path
(
'
activites/
'
,
views
.
static_view
,
{
"
template
"
:
"
activites
.html
"
},
name
=
'
activites
'
),
path
(
'
faq/
'
,
views
.
static_view
,
{
"
template
"
:
"
faq
.html
"
},
name
=
'
FAQ
'
),
path
(
'
favicon.ico
'
,
RedirectView
.
as_view
(
url
=
'
/static/imgs/favicon.ico
'
)),
path
(
'
sitemap.xml
'
,
sitemap
,
{
'
sitemaps
'
:
sitemaps
},
...
...
This diff is collapsed.
Click to expand it.
home/views.py
+
5
−
4
View file @
56d7a066
from
django.contrib.sitemaps
import
Sitemap
from
django.shortcuts
import
render
from
django.shortcuts
import
redirect
,
render
from
django.urls
import
reverse
from
home.models
import
InterludesActivity
def
static_view
(
request
,
slug
):
def
static_view
(
request
,
template
):
"""
Simple vues statique (rendu html)
"""
activities
=
InterludesActivity
.
objects
.
filter
(
display
=
True
).
order_by
(
"
title
"
)
return
render
(
request
,
slug
+
'
.html
'
,
{
'
slug
'
:
slug
,
'
activities
'
:
activities
})
return
render
(
request
,
template
,
{
'
activities
'
:
activities
})
class
StaticViewSitemap
(
Sitemap
):
"""
Vue générant la sitemap.xml du site
"""
changefreq
=
'
monthly
'
def
items
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment