Skip to content

Commit

Permalink
Factor out common single form templates into wafer/base_form.html
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanor committed Jan 31, 2018
1 parent d0d1bbf commit 91737ac
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 45 deletions.
7 changes: 2 additions & 5 deletions wafer/pages/templates/wafer.pages/page_form.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{% extends 'wafer/base.html' %}
{% extends 'wafer/base_form.html' %}
{% load crispy_forms_tags %}
{% load i18n %}
{% load static from staticfiles %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
<section class="wafer wafer-page-edit">
<h1>{% trans "Edit Page" %}</h1>
{% crispy form %}
</section>
{% endblock %}
{% block extra_foot %}
{{ form.media.js }}
{{ block.super }}
<script type="text/javascript" src="{% static 'js/markitup.js' %}"></script>
{% endblock %}
8 changes: 1 addition & 7 deletions wafer/registration/templates/registration/login.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{% extends 'wafer/base.html' %}
{% extends 'wafer/base_form.html' %}
{% load i18n %}
{% load crispy_forms_tags %}
{% load wafer_crispy %}
{% load wafer_sso %}
{% block title %}Login - {{ WAFER_CONFERENCE_NAME }}{% endblock %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
<div class="container">
<div class="row">
Expand Down Expand Up @@ -36,6 +33,3 @@ <h2>{% trans 'Shared/Social Log in and Sign up' %}</h2>
</div>
</div>
{% endblock %}
{% block extra_foot %}
{{ form.media.js }}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
{% extends 'wafer/base.html' %}
{% extends 'wafer/base_form.html' %}
{% load i18n %}
{% load crispy_forms_tags %}
{% load wafer_crispy %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
<h1>{% trans 'Sign up' %}</h1>
{% wafer_form_helper 'wafer.registration.forms.RegistrationFormHelper' as form_helper %}
{% crispy form form_helper %}
{% endblock %}
{% block extra_foot %}
{{ form.media.js }}
{% endblock %}
7 changes: 2 additions & 5 deletions wafer/talks/templates/wafer.talks/talk_form.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{% extends 'wafer/base.html' %}
{% extends 'wafer/base_form.html' %}
{% load i18n %}
{% load crispy_forms_tags %}
{% load static from staticfiles %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
<section class="wafer wafer-talk-edit">
{% if can_edit %}
Expand All @@ -28,6 +25,6 @@ <h1>{% trans "Talk Submission" %}</h1>
</section>
{% endblock %}
{% block extra_foot %}
{{ form.media.js }}
{{ block.super }}
<script type="text/javascript" src="{% static 'js/markitup.js' %}"></script>
{% endblock %}
12 changes: 12 additions & 0 deletions wafer/templates/wafer/base_form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% extends "wafer/base.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
{% crispy form %}
{% endblock %}
{% block extra_foot %}
{{ form.media.js }}
{% endblock %}
8 changes: 1 addition & 7 deletions wafer/tickets/templates/wafer.tickets/claim.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{% extends 'wafer/base.html' %}
{% extends 'wafer/base_form.html' %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
{% if not WAFER_REGISTRATION_OPEN %}
{% trans "Ticket sales are not currently open" %}
Expand All @@ -27,6 +24,3 @@ <h2>{% trans "Ticket claim" %}</h2>
</section>
{% endif %}
{% endblock %}
{% block extra_foot %}
{{ form.media.js }}
{% endblock %}
8 changes: 1 addition & 7 deletions wafer/users/templates/wafer.users/edit_profile.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
{% extends "wafer/base.html" %}
{% extends "wafer/base_form.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
<h1>{% trans 'Edit Profile:' %}</h1>
{% crispy form %}
{% endblock %}
{% block extra_foot %}
{{ form.media.js }}
{% endblock %}
8 changes: 1 addition & 7 deletions wafer/users/templates/wafer.users/edit_user.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{% extends "wafer/base.html" %}
{% extends "wafer/base_form.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block extra_head %}
{{ form.media.css }}
{% endblock %}
{% block content %}
<h1>{% trans 'Edit User:' %}</h1>
{% if profile_user == user and profile_user.has_usable_password %}
Expand All @@ -17,6 +14,3 @@ <h1>{% trans 'Edit User:' %}</h1>
{% endif %}
{% crispy form %}
{% endblock %}
{% block extra_foot %}
{{ form.media.js }}
{% endblock %}

0 comments on commit 91737ac

Please sign in to comment.