Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Change Submission Content Page into a) Content Page as a View b) Content Edit Page #82

Open
wants to merge 3 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
293 changes: 136 additions & 157 deletions src/pretalx/orga/templates/orga/submission/content.html
Original file line number Diff line number Diff line change
@@ -1,173 +1,152 @@
{% extends "orga/submission/base.html" %}
{% load bootstrap4 %}
{% load compress %}
{% load filesize %}
{% load formset_tags %}
{% load i18n %}
{% load rich_text %}
{% load static %}
{% load rules %}

{% block submission_content %}
{% has_perm 'orga.send_mails' request.user request.event as can_send_mails %}
{% has_perm 'orga.view_all_reviews' request.user request.event as can_view_all_reviews %}
<script src="{% static "vendored/marked.min.js" %}" defer></script> {# do not compress #}
{% compress js %}
<script defer src="{% static "js/jquery.formset.js" %}"></script>
<script defer src="{% static "cfp/js/animateFormset.js" %}"></script>
<script defer src="{% static "vendored/moment-with-locales.js" %}"></script>
<script defer src="{% static "vendored/moment-timezone-with-data-10-year-range.js" %}"></script>
<script defer src="{% static "vendored/datetimepicker/bootstrap-datetimepicker.js" %}"></script>
<script defer src="{% static "orga/js/datetimepicker.js" %}"></script>
<script defer src="{% static "orga/js/speakers.js" %}"></script>
<script defer src="{% static "orga/js/submission_form.js" %}"></script>
{% endcompress %}
<form method="post" enctype="multipart/form-data"><fieldset>
{% if not submission %}
<legend>{% translate "Create proposal" %}</legend>
{% endif %}

{% if submission.access_code %}
<div class="alert alert-info"><span></span><span>
{% blocktranslate trimmed %}
This proposal was created using an access code:
{% endblocktranslate %} <a href="{{ submission.access_code.urls.edit }}">{{ submission.access_code.code }}</a>
</span></div>
{% endif %}
{% bootstrap_form_errors form %}
{% csrf_token %}
{% bootstrap_field form.title layout='event' %}
{% if action == "create" %}
{% bootstrap_field form.speaker layout='event' %}
{% bootstrap_field form.speaker_name layout='event' %}
{% bootstrap_field form.state layout='event' %}
{% endif %}
{% if form.room %}
<div id="show-if-state" {% if action == "create" %}class="d-none"{% endif %}>
{% bootstrap_field form.room layout='event' %}
{% bootstrap_field form.start layout='event' %}
{% bootstrap_field form.end layout='event' %}
<script src="{% static "vendored/marked.min.js" %}" defer></script>
<form method="post" id="review-form">
{% csrf_token %}
{% if tags_form %}{% bootstrap_form_errors tags_form %}{% endif %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Proposal Title" %}</label>
<div class="col-md-9 mt-1">
{{ submission.title|default:'-' }}
</div>
</div>
{% endif %}
{% if form.instance.median_score != None and can_view_all_reviews %}
<div class="form-group row">
<label class="col-md-3 col-form-label">
{% translate "Reviews" %}
</label>
<div class="col-md-9">
<label>
{{ submission.reviews.count }} {% translate "reviews" %}
</label>
<label class="col-md-3 col-form-label">{% translate "Session Type" %}</label>
<div class="col-md-9 mt-1">
{{ submission.submission_type }}
</div>
</div>
{% endif %}
{% bootstrap_field form.submission_type layout='event' %}
{% if form.track %}{% bootstrap_field form.track layout='event' %}{% endif %}
{% if form.tags %}{% bootstrap_field form.tags layout='event' %}{% endif %}
{% if form.abstract %}{% bootstrap_field form.abstract layout='event' %}{% endif %}
{% if form.description %}{% bootstrap_field form.description layout='event' %}{% endif %}
{% if form.notes %}{% bootstrap_field form.notes layout='event' %}{% endif %}
{% bootstrap_field form.internal_notes layout='event' %}
{% if form.content_locale %}{% bootstrap_field form.content_locale layout='event' %}{% endif %}
{% if form.do_not_record %}{% bootstrap_field form.do_not_record layout='event' %}{% endif %}
{% bootstrap_field form.is_featured layout='event' %}
{% bootstrap_field form.duration addon_after='minutes' layout='event' addon_after_class="input-group-append input-group-text" %}
{% if form.slot_count %}{% bootstrap_field form.slot_count layout='event' %}{% endif %}
{% if form.image %}{% bootstrap_field form.image layout='event' %}{% endif %}
{% if action != 'create' %}
<div class="formset form-group row" data-formset data-formset-prefix="{{ formset.prefix }}">
{{ formset.management_form }}
{% bootstrap_formset_errors formset %}
<label class="col-md-3 col-form-label" for="resources">{% translate "Resources" %}</label>
<div data-formset-body class="col-md-9">
{% for form in formset %}
<div data-formset-form class="mb-2">
<div class="sr-only">
{{ form.id }}
{% bootstrap_field form.DELETE form_group_class="" layout="inline" %}
</div>
<div class="resource-option-row">
<div class="resource-option-input{% if action == 'view' %} disabled{% endif %}">
{% bootstrap_form_errors form %}
{% bootstrap_field form.description layout='inline' %}
{% if form.instance.link %}
{% bootstrap_field form.link layout='inline' %}
{% else %}
<i class="fa fa-paperclip mr-1 ml-2 pt-1"></i> <a href="{{ form.instance.url }}">{{ form.instance.filename }}</a>
{% endif %}
</div>
{% if action != 'view' %}
<div class="resource-option-delete">
<button type="button" class="btn btn-danger btn-sm" data-formset-delete-button>
<i class="fa fa-trash"></i></button>
</div>
{% endif %}
</div>
</div>
{% empty %}
<div class="mt-1">
{% translate "This proposal has no file uploads yet." %}
</div>
{% endfor %}
{% if submission.track %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Track" %}</label>
<div class="col-md-9 mt-1">
{{ submission.track.name|default:'-' }}
</div>
</div>
<script type="form-template" data-formset-empty-form>
{% escapescript %}
<div data-formset-form class="formset-row">
<div class="sr-only">
{{ formset.empty_form.id }}
{% bootstrap_field formset.empty_form.DELETE form_group_class="" layout="inline" %}
</div>
<div class="resource-option-row">
<div class="resource-option-input">
{% bootstrap_field formset.empty_form.description layout='inline' %}
{% bootstrap_field formset.empty_form.link layout='inline' %}
{% bootstrap_field formset.empty_form.resource layout='inline' %}
</div>
<div class="resource-option-delete">
<button type="button" class="btn btn-danger btn-sm" data-formset-delete-button>
<i class="fa fa-trash"></i></button>
</div>
{% endif %}
{% if submission.tags.all %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Tags" %}</label>
<div class="col-md-9 mt-1">
<ul>
{% for tag in submission.tags.all %}
<li>{{ tag }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% if request.event.cfp.request_abstract %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Abstract" %}</label>
<div class="col-md-9 mt-1">
{{ submission.abstract|rich_text|default:'-' }}
</div>
</div>
{% endif %}
{% if request.event.cfp.request_description %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Description" %}</label>
<div class="col-md-9 mt-1">
{{ submission.description|rich_text|default:'-' }}
</div>
</div>
{% endif %}
{% if request.event.cfp.request_notes %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Notes" %}</label>
<div class="col-md-9 mt-1">
{{ submission.notes|rich_text|default:'-' }}
</div>
</div>
{% endif %}
{% if submission.internal_notes %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Internal Notes" %}</label>
<div class="col-md-9 mt-1">
{{ submission.internal_notes|rich_text|default:'-' }}
</div>
</div>
{% endif %}
{% if request.event.cfp.request_do_not_record %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Don't record this session" %}</label>
<div class="col-md-9 mt-1">
{{ submission.do_not_record|rich_text|default:'-' }}
</div>
</div>
{% endif %}
{% if submission.is_featured%}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Show this session in public list of featured sessions." %}</label>
<div class="col-md-9 mt-1">
{{ submission.is_featured|rich_text|default:'-' }}
</div>
</div>
{% endif %}
{% if submission.duration %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Duration" %}</label>
<div class="d-flex col-md-9 mt-1">
{{ submission.duration|rich_text|default:'-' }} minutes
</div>
</div>
{%else%}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Duration" %}</label>
<div class="col-md-9 mt-1">
{{ submission.duration|rich_text|default:'-' }}
</div>
</div>
{% endif %}
{% if request.event.cfp.request_image %}
{% if submission.image %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Image" %}</label>
<div class="col-md-9 mt-1">
<a href = "{{ submission.image.url|default:'-' }}">{{submission.image.name}}</a>
</div>
<div class="form-text text-muted mt-0 pt-0 mb-2">
{% translate "You can either provide a URL or upload a file." %}
{% translate "Max file size:" %}
{{ settings.FILE_UPLOAD_DEFAULT_LIMIT | filesize }}
</div>
{% else %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Image" %}</label>
<div class="col-md-9 mt-1">
{% translate "-" %}
</div>
{% endescapescript %}
</script>
{% if action != 'view' %}
<div class="col-md-3 offset-md-9">
<button type="button" class="btn btn-info btn-block" data-formset-add>
<i class="fa fa-plus"></i> {% translate "Add another resource" %}</button>
</div>
{% endif %}
</div>
{% endif %}

{% if questions_form and questions_form.fields %}
<div><legend>{% translate "Questions" %}</legend></div>
{% bootstrap_form questions_form layout='event' %}
{% endif %}

{% if can_send_mails or not form.read_only %}
<div class="submit-group panel">
<span></span>
<span>
{% if form.instance.code and can_send_mails %}
<a class="btn btn-lg btn-info" href="{{ request.event.orga_urls.compose_mails_sessions }}?submission={{ form.instance.code }}">
<i class="fa fa-envelope-o"></i>
{% translate "Send mail to speakers" %}
</a>
{% endif %}
{% if not form.read_only %}
<button type="submit" class="btn btn-success btn-lg">
<i class="fa fa-check"></i>
{% translate "Save" %}
</button>
{% endif %}
</span>
</div>
{% endif %}
</fieldset></form>

<span id="vars" remoteUrl="{{ request.event.orga_urls.users }}?search=%QUERY"></span>
{% endif %}
{% if submission.active_resources %}
<div class="form-group row">
<label class="col-md-3 col-form-label">{% translate "Resources" %}</label>
<div class="col-md-9 mt-1">
{% for resource in submission.active_resources %}
{% include "agenda/includes/submission_resource.html" %}
{% if not forloop.last %}<br>{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% if questions_form.fields %}
<div class="form-group">
<label class="col-md-3 col-form-label">{% translate "Questions" %}</label>
<div class="col-md-9 mt-1">
{% for field_name, field in questions_form.fields.items %}
<div>
<strong>{{ field.label }}</strong>: {{ field.answer.answer}}
</div>
{% endfor %}
</div>
</div>
{% endif %}
<a class="btn btn-primary" href="{{submission.orga_urls.edit}}">
<i class="fa fa-edit"></i>
{% translate "Edit" %}
</a>
</form>
{% endblock %}
Loading
Loading