Skip to content

Commit

Permalink
Add some more blocks to the talk form to simplify custimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Muller committed Jun 28, 2023
1 parent 3384e63 commit ae1e210
Showing 1 changed file with 40 additions and 32 deletions.
72 changes: 40 additions & 32 deletions wafer/talks/templates/wafer.talks/talk_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,53 @@
{% load static %}
{% block content %}
<section class="wafer wafer-talk-edit">
{% if can_edit %}
<h1>{% trans "Edit Talk" %}</h1>
{% with corresponding_author_name=object.corresponding_author.userprofile.display_name %}
{% url 'wafer_user_profile' username=object.corresponding_author.username as corresponding_author_url %}
{% block heading %}
{% if can_edit %}
<h1>{% trans "Edit Talk" %}</h1>
{% with corresponding_author_name=object.corresponding_author.userprofile.display_name %}
{% url 'wafer_user_profile' username=object.corresponding_author.username as corresponding_author_url %}
{% blocktrans trimmed %}
<p>Submitted by <a href="{{ corresponding_author_url }}">{{ corresponding_author_name }}</a>.</p>
{% endblocktrans %}
{% endwith %}
{% else %}
<h1>{% trans "Talk Submission" %}</h1>
{% endif %}
{% endblock heading %}
{% if not can_edit and not can_submit %}
{% block talks_closed %}
{% blocktrans trimmed %}
<p>Submitted by <a href="{{ corresponding_author_url }}">{{ corresponding_author_name }}</a>.</p>
<em>Talk submission is closed</em>
{% endblocktrans %}
{% endwith %}
{% endblock talks_closed %}
{% else %}
<h1>{% trans "Talk Submission" %}</h1>
{% endif %}
{% if not can_edit and not can_submit %}
{% blocktrans trimmed %}
<em>Talk submission is closed</em>
{% endblocktrans %}
{% else %}
{% url 'wafer_user_edit_profile' form.user as edit_bio_url %}
{% if form.user.userprofile.bio %}
<div>
<label for="bio" class="col-form-label">
{% trans "Your Biography" %}
<a href="{{ edit_bio_url }}">{% trans "Edit" %}</a>
</label>
<div id="bio" class="card card-body">
{{ form.user.userprofile.bio|linebreaks }}
{% block form_preamble %}
{% url 'wafer_user_edit_profile' form.user as edit_bio_url %}
{% if form.user.userprofile.bio %}
<div>
<label for="bio" class="col-form-label">
{% trans "Your Biography" %}
<a href="{{ edit_bio_url }}">{% trans "Edit" %}</a>
</label>
<div id="bio" class="card card-body">
{{ form.user.userprofile.bio|linebreaks }}
</div>
</div>
</div>
{% else %}
<div class="alert alert-primary">
{% blocktrans trimmed %}
Please
<a href="{{ edit_bio_url }}">add a speaker biography</a>
before submitting a talk.
{% endblocktrans %}
</div>
{% endif %}
{% else %}
<div class="alert alert-primary">
{% blocktrans trimmed %}
Please
<a href="{{ edit_bio_url }}">add a speaker biography</a>
before submitting a talk.
{% endblocktrans %}
</div>
{% endif %}
{% endblock form_preamble %}
{% block talkform %}
<form method="post">
{% crispy form %}
</form>
{% endblock talkform %}
{% endif %}
</section>
{% endblock %}

0 comments on commit ae1e210

Please sign in to comment.