-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3261 from gustavi/zep-25
ZEP-25 : Catégorisation des contenus
- Loading branch information
Showing
32 changed files
with
1,006 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,172 @@ | ||
- model: utils.Category | ||
- fields: {description: Informatique, position: 0, slug: informatique, title: Informatique} | ||
model: utils.category | ||
pk: 1 | ||
fields: | ||
title: Site web | ||
description: Catégorie pour les ressources des sites web | ||
slug: site-web | ||
|
||
- model: utils.Category | ||
- fields: {description: Sciences de la nature, position: 1, slug: sciences-de-la-nature, | ||
title: Sciences de la nature} | ||
model: utils.category | ||
pk: 2 | ||
fields: | ||
title: Programmation | ||
description: Catégorie pour les ressources de la programmation | ||
slug: programmation | ||
|
||
- model: utils.Category | ||
- fields: {description: Sciences humaines et sociales, position: 2, slug: sciences-humaines-et-sociales, | ||
title: Sciences humaines et sociales} | ||
model: utils.category | ||
pk: 3 | ||
fields: | ||
title: Mobile | ||
description: Catégorie pour les ressources sur la mobilité | ||
slug: mobile | ||
|
||
- model: utils.SubCategory | ||
- fields: {description: Autres, position: 3, slug: autres, title: Autres} | ||
model: utils.category | ||
pk: 4 | ||
- fields: {image: '', slug: bureautique-et-redaction, subtitle: 'Excel, LaTeX, Powerpoint, | ||
Word', title: "Bureautique et r\xE9daction"} | ||
model: utils.subcategory | ||
pk: 1 | ||
fields: | ||
title: Android | ||
subtitle: Sous-catégorie pour les ressources sur Android | ||
slug: android | ||
|
||
- model: utils.SubCategory | ||
- fields: {image: '', slug: materiel-et-electronique, subtitle: "Arduino, Disque | ||
dur, DIY, Electronique*, M\xE9moires, Ordinateur", title: "Mat\xE9riel | ||
et \xE9lectronique"} | ||
model: utils.subcategory | ||
pk: 2 | ||
fields: | ||
title: PHP | ||
subtitle: Sous-catégorie pour les ressources sur PHP | ||
slug: php | ||
|
||
- model: utils.CategorySubCategory | ||
- fields: {image: '', slug: programmation-et-algorithmique, subtitle: ".NET, Ada, | ||
Algorithmique, C, C#, C++, Cobol, Fonctionnel, G\xE9nie logiciel, Haskell, | ||
Java, Julia, Lisp, Ocaml, Orient\xE9 objet, Python, Ruby, Versioning", | ||
title: Programmation et algorithmique} | ||
model: utils.subcategory | ||
pk: 3 | ||
- fields: {image: '', slug: site-web, subtitle: "Accessibilit\xE9, Actionscript, | ||
Angular JS, CakePHP, Django, HTML/CSS, Java EE, JavaScript, Nginx, Node.js, | ||
Oxygen, PHP, Ruby On Rails, SEO/R\xE9ferencement*, Symfony, Websocket", | ||
title: Site web} | ||
model: utils.subcategory | ||
pk: 4 | ||
- fields: {image: '', slug: systemes-dexploitation, subtitle: 'Android, GNU/Linux, | ||
iOS, MAC OS, Windows, Windows Phone', title: "Syst\xE8mes d'exploitation"} | ||
model: utils.subcategory | ||
pk: 5 | ||
- fields: {image: '', slug: autres-informatique, subtitle: "API, Base de donn\xE9es, | ||
FTP, Jeux vid\xE9os, MySQL, Oracle, Protocole, S\xE9curit\xE9, TCP/IP", | ||
title: Autres (informatique)} | ||
model: utils.subcategory | ||
pk: 6 | ||
- fields: {image: '', slug: astronomie, subtitle: Astronomie, title: Astronomie} | ||
model: utils.subcategory | ||
pk: 7 | ||
- fields: {image: '', slug: geologie-et-geographie-physique, subtitle: "G\xE9ologie", | ||
title: "G\xE9ologie et g\xE9ographie physique"} | ||
model: utils.subcategory | ||
pk: 8 | ||
- fields: {image: '', slug: biologie, subtitle: Biologie, title: Biologie} | ||
model: utils.subcategory | ||
pk: 9 | ||
- fields: {image: '', slug: physique, subtitle: Physique, title: Physique} | ||
model: utils.subcategory | ||
pk: 10 | ||
- fields: {image: '', slug: chimie, subtitle: Chimie, title: Chimie} | ||
model: utils.subcategory | ||
pk: 11 | ||
- fields: {image: '', slug: mathematiques, subtitle: "Math\xE9matiques", title: "Math\xE9matiques"} | ||
model: utils.subcategory | ||
pk: 12 | ||
- fields: {image: '', slug: autres-sciences-de-la-nature, subtitle: Autres sciences | ||
de la nature, title: Autres (sciences de la nature)} | ||
model: utils.subcategory | ||
pk: 13 | ||
- fields: {image: '', slug: droit, subtitle: Droit, title: Droit} | ||
model: utils.subcategory | ||
pk: 14 | ||
- fields: {image: '', slug: histoire, subtitle: Histoire, title: Histoire} | ||
model: utils.subcategory | ||
pk: 15 | ||
- fields: {image: '', slug: langues, subtitle: Langues, title: Langues} | ||
model: utils.subcategory | ||
pk: 16 | ||
- fields: {image: '', slug: psychologie, subtitle: "Psychologie, P\xE9dagogie", | ||
title: Psychologie} | ||
model: utils.subcategory | ||
pk: 17 | ||
- fields: {image: '', slug: economie, subtitle: "\xC9conomie", title: "\xC9conomie"} | ||
model: utils.subcategory | ||
pk: 18 | ||
- fields: {image: '', slug: autres-sciences-humaines-et-sociales, subtitle: "Autres | ||
sciences humaines et sociales comme la g\xE9ographie", title: Autres (sciences | ||
humaines et sociales)} | ||
model: utils.subcategory | ||
pk: 19 | ||
- fields: {image: '', slug: arts-graphisme-et-multimedia, subtitle: 'Graphisme 2D, | ||
Graphisme 3D, Musique, Son', title: "Arts, graphisme et multim\xE9dia"} | ||
model: utils.subcategory | ||
pk: 20 | ||
- fields: {image: '', slug: communication-et-management, subtitle: Monde du travail, | ||
title: Communication et management} | ||
model: utils.subcategory | ||
pk: 21 | ||
- fields: {image: '', slug: zeste-de-savoir, subtitle: Zeste de Savoir, title: Zeste | ||
de Savoir} | ||
model: utils.subcategory | ||
pk: 22 | ||
- fields: {image: '', slug: autres, subtitle: "Litt\xE9rature, Interview", title: Autres} | ||
model: utils.subcategory | ||
pk: 23 | ||
- fields: {category: 1, is_main: true, subcategory: 1} | ||
model: utils.categorysubcategory | ||
pk: 1 | ||
fields: | ||
category: 1 | ||
subcategory: 2 | ||
is_main: True | ||
|
||
- model: utils.CategorySubCategory | ||
- fields: {category: 1, is_main: true, subcategory: 2} | ||
model: utils.categorysubcategory | ||
pk: 2 | ||
fields: | ||
category: 2 | ||
subcategory: 2 | ||
is_main: False | ||
|
||
- model: utils.CategorySubCategory | ||
- fields: {category: 1, is_main: true, subcategory: 3} | ||
model: utils.categorysubcategory | ||
pk: 3 | ||
fields: | ||
category: 3 | ||
subcategory: 1 | ||
is_main: True | ||
- fields: {category: 1, is_main: true, subcategory: 4} | ||
model: utils.categorysubcategory | ||
pk: 4 | ||
- fields: {category: 1, is_main: true, subcategory: 5} | ||
model: utils.categorysubcategory | ||
pk: 5 | ||
- fields: {category: 1, is_main: true, subcategory: 6} | ||
model: utils.categorysubcategory | ||
pk: 6 | ||
- fields: {category: 2, is_main: true, subcategory: 7} | ||
model: utils.categorysubcategory | ||
pk: 7 | ||
- fields: {category: 2, is_main: true, subcategory: 8} | ||
model: utils.categorysubcategory | ||
pk: 8 | ||
- fields: {category: 2, is_main: true, subcategory: 9} | ||
model: utils.categorysubcategory | ||
pk: 9 | ||
- fields: {category: 2, is_main: true, subcategory: 10} | ||
model: utils.categorysubcategory | ||
pk: 10 | ||
- fields: {category: 2, is_main: true, subcategory: 11} | ||
model: utils.categorysubcategory | ||
pk: 11 | ||
- fields: {category: 2, is_main: true, subcategory: 12} | ||
model: utils.categorysubcategory | ||
pk: 12 | ||
- fields: {category: 2, is_main: true, subcategory: 13} | ||
model: utils.categorysubcategory | ||
pk: 13 | ||
- fields: {category: 3, is_main: true, subcategory: 14} | ||
model: utils.categorysubcategory | ||
pk: 14 | ||
- fields: {category: 3, is_main: true, subcategory: 15} | ||
model: utils.categorysubcategory | ||
pk: 15 | ||
- fields: {category: 3, is_main: true, subcategory: 16} | ||
model: utils.categorysubcategory | ||
pk: 16 | ||
- fields: {category: 3, is_main: true, subcategory: 17} | ||
model: utils.categorysubcategory | ||
pk: 17 | ||
- fields: {category: 3, is_main: true, subcategory: 18} | ||
model: utils.categorysubcategory | ||
pk: 18 | ||
- fields: {category: 3, is_main: true, subcategory: 19} | ||
model: utils.categorysubcategory | ||
pk: 19 | ||
- fields: {category: 4, is_main: true, subcategory: 20} | ||
model: utils.categorysubcategory | ||
pk: 20 | ||
- fields: {category: 4, is_main: true, subcategory: 21} | ||
model: utils.categorysubcategory | ||
pk: 21 | ||
- fields: {category: 4, is_main: true, subcategory: 22} | ||
model: utils.categorysubcategory | ||
pk: 22 | ||
- fields: {category: 4, is_main: true, subcategory: 23} | ||
model: utils.categorysubcategory | ||
pk: 23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{# This tempat&e is used by Django Crispy Form #} | ||
{# We only add a templatetag (order_categories line 24) to order categories in the "new content" page #} | ||
|
||
{% load crispy_forms_filters %} | ||
{% load form_categories %} | ||
{% load l10n %} | ||
|
||
{% load crispy_forms_field %} | ||
|
||
{% if field.is_hidden %} | ||
{{ field }} | ||
{% else %} | ||
<{% if tag %}{{ tag }}{% else %}div{% endif %} id="div_{{ field.auto_id }}" class="control-group{% if wrapper_class %} {{ wrapper_class }}{% endif %}{% if form_show_errors%}{% if field.errors %} error{% endif %}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}"> | ||
{% if field.label and not field|is_checkbox and form_show_labels %} | ||
<label for="{{ field.id_for_label }}" class="control-label {% if field.field.required %}requiredField{% endif %}"> | ||
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | ||
</label> | ||
{% endif %} | ||
|
||
{% if field|is_checkboxselectmultiple %} | ||
<div class="controls"{% if flat_attrs %} {{ flat_attrs|safe }}{% endif %}> | ||
{% include 'bootstrap/layout/field_errors_block.html' %} | ||
|
||
{% regroup field.field.choices|order_categories|dictsort:"order" by parent as categories_list %} | ||
|
||
{% for category in categories_list %} | ||
<strong>{{ category.grouper }}</strong> | ||
{% for item in category.list %} | ||
<label class="checkbox{% if inline_class %} {{ inline_class }}{% endif %} checkbox-new-content"> | ||
<input type="checkbox"{% if item.choice.0 in field.value or item.choice.0|stringformat:"s" in field.value or item.choice.0|stringformat:"s" == field.value|stringformat:"s" %} checked="checked"{% endif %} name="{{ field.html_name }}" id="id_{{ field.html_name }}_{{ forloop.counter }}" value="{{ item.choice.0|unlocalize }}" {{ field.field.widget.attrs|flatatt }}>{{ item.choice.1|unlocalize }} | ||
</label> | ||
{% endfor %} | ||
{% endfor %} | ||
|
||
{% include 'bootstrap/layout/help_text.html' %} | ||
</div> | ||
{% endif %} | ||
|
||
{% if field|is_radioselect %} | ||
{% include 'bootstrap/layout/radioselect.html' %} | ||
{% endif %} | ||
|
||
{% if not field|is_checkboxselectmultiple and not field|is_radioselect %} | ||
<div class="controls"> | ||
{% if field|is_checkbox and form_show_labels %} | ||
<label for="{{ field.id_for_label }}" class="checkbox {% if field.field.required %}requiredField{% endif %}"> | ||
{% crispy_field field %} | ||
{{ field.label|safe }} | ||
{% include 'bootstrap/layout/help_text_and_errors.html' %} | ||
</label> | ||
{% else %} | ||
{% crispy_field field %} | ||
{% include 'bootstrap/layout/help_text_and_errors.html' %} | ||
{% endif %} | ||
</div> | ||
{% endif %} | ||
</{% if tag %}{{ tag }}{% else %}div{% endif %}> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.