From 1f92c7d3cb6e4c65f13c8e2efcb92fcb3b1d0427 Mon Sep 17 00:00:00 2001 From: Christophe Gabard Date: Fri, 4 Jul 2014 14:13:47 +0200 Subject: [PATCH 001/178] Update requirements.txt --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index b5e5adc8b3..66126e9f02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,8 +28,8 @@ factory-boy==2.2.1 django-discover-runner==0.4 pygeoip==0.3.1 pillow -git+https://github.com/zestedesavoir/Python-ZMarkdown.git@2.4.1-zds.5 +git+https://github.com/zestedesavoir/Python-ZMarkdown.git@2.4.1-zds.6 git+https://github.com/zestedesavoir/GitPython.git@0.3.2-RC1.z2 flake8 autopep8 -easy-thumbnails \ No newline at end of file +easy-thumbnails From f7f7547eec5145ad2232a29d7bef8b0821b2e40c Mon Sep 17 00:00:00 2001 From: Alex-D Date: Mon, 7 Jul 2014 21:24:00 +0200 Subject: [PATCH 002/178] Adaptera automatiquement le protocol pour les polices --- templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/base.html b/templates/base.html index 30402166c3..2fb7533156 100644 --- a/templates/base.html +++ b/templates/base.html @@ -52,7 +52,7 @@ --> - + {# for additionnal css in some pages #} From 26c7280ddf9038fb4e03cdbf324e14302b72c490 Mon Sep 17 00:00:00 2001 From: Alex-D Date: Mon, 7 Jul 2014 21:33:54 +0200 Subject: [PATCH 003/178] Masque le message des cookies sur mobile --- assets/scss/_mobile.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/assets/scss/_mobile.scss b/assets/scss/_mobile.scss index 65429ced7e..eaaf98e9f0 100644 --- a/assets/scss/_mobile.scss +++ b/assets/scss/_mobile.scss @@ -8,7 +8,6 @@ @media only screen and (max-width: 760px) { #cookies-banner { - display: block; position: absolute; top: 50px; right: 0; From 41850a642a34e3449d97536b94a731e325f985e9 Mon Sep 17 00:00:00 2001 From: Alex-D Date: Mon, 7 Jul 2014 22:14:40 +0200 Subject: [PATCH 004/178] Change des liens en formulaires --- .../includes/sidebar_actions.part.html | 28 +++++++++++++++++-- templates/article/validation/history.html | 22 ++++----------- templates/tutorial/tutorial/view.html | 2 +- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/templates/article/includes/sidebar_actions.part.html b/templates/article/includes/sidebar_actions.part.html index 514897a486..d9ca2f9aeb 100644 --- a/templates/article/includes/sidebar_actions.part.html +++ b/templates/article/includes/sidebar_actions.part.html @@ -128,10 +128,23 @@

Validation

