From 000533336156a9821de71ca55f8a7c02a09760de Mon Sep 17 00:00:00 2001 From: Bibhas Date: Sat, 14 Oct 2017 11:50:37 +0530 Subject: [PATCH] Switch to .html.jinja2 templates, fixes #286 (#287) * Switch to .html.jinja2 templates, fixes #286 * fixed travis config * installing coverage for tests * added test settings * missed one --- .gitignore | 1 - .travis.yml | 5 +-- .../{comments.html => comments.html.jinja2} | 0 .../{delete.html => delete.html.jinja2} | 4 +-- .../{event.html => event.html.jinja2} | 12 +++---- .../{forms.html => forms.html.jinja2} | 0 .../{index.html => index.html.jinja2} | 6 ++-- .../{layout.html => layout.html.jinja2} | 4 +-- .../{cardset.html => cardset.html.jinja2} | 0 ...ge_event.html => manage_event.html.jinja2} | 10 +++--- .../{profile.html => profile.html.jinja2} | 4 +-- .../{project.html => project.html.jinja2} | 6 ++-- .../{sponsor.html => sponsor.html.jinja2} | 2 +- .../{stream.html => stream.html.jinja2} | 2 +- .../{venue.html => venue.html.jinja2} | 4 +-- .../{venuelist.html => venuelist.html.jinja2} | 2 +- .../{withdraw.html => withdraw.html.jinja2} | 4 +-- hacknight/views/event.py | 8 ++--- hacknight/views/index.py | 4 +-- hacknight/views/profile.py | 2 +- hacknight/views/project.py | 8 ++--- hacknight/views/sponsor.py | 2 +- hacknight/views/venue.py | 4 +-- instance/testing.py | 35 +++++++++++++++++++ runtests.py | 7 ---- runtests.sh | 5 +++ test_requirements.txt | 1 + 27 files changed, 88 insertions(+), 54 deletions(-) rename hacknight/templates/{comments.html => comments.html.jinja2} (100%) rename hacknight/templates/{delete.html => delete.html.jinja2} (83%) rename hacknight/templates/{event.html => event.html.jinja2} (98%) rename hacknight/templates/{forms.html => forms.html.jinja2} (100%) rename hacknight/templates/{index.html => index.html.jinja2} (90%) rename hacknight/templates/{layout.html => layout.html.jinja2} (93%) rename hacknight/templates/macros/{cardset.html => cardset.html.jinja2} (100%) rename hacknight/templates/{manage_event.html => manage_event.html.jinja2} (96%) rename hacknight/templates/{profile.html => profile.html.jinja2} (81%) rename hacknight/templates/{project.html => project.html.jinja2} (97%) rename hacknight/templates/{sponsor.html => sponsor.html.jinja2} (94%) rename hacknight/templates/{stream.html => stream.html.jinja2} (75%) rename hacknight/templates/{venue.html => venue.html.jinja2} (96%) rename hacknight/templates/{venuelist.html => venuelist.html.jinja2} (92%) rename hacknight/templates/{withdraw.html => withdraw.html.jinja2} (83%) create mode 100644 instance/testing.py delete mode 100755 runtests.py create mode 100755 runtests.sh create mode 100644 test_requirements.txt diff --git a/.gitignore b/.gitignore index 3ccfc9e..b68584f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ dist/ .webassets-cache nosetests.xml .sass-cache -instance/testing.py instance/development.py instance/production.py instance/settings.py diff --git a/.travis.yml b/.travis.yml index 9dbb9c9..8559e3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,10 @@ python: - "2.7" # command to install dependencies install: - - pip install -r requirements.txt --use-mirrors + - pip install -r requirements.txt + - pip install -r test_requirements.txt # command to run tests -script: python runtests.py +script: ./runtests.sh notifications: email: false slack: diff --git a/hacknight/templates/comments.html b/hacknight/templates/comments.html.jinja2 similarity index 100% rename from hacknight/templates/comments.html rename to hacknight/templates/comments.html.jinja2 diff --git a/hacknight/templates/delete.html b/hacknight/templates/delete.html.jinja2 similarity index 83% rename from hacknight/templates/delete.html rename to hacknight/templates/delete.html.jinja2 index 9c79eae..94c5c22 100644 --- a/hacknight/templates/delete.html +++ b/hacknight/templates/delete.html.jinja2 @@ -1,5 +1,5 @@ -{% extends "layout.html" %} -{% from "forms.html" import renderform, ajaxform %} +{% extends "layout.html.jinja2" %} +{% from "forms.html.jinja2" import renderform, ajaxform %} {% block content %}

{{ message }}

diff --git a/hacknight/templates/event.html b/hacknight/templates/event.html.jinja2 similarity index 98% rename from hacknight/templates/event.html rename to hacknight/templates/event.html.jinja2 index d627b85..b594756 100644 --- a/hacknight/templates/event.html +++ b/hacknight/templates/event.html.jinja2 @@ -1,4 +1,4 @@ -{% extends "layout.html" %} +{% extends "layout.html.jinja2" %} {% block title %}{{ event.title }}{% endblock %} {% macro participant_list(event, participants) -%} @@ -8,7 +8,7 @@
{{ p.user.fullname }} - +
{% with projects = p.user.projects_in(event) %} {%- if projects %} @@ -116,7 +116,7 @@

{{ self.title() }}

{% endif -%} {% endif -%} - +