Skip to content

Commit

Permalink
Ajoute une note sur la ligne éditoriale lors de l'ajout d'un contenu (#…
Browse files Browse the repository at this point in the history
…4351)

* Ajoute une note sur la ligne éditoriale lors de l'ajout d'un contenu

* Review de @gustavi + PEP-8
  • Loading branch information
GCodeur authored and gustavi committed May 25, 2017
1 parent 85fb311 commit 7e1bf18
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions templates/tutorialv2/create/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,13 @@ <h1>


{% block content %}
<div class="content-wrapper">
<div class="alert-box info">
{% blocktrans %}
Vous allez créer un nouveau contenu sur {{ site_name }}. Pensez à prendre connaissance de la <a href="{{ editorial_line_link }}">ligne éditoriale du site</a>.
{% endblocktrans %}
</div>
</div>

{% crispy form %}
{% endblock %}
4 changes: 3 additions & 1 deletion zds/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,9 @@
'import_image_prefix': 'archive',
'build_pdf_when_published': True,
'maximum_slug_size': 150,
'sec_per_minute': 1500
'sec_per_minute': 1500,
'editorial_line_link':
u'https://zestedesavoir.com/articles/222/la-ligne-editoriale-officielle-de-zeste-de-savoir/'
},
'forum': {
'posts_per_page': 21,
Expand Down
6 changes: 6 additions & 0 deletions zds/tutorialv2/views/views_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ def get_form(self, form_class=ContentForm):
form.initial['type'] = self.created_content_type
return form

def get_context_data(self, **kwargs):
context = super(CreateContent, self).get_context_data(**kwargs)
context['editorial_line_link'] = settings.ZDS_APP['content']['editorial_line_link']
context['site_name'] = settings.ZDS_APP['site']['litteral_name']
return context

def form_valid(self, form):

# create the object:
Expand Down

0 comments on commit 7e1bf18

Please sign in to comment.