{% if not article.sha_validation = None %} {% if validation.is_pending %}
  • - Réserver +
    + {% csrf_token %} + +
  • {% elif validation.is_pending_valid %} {% if validation.validator = user %} +
  • +
    + {% csrf_token %} + +
    +
  • Publier
  • {% else %}
  • - - Réservé par {{ validation.validator.username }}, le retirer + + Réservé par {{ validation.validator.username }}, le retirer + + {% csrf_token %} +

    + La validation de cet article est actuellement réservé par {% include "misc/member_item.part.html" with member=validation.validator %}. Êtes-vous certains de vouloir le retirer ? +

    + +
  • {% endif %} {% endif %} diff --git a/templates/article/validation/history.html b/templates/article/validation/history.html index b34f30a717..01188f98d0 100644 --- a/templates/article/validation/history.html +++ b/templates/article/validation/history.html @@ -1,5 +1,6 @@ {% extends "article/base.html" %} {% load date %} +{% load captureas %} @@ -38,9 +39,7 @@

    Historique de validation de : {{ article.title }}

    Catégorie(s) Auteur(s) Proposé - Validateur - Réservé - Action + Statut @@ -79,19 +78,10 @@

    Historique de validation de : {{ article.title }}

    {% endif %} - {% if validation.is_pending %} - - Réservé - - {% elif validation.is_pending_valid %} - - Annuler la réservation - - {% elif validation.is_accept %} - Accepté - {% elif validation.is_reject %} - Rejeté - {% endif %} + {% captureas reservation_url %} + {% url "zds.article.views.reservation" validation.pk %} + {% endcaptureas %} + {% include "misc/validation.part.html" %} {% endfor %} diff --git a/templates/tutorial/tutorial/view.html b/templates/tutorial/tutorial/view.html index c84ea8eeb4..9ebb1c7a79 100644 --- a/templates/tutorial/tutorial/view.html +++ b/templates/tutorial/tutorial/view.html @@ -298,7 +298,7 @@

    Validation

    {% csrf_token %}
    From 60c810f31d230c6cdf365b205c6cc2e1ffbcf466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?fran=C3=A7ois=20dambrine?= Date: Mon, 7 Jul 2014 22:15:28 +0200 Subject: [PATCH 005/178] fix #1092 : erreur 500 sur la liste des topics par tag --- zds/forum/views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zds/forum/views.py b/zds/forum/views.py index 148795486f..e05c52d418 100644 --- a/zds/forum/views.py +++ b/zds/forum/views.py @@ -876,6 +876,7 @@ def find_topic_by_tag(request, tag_pk, tag_slug): tag = Tag.objects.filter(pk=tag_pk, slug=tag_slug).first() if tag is None: return redirect(reverse("zds.forum.views.index")) + u = request.user if "filter" in request.GET: filter = request.GET["filter"] if request.GET["filter"] == "solve": From 559204d811d9cf82ea6ea245b708f1b67fea475e Mon Sep 17 00:00:00 2001 From: Alex-D Date: Mon, 7 Jul 2014 22:44:33 +0200 Subject: [PATCH 006/178] Corrige les liens du fil d'ariane --- templates/forum/find/post.html | 6 +++--- templates/forum/find/topic.html | 4 ++-- templates/forum/find/topic_by_tag.html | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/forum/find/post.html b/templates/forum/find/post.html index 33a7151ccf..e858d0d15d 100644 --- a/templates/forum/find/post.html +++ b/templates/forum/find/post.html @@ -12,16 +12,16 @@ {% block headline %} -

    Messages postés par "{{ usr.username }}""

    + Messages postés par "{{ usr.username }}" {% endblock %} {% block breadcrumb %} {% with profile=usr|profile %} -
  • {{ usr.username }}
  • +
  • {{ usr.username }}
  • {% endwith %} -
  • Messages postés
  • +
  • Messages postés
  • Recherche
  • {% endblock %} diff --git a/templates/forum/find/topic.html b/templates/forum/find/topic.html index 2b10a6e958..4e76375704 100644 --- a/templates/forum/find/topic.html +++ b/templates/forum/find/topic.html @@ -12,7 +12,7 @@ {% block headline %} -

    Sujets crées par "{{ usr.username }}""

    + Sujets crées par "{{ usr.username }}" {% endblock %} @@ -21,7 +21,7 @@

    Sujets crées par "{{ usr.username }}""

    {% with profile=usr|profile %}
  • {{ usr.username }}
  • {% endwith %} -
  • Sujets crées
  • +
  • Sujets crées
  • Recherche
  • {% endblock %} diff --git a/templates/forum/find/topic_by_tag.html b/templates/forum/find/topic_by_tag.html index f274a464e8..e1c81d9579 100644 --- a/templates/forum/find/topic_by_tag.html +++ b/templates/forum/find/topic_by_tag.html @@ -5,19 +5,19 @@ {% block title %} - Tag : {{tag.title}} + Tag : {{ tag.title }} {% endblock %} {% block breadcrumb %} -
  • Tag : {{tag.title}}
  • +
  • Tag : {{ tag.title }}
  • {% endblock %} {% block headline %} - Tag : {{tag.title}} + Tag : {{ tag.title }} {% endblock %} From 38e1f1fcc467c2696ccbf51b7fda197e6baad66a Mon Sep 17 00:00:00 2001 From: Alex-D Date: Mon, 7 Jul 2014 22:54:20 +0200 Subject: [PATCH 007/178] Change id en pk, mauvais nom de variable --- templates/forum/find/post.html | 2 +- templates/forum/find/topic.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/forum/find/post.html b/templates/forum/find/post.html index e858d0d15d..306374c9ef 100644 --- a/templates/forum/find/post.html +++ b/templates/forum/find/post.html @@ -21,7 +21,7 @@ {% with profile=usr|profile %}
  • {{ usr.username }}
  • {% endwith %} -
  • Messages postés
  • +
  • Messages postés
  • Recherche
  • {% endblock %} diff --git a/templates/forum/find/topic.html b/templates/forum/find/topic.html index 4e76375704..0cedf08920 100644 --- a/templates/forum/find/topic.html +++ b/templates/forum/find/topic.html @@ -21,7 +21,7 @@ {% with profile=usr|profile %}
  • {{ usr.username }}
  • {% endwith %} -
  • Sujets crées
  • +
  • Sujets crées
  • Recherche
  • {% endblock %} From 576090b5486f927e886cab68dec20e0d2646f9bc Mon Sep 17 00:00:00 2001 From: firm1 Date: Mon, 7 Jul 2014 23:13:38 +0200 Subject: [PATCH 008/178] =?UTF-8?q?corrige=20le=20filtre=20des=20forums=20?= =?UTF-8?q?par=20cat=C3=A9gorie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zds/forum/views.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/zds/forum/views.py b/zds/forum/views.py index 148795486f..8c03f42035 100644 --- a/zds/forum/views.py +++ b/zds/forum/views.py @@ -109,14 +109,17 @@ def cat_details(request, cat_slug): category = get_object_or_404(Category, slug=cat_slug) - forums_pub = Forum.objects.filter(group__isnull=True).select_related("category").all() + forums_pub = Forum.objects\ + .filter(group__isnull=True, category__pk=category.pk)\ + .select_related("category").all() if request.user.is_authenticated(): - forums_prv = Forum.objects.filter(group__isnull=False).select_related("category").all() - out = [] - for forum in forums_prv: - if forum.can_read(request.user): - out.append(forum.pk) - forums = forums_pub|forums_prv.exclude(pk__in=out) + forums_prv = Forum.objects\ + .filter(group__isnull=False, \ + group__in=request.user.groups.all(), \ + category__pk=category.pk)\ + .select_related("category")\ + .all() + forums = forums_pub|forums_prv else : forums = forums_pub From 2e33140009e0f4e40507e84f8d3b39b876844064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Tue, 8 Jul 2014 00:08:00 +0200 Subject: [PATCH 009/178] Ajout de la fonction travis_retry sur l'utilisation de pip --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6871860237..dc2cf9466e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,8 @@ install: - "export PATH=$PATH:~/cabal/bin" - "sudo ~/cabal/bin/pandoc --version" - "sudo apt-get --reinstall install -qq language-pack-fr" - - "pip install -r requirements.txt" - - "pip install coveralls" + - "travis_retry pip install -r requirements.txt" + - "travis_retry pip install coveralls" # NodeJS + NPM stuff - "sudo add-apt-repository -y ppa:chris-lea/node.js" - "sudo apt-get -y update" From 49d0f58eb75764d5f1b4a09cd3645d2101be32f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Mon, 7 Jul 2014 23:50:08 +0200 Subject: [PATCH 010/178] =?UTF-8?q?Enl=C3=A8ve=20les=20"=20inutiles=20dans?= =?UTF-8?q?=20les=20commandes=20de=20travis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit En YAML, pas besoin pour les chaines de caractères (sauf pour échapper des caractères spéciaux) de les délimiter par des " --- .travis.yml | 55 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc2cf9466e..bf009718c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,42 +2,41 @@ git: depth: 1 language: python python: - - "2.7" + - 2.7 notifications: irc: channels: - - "irc.smoothirc.net#zds-dev" + - irc.smoothirc.net#zds-dev skip_join: true - cache: - apt install: - - "sudo apt-get update" - - "sudo echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections" - - "sudo apt-get install ttf-mscorefonts-installer" - - "sudo apt-get install texlive" - - "sudo apt-get install texlive-xetex" - - "sudo apt-get install texlive-lang-french" - - "sudo apt-get install texlive-latex-extra" - - "sudo mkdir -p ~/cabal/bin" - - "sudo mkdir -p ~/.pandoc" - - "sudo wget -P ~/cabal/bin https://dl.dropboxusercontent.com/u/18967337/pandoc" - - "sudo wget -P ~/.pandoc/templates https://dl.dropboxusercontent.com/u/14517385/dev/default.epub" - - "sudo wget -P ~/.pandoc/templates https://dl.dropboxusercontent.com/u/14517385/dev/default.html" - - "sudo touch ~/.pandoc/epub.css" - - "sudo touch ~/.pandoc/templates/epub.css" - - "sudo chmod u+x,g+x,o+x ~/cabal/bin/pandoc" - - "export PATH=$PATH:~/cabal/bin" - - "sudo ~/cabal/bin/pandoc --version" - - "sudo apt-get --reinstall install -qq language-pack-fr" - - "travis_retry pip install -r requirements.txt" - - "travis_retry pip install coveralls" + - sudo apt-get update + - sudo echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections + - sudo apt-get install ttf-mscorefonts-installer + - sudo apt-get install texlive + - sudo apt-get install texlive-xetex + - sudo apt-get install texlive-lang-french + - sudo apt-get install texlive-latex-extra + - sudo mkdir -p ~/cabal/bin + - sudo mkdir -p ~/.pandoc + - sudo wget -P ~/cabal/bin https://dl.dropboxusercontent.com/u/18967337/pandoc + - sudo wget -P ~/.pandoc/templates https://dl.dropboxusercontent.com/u/14517385/dev/default.epub + - sudo wget -P ~/.pandoc/templates https://dl.dropboxusercontent.com/u/14517385/dev/default.html + - sudo touch ~/.pandoc/epub.css + - sudo touch ~/.pandoc/templates/epub.css + - sudo chmod u+x,g+x,o+x ~/cabal/bin/pandoc + - export PATH=$PATH:~/cabal/bin + - sudo ~/cabal/bin/pandoc --version + - sudo apt-get --reinstall install -qq language-pack-fr + - travis_retry pip install -r requirements.txt + - travis_retry pip install coveralls # NodeJS + NPM stuff - - "sudo add-apt-repository -y ppa:chris-lea/node.js" - - "sudo apt-get -y update" - - "sudo apt-get -y install nodejs" - - "npm install -g bower gulp" - - "npm install" + - sudo add-apt-repository -y ppa:chris-lea/node.js + - sudo apt-get -y update + - sudo apt-get -y install nodejs + - npm install -g bower gulp + - npm install script: - npm run-script travis - coverage run --source='.' manage.py test From 1473fe0054a0670a522a7e72e8191fe93b03b0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Tue, 8 Jul 2014 00:12:07 +0200 Subject: [PATCH 011/178] =?UTF-8?q?A=C3=A8re=20un=20peu=20le=20fichier=20t?= =?UTF-8?q?ravis.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.travis.yml b/.travis.yml index bf009718c2..95f840c36c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,22 @@ git: depth: 1 + language: python + python: - 2.7 + notifications: irc: channels: - irc.smoothirc.net#zds-dev skip_join: true + cache: - apt + install: + # APT Stuff - sudo apt-get update - sudo echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections - sudo apt-get install ttf-mscorefonts-installer @@ -18,6 +24,8 @@ install: - sudo apt-get install texlive-xetex - sudo apt-get install texlive-lang-french - sudo apt-get install texlive-latex-extra + + # Cabal + Pandoc stuff - sudo mkdir -p ~/cabal/bin - sudo mkdir -p ~/.pandoc - sudo wget -P ~/cabal/bin https://dl.dropboxusercontent.com/u/18967337/pandoc @@ -29,16 +37,21 @@ install: - export PATH=$PATH:~/cabal/bin - sudo ~/cabal/bin/pandoc --version - sudo apt-get --reinstall install -qq language-pack-fr + + # Python dependencies - travis_retry pip install -r requirements.txt - travis_retry pip install coveralls + # NodeJS + NPM stuff - sudo add-apt-repository -y ppa:chris-lea/node.js - sudo apt-get -y update - sudo apt-get -y install nodejs - npm install -g bower gulp - npm install + script: - npm run-script travis - coverage run --source='.' manage.py test + after_success: - coveralls From db9833ebb7e331a7810b328d647a80e044df5be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baptiste=20Clavi=C3=A9?= Date: Tue, 8 Jul 2014 00:12:28 +0200 Subject: [PATCH 012/178] Ajoute pip dans le cache --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 95f840c36c..d13ecc88e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ notifications: cache: - apt + - pip install: # APT Stuff From 6278af2bff4a5a227cb5022a70edba23afea15cd Mon Sep 17 00:00:00 2001 From: firm1 Date: Tue, 8 Jul 2014 00:26:24 +0200 Subject: [PATCH 013/178] corrige les patterns d'urls de recherche --- zds/article/urls.py | 2 +- zds/forum/urls.py | 4 ++-- zds/tutorial/urls.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zds/article/urls.py b/zds/article/urls.py index 12f4f9d2af..f1b2532f12 100644 --- a/zds/article/urls.py +++ b/zds/article/urls.py @@ -29,7 +29,7 @@ url(r'^nouveau/$', 'zds.article.views.new'), url(r'^editer/$', 'zds.article.views.edit'), url(r'^modifier/$', 'zds.article.views.modify'), - url(r'^recherche/(?P.+)/$', + url(r'^recherche/(?P\d+)/$', 'zds.article.views.find_article'), diff --git a/zds/forum/urls.py b/zds/forum/urls.py index c55967a2b8..909f1467f8 100644 --- a/zds/forum/urls.py +++ b/zds/forum/urls.py @@ -46,7 +46,7 @@ 'zds.forum.views.move_topic'), url(r'^sujet/(?P\d+)/(?P.+)/$', 'zds.forum.views.topic'), - url(r'^sujets/membre/(?P.+)/$', + url(r'^sujets/membre/(?P\d+)/$', 'zds.forum.views.find_topic'), url(r'^sujets/tag/(?P\d+)/(?P.+)/$', 'zds.forum.views.find_topic_by_tag'), @@ -66,7 +66,7 @@ 'zds.forum.views.like_post'), url(r'^message/dislike/$', 'zds.forum.views.dislike_post'), - url(r'^messages/(?P.+)/$', + url(r'^messages/(?P\d+)/$', 'zds.forum.views.find_post'), # Forum details diff --git a/zds/tutorial/urls.py b/zds/tutorial/urls.py index 55787d0c5b..049e4ebd68 100644 --- a/zds/tutorial/urls.py +++ b/zds/tutorial/urls.py @@ -9,7 +9,7 @@ # Viewing # Current URLs - url(r'^recherche/(?P.+)/$', + url(r'^recherche/(?P\d+)/$', 'zds.tutorial.views.find_tuto'), url(r'^off/(?P\d+)/(?P.+)/(?P\d+)/(?P.+)/(?P\d+)/(?P.+)/$', From e86f3645983c2eed7f80fc1a63c28073069a9003 Mon Sep 17 00:00:00 2001 From: firm1 Date: Tue, 8 Jul 2014 01:06:49 +0200 Subject: [PATCH 014/178] =?UTF-8?q?corrige=20le=20probl=C3=A8me=20de=20t?= =?UTF-8?q?=C3=A9l=C3=A9chargement=20des=20images=20de=20tuto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zds/tutorial/views.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/zds/tutorial/views.py b/zds/tutorial/views.py index b010edfc18..ca580077d8 100644 --- a/zds/tutorial/views.py +++ b/zds/tutorial/views.py @@ -2664,18 +2664,19 @@ def get_url_images(md_text, pt): # relative link srcfile = settings.SITE_ROOT + img[1] - dstroot = pt + img[1] - dstdir = os.path.dirname(dstroot) - if not os.path.exists(dstdir): - os.makedirs(dstdir) - shutil.copy(srcfile, dstroot) - ext = dstroot.split(".")[-1] - - # if image is gif, convert to png - - if ext == "gif": - im = ImagePIL.open(dstroot) - im.save(os.path.join(dstroot.split(".")[0] + ".png")) + if os.path.isfile(srcfile): + dstroot = pt + img[1] + dstdir = os.path.dirname(dstroot) + if not os.path.exists(dstdir): + os.makedirs(dstdir) + shutil.copy(srcfile, dstroot) + ext = dstroot.split(".")[-1] + + # if image is gif, convert to png + + if ext == "gif": + im = ImagePIL.open(dstroot) + im.save(os.path.join(dstroot.split(".")[0] + ".png")) def sub_urlimg(g): From e767259de4fa4b954d9e8794960e042602ca834d Mon Sep 17 00:00:00 2001 From: Alex-D Date: Tue, 8 Jul 2014 02:19:11 +0200 Subject: [PATCH 015/178] =?UTF-8?q?Change=20le=20lien=20de=20l'aide=20mark?= =?UTF-8?q?down=20compl=C3=A8te?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/markdown-help.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/markdown-help.js b/assets/js/markdown-help.js index a0e4ba86d3..320883e23d 100644 --- a/assets/js/markdown-help.js +++ b/assets/js/markdown-help.js @@ -14,7 +14,7 @@ "html": "
    " + "

    Les simples retours à la ligne ne sont pas pris en compte. Pour créer un nouveau paragraphe, pensez à sauter une ligne !

    " + "
    **gras** \n*italique* \n[texte de lien](url du lien) \n> citation \n+ liste a puces 
    " + - "Voir la documentation complète
    " + + "Voir la documentation complète" + ""+ "Masquer" + "Afficher l'aide Markdown" + From 388d6828c0e0ad681f359f0d5fb698899291f496 Mon Sep 17 00:00:00 2001 From: Alex-D Date: Tue, 8 Jul 2014 03:22:49 +0200 Subject: [PATCH 016/178] Ajoute la licence des tutoriels --- assets/scss/_all-supports.scss | 5 +++++ templates/tutorial/tutorial/view.html | 4 ++++ templates/tutorial/tutorial/view_online.html | 4 ++++ zds/tutorial/views.py | 15 ++++++++++++++- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/assets/scss/_all-supports.scss b/assets/scss/_all-supports.scss index 16c28309e8..ee4817fe83 100644 --- a/assets/scss/_all-supports.scss +++ b/assets/scss/_all-supports.scss @@ -1016,6 +1016,11 @@ } } + .license { + float: right; + margin-top: -45px; + } + .subtitle { font-size: 18px; font-size: 1.8rem; diff --git a/templates/tutorial/tutorial/view.html b/templates/tutorial/tutorial/view.html index c84ea8eeb4..4add8a1762 100644 --- a/templates/tutorial/tutorial/view.html +++ b/templates/tutorial/tutorial/view.html @@ -25,6 +25,10 @@

    {{ tutorial.title }}

    +

    + {{ tutorial.licence.title }} +

    + {% if tutorial.description %}

    {{ tutorial.description }} diff --git a/templates/tutorial/tutorial/view_online.html b/templates/tutorial/tutorial/view_online.html index 9399a9d5b8..d2d738cd73 100644 --- a/templates/tutorial/tutorial/view_online.html +++ b/templates/tutorial/tutorial/view_online.html @@ -27,6 +27,10 @@

    {{ tutorial.title }}

    +

    + {{ tutorial.licence.title }} +

    + {% if tutorial.description %}

    {{ tutorial.description }} diff --git a/zds/tutorial/views.py b/zds/tutorial/views.py index ca580077d8..d6020457a6 100644 --- a/zds/tutorial/views.py +++ b/zds/tutorial/views.py @@ -738,9 +738,12 @@ def view_tutorial_online(request, tutorial_pk, tutorial_slug): # find the good manifest file mandata = tutorial.load_json_for_public() - mandata = tutorial.load_dic(mandata) + mandata["licence"] = {} + mandata["licence"]["code"] = tutorial.licence.code + mandata["licence"]["title"] = tutorial.licence.title + # If it's a small tutorial, fetch its chapter if tutorial.type == "MINI": @@ -1120,6 +1123,11 @@ def view_part_online( mandata = tutorial.load_json_for_public() mandata = tutorial.load_dic(mandata) + + mandata["licence"] = {} + mandata["licence"]["code"] = tutorial.licence.code + mandata["licence"]["title"] = tutorial.licence.title + mandata["get_parts"] = mandata["parts"] parts = mandata["parts"] cpt_p = 1 @@ -1444,6 +1452,11 @@ def view_chapter_online( mandata = tutorial.load_json_for_public() mandata = tutorial.load_dic(mandata) + + mandata["licence"] = {} + mandata["licence"]["code"] = tutorial.licence.code + mandata["licence"]["title"] = tutorial.licence.title + mandata['get_parts'] = mandata["parts"] parts = mandata["parts"] cpt_p = 1 From a4a43b7e92df36ab40387318b3492c908aa04cb7 Mon Sep 17 00:00:00 2001 From: Alex-D Date: Tue, 8 Jul 2014 03:24:22 +0200 Subject: [PATCH 017/178] Ajoute la licence sur les chapitres et parties --- templates/tutorial/chapter/view.html | 4 +++ templates/tutorial/chapter/view_online.html | 28 ++++++++++++--------- templates/tutorial/part/view.html | 4 +++ templates/tutorial/part/view_online.html | 4 +++ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/templates/tutorial/chapter/view.html b/templates/tutorial/chapter/view.html index a3e6499ce3..99bad95a8f 100644 --- a/templates/tutorial/chapter/view.html +++ b/templates/tutorial/chapter/view.html @@ -26,6 +26,10 @@

    {{ chapter.title }}

    +

    + {{ tutorial.licence.title }} +

    + {% include 'tutorial/includes/tags_authors.part.html' %} {% if tutorial.in_beta and tutorial.sha_beta == version %} diff --git a/templates/tutorial/chapter/view_online.html b/templates/tutorial/chapter/view_online.html index f131ed15c2..43aba76193 100644 --- a/templates/tutorial/chapter/view_online.html +++ b/templates/tutorial/chapter/view_online.html @@ -19,18 +19,6 @@ -{% block content %} - {% with tutorial=chapter.get_tutorial %} - {% with authors=tutorial.authors.all %} - {% include "tutorial/includes/chapter_pager.part.html" with position="top" online=True %} - {% include "tutorial/includes/chapter_online.part.html" %} - {% include "tutorial/includes/chapter_pager.part.html" with position="bttom" online=True %} - {% endwith %} - {% endwith %} -{% endblock %} - - - {% block headline %} {% if chapter.tutorial %} {% set chapter.tutorial as tutorial %} @@ -38,6 +26,10 @@ {% set chapter.part.tutorial as tutorial %} {% endif %} +

    + {{ tutorial.licence.title }} +

    +

    {% if chapter.image %} @@ -50,6 +42,18 @@

    +{% block content %} + {% with tutorial=chapter.get_tutorial %} + {% with authors=tutorial.authors.all %} + {% include "tutorial/includes/chapter_pager.part.html" with position="top" online=True %} + {% include "tutorial/includes/chapter_online.part.html" %} + {% include "tutorial/includes/chapter_pager.part.html" with position="bttom" online=True %} + {% endwith %} + {% endwith %} +{% endblock %} + + + {% block sidebar_blocks %} {% if perms.tutorial.change_tutorial %}