Basic styling for review section

This commit is contained in:
Tobias Schulmann 2018-06-30 15:28:03 +12:00 committed by Tobias S
parent 27ae211e39
commit 6e63465fea
5 changed files with 225 additions and 229 deletions

View file

@ -12,7 +12,7 @@ integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgB
crossorigin=""></script> crossorigin=""></script>
{% endblock %} {% endblock %}
{% block body %} {% block body_out %}
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<img src="{% static 'assets/Header_placeholder.jpg' %}" id="hero"> <img src="{% static 'assets/Header_placeholder.jpg' %}" id="hero">

View file

@ -57,10 +57,10 @@
<h1 class="text-primary text-upper h2 mb-5">{% block page_title %}{% endblock %}</h1> <h1 class="text-primary text-upper h2 mb-5">{% block page_title %}{% endblock %}</h1>
{% block body_base %} {% block body_base %}
{% block body %} {% block body_out %}
<div class="row"> <div class="row">
<div class="col-md-1"> <div class="col-md-12">
{% block body_outer %} {% block body_outer %}
{% endblock %} {% endblock %}
</div> </div>

View file

@ -1,6 +1,6 @@
{% load i18n %} {% load i18n %}
<table class="table table-striped table-bordered table-reviews"> <table class="table table-striped table-reviews">
<thead> <thead>
<th>#</th> <th>#</th>
<th>{% trans "Speaker / Title" %}</th> <th>{% trans "Speaker / Title" %}</th>

View file

@ -6,82 +6,81 @@
{% block body_class %}reviews{% endblock %} {% block body_class %}reviews{% endblock %}
{% block body_outer %} {% block body_outer %}
<div class="l-content-page"> <div class="row text-primary">
<div class="l-content-page--richtext"> <div class="col-md-4">
<div class="rich-text"> {% block sidebar %}
{% for section in review_sections %}
<div class="row"> <div class="card card-default mb-4">
<div class="col-md-2"> <div class="card-header">
{% block sidebar %} <h3 class="card-title">{{ section }}</h3>
{% for section in review_sections %} </div>
<div class="panel panel-default"> <div class="list-group">
<div class="panel-heading"> <a class="list-group-item review-list" href="{% url "review_section" section.section.slug %}">
<h3 class="panel-title">{{ section }}</h3> {% trans "All Reviews" %}
</div> </a>
<div class="list-group"> {% comment %}
<a class="list-group-item review-list" href="{% url "review_section" section.section.slug %}"> <li>
{% trans "All Reviews" %} <a href="{% url "review_section_assignments" section.section.slug %}">
</a> {% trans "Your Assignments" %}
{% comment %} </a>
<li> </li>
<a href="{% url "review_section_assignments" section.section.slug %}"> {% endcomment %}
{% trans "Your Assignments" %} <a class="list-group-item user-reviewed" href="{% url "user_reviewed" section.section.slug %}">
</a> {% trans "Reviewed by you" %}
</li> </a>
{% endcomment %} <a class="list-group-item user-not-reviewed" href="{% url "user_not_reviewed" section.section.slug %}">
<a class="list-group-item user-reviewed" href="{% url "user_reviewed" section.section.slug %}"> {% trans "Unreviewed by you" %}
{% trans "Reviewed by you" %} </a>
</a> <a class="list-group-item user-random" href="{% url "user_random" section.section.slug %}">
<a class="list-group-item user-not-reviewed" href="{% url "user_not_reviewed" section.section.slug %}"> {% trans "Random unreviewed proposal" %}
{% trans "Unreviewed by you" %} </a>
</a> <a class="list-group-item voting-status" href="{% url "review_status" section.section.slug %}">
<a class="list-group-item user-random" href="{% url "user_random" section.section.slug %}"> {% trans "Voting Status" %}
{% trans "Random unreviewed proposal" %} </a>
</a> {% if request.user.is_staff %}
<a class="list-group-item voting-status" href="{% url "review_status" section.section.slug %}"> <a class="list-group-item review-results" href="{% url "result_notification" section.section.slug 'accepted' %}">Result Notification</a>
{% trans "Voting Status" %} {% endif %}
</a> </div>
{% if request.user.is_staff %}
<a class="list-group-item review-results" href="{% url "result_notification" section.section.slug 'accepted' %}">Result Notification</a>
{% endif %}
</div>
{% endfor %}
{% endblock %}
</div>
<div class="col-md-10">
{% block body %}
{% endblock %}
</div> </div>
{% endfor %}
{% endblock %}
</div> </div>
</div></div></div>
<div class="col-md-8">
{% block body %}
{% endblock %}
</div>
</div>
{% endblock %} {% endblock %}
{% block extra_script %} {% block extra_script %}
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs/jszip-2.5.0/dt-1.10.16/b-1.4.2/b-colvis-1.4.2/b-flash-1.4.2/b-html5-1.4.2/b-print-1.4.2/cr-1.4.1/fc-3.2.3/fh-3.1.3/r-2.2.0/rg-1.0.2/datatables.min.css"/> <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"/>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/jszip-2.5.0/dt-1.10.16/b-1.4.2/b-colvis-1.4.2/b-html5-1.4.2/b-print-1.4.2/cr-1.4.1/fc-3.2.3/fh-3.1.3/r-2.2.0/rg-1.0.2/datatables.min.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap4.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
$("table.table-reviews").dataTable({ $("table.table-reviews").dataTable({
"dom": "<'row'<'col-md-3'l><'col-md-3'B><'col-md-4'f>r>t<'row'<'col-md-3'i><'col-md-5'p>>", "stateSave": true,
"stateSave": true, "lengthMenu": [[10, 50, 100, -1], [10, 50, 100, "All"]],
"lengthMenu": [[10, 50, 100, -1], [10, 50, 100, "All"]], "pageLength": 100,
"pageLength": 100, "colReorder": true,
"colReorder": true, "buttons": [{
"buttons": [ { extend: 'collection',
extend: 'collection', text: 'Export',
text: 'Export', buttons: ["copy", "csv", "print"]
buttons: ["copy", "csv", "print"] },
}, { extend: 'collection',
{ extend: 'collection', text: 'Columns',
text: 'Columns', buttons: [
buttons: [ { extend: 'columnsToggle',
{ extend: 'columnsToggle', columns: '.toggle' },
columns: '.toggle' }, { extend: 'columnToggle',
{ extend: 'columnToggle', text: 'Vote details',
text: 'Vote details', columns: '.votes'
columns: '.votes' }
} ]
] }]});
}]}); </script>
</script>
{% endblock %} {% endblock %}

View file

@ -6,183 +6,180 @@
{% block body %} {% block body %}
<div> {% if is_manager %}
<a class="btn btn-primary" href="{% url "user_random" proposal.section.slug %}"> <div class="float-right">
{% trans "Jump to a random unreviewed proposal" %} <form class="result-form form-inline form-horizontal" method="POST" action="">
</a> {% csrf_token %}
</div> <div class="btn-group">
{% if proposal.result.status == "accepted" %}
{% if is_manager %} <a class="btn dropdown-toggle btn-success" data-toggle="dropdown" href="#">Accepted <span class="caret"></span></a>
<div class="pull-right"> <div class="dropdown-menu pull-right">
<form class="result-form form-inline form-horizontal" method="POST" action=""> <input type="submit" name="result_submit" value="reject" class="btn btn-block btn-xs btn-danger" />
{% csrf_token %} <input type="submit" name="result_submit" value="standby" class="btn btn-block btn-info btn-xs" />
<div class="btn-group"> <input type="submit" name="result_submit" value="undecide" class="btn btn-block btn-primary btn-xs" />
{% if proposal.result.status == "accepted" %}
<a class="btn dropdown-toggle btn-success" data-toggle="dropdown" href="#">Accepted <span class="caret"></span></a>
<div class="dropdown-menu pull-right">
<div class="btn-group">
<input type="submit" name="result_submit" value="reject" class="btn btn-xs btn-danger" />
<input type="submit" name="result_submit" value="standby" class="btn btn-info btn-xs" />
<input type="submit" name="result_submit" value="undecide" class="btn btn-primary btn-xs" />
</div>
</div>
<input type="submit" name="publish_changes" value="Publish Changes" class="btn btn-success" />
{% else %}
{% if proposal.result.status == "rejected" %}
<a class="btn dropdown-toggle btn-danger" data-toggle="dropdown" href="#">Rejected <span class="caret"></span></a>
<div class="dropdown-menu pull-right">
<div class="btn-group">
<input type="submit" name="result_submit" value="accept" class="btn btn-xs btn-success" />
<input type="submit" name="result_submit" value="standby" class="btn btn-info btn-xs" />
<input type="submit" name="result_submit" value="undecide" class="btn btn-default btn-xs" />
</div>
</div>
{% else %}
{% if proposal.result.status == "standby" %}
<a class="btn btn-info dropdown-toggle" data-toggle="dropdown" href="#">Standby <span class="caret"></span></a>
<div class="dropdown-menu pull-right">
<div class="btn-group">
<input type="submit" name="result_submit" value="accept" class="btn btn-xs btn-success" />
<input type="submit" name="result_submit" value="reject" class="btn btn-xs btn-danger" />
<input type="submit" name="result_submit" value="undecide" class="btn btn-primary btn-xs" />
</div>
</div>
{% else %}
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#">Undecided <span class="caret"></span></a>
<div class="dropdown-menu pull-right">
<div class="btn-group">
<input type="submit" name="result_submit" value="accept" class="btn btn-xs btn-success" />
<input type="submit" name="result_submit" value="reject" class="btn btn-xs btn-danger" />
<input type="submit" name="result_submit" value="standby" class="btn btn-info btn-xs" />
</div>
</div>
{% endif %}
{% endif %}
{% endif %}
</div>
</form>
</div>
{% endif %}
<h3>#{{ proposal.number }}: {{ proposal.title }} ({{ proposal.speaker }})</h3>
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active"><a href="#proposal-detail" data-toggle="tab">{% trans "Proposal Details" %}</a></li>
<li><a href="#proposal-reviews" data-toggle="tab">{% trans "Reviews" %} <span class="badge">{{ reviews|length }}</span></a></li>
<li><a href="#proposal-feedback" data-toggle="tab">{% trans "Speaker Feedback" %} <span class="badge">{{ proposal.messages.all|length }}</span></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="proposal-detail">
{% include "symposion/proposals/_proposal_fields.html" %}
</div> </div>
<div class="tab-pane" id="proposal-reviews"> <input type="submit" name="publish_changes" value="Publish Changes" class="btn btn-block btn-success" />
{% else %}
{% if proposal.result.status == "rejected" %}
<a class="btn btn-block dropdown-toggle btn-danger" data-toggle="dropdown" href="#">Rejected <span class="caret"></span></a>
<div class="dropdown-menu pull-right">
<input type="submit" name="result_submit" value="accept" class="btn btn-block btn-xs btn-success" />
<input type="submit" name="result_submit" value="standby" class="btn btn-block btn-info btn-xs" />
<input type="submit" name="result_submit" value="undecide" class="btn btn-block btn-default btn-xs" />
</div>
{% else %}
{% if proposal.result.status == "standby" %}
<a class="btn btn-block btn-info dropdown-toggle" data-toggle="dropdown" href="#">Standby <span class="caret"></span></a>
<div class="dropdown-menu pull-right">
<input type="submit" name="result_submit" value="accept" class="btn btn-block btn-xs btn-success" />
<input type="submit" name="result_submit" value="reject" class="btn btn-block btn-xs btn-danger" />
<input type="submit" name="result_submit" value="undecide" class="btn btn-block btn-primary btn-xs" />
</div>
{% else %}
<a class="btn btn-block btn-primary dropdown-toggle" data-toggle="dropdown" href="#">Undecided <span class="caret"></span></a>
<div class="dropdown-menu pull-right">
<input type="submit" name="result_submit" value="accept" class="btn btn-block btn-xs btn-success" />
<input type="submit" name="result_submit" value="reject" class="btn btn-block btn-xs btn-danger" />
<input type="submit" name="result_submit" value="standby" class="btn btn-block btn-info btn-xs" />
</div>
{% endif %}
{% endif %}
{% endif %}
</div>
</form>
</div>
{% endif %}
<h4>{% trans "Current Results" %}</h4> <h2 class="mb-5">#{{ proposal.number }}: {{ proposal.title }} ({{ proposal.speaker }})</h2>
<table class="table table-striped">
<thead>
<th>+2 votes</th>
<th>+1 votes</th>
<th>-1 votes</th>
<th>-2 votes</th>
<th>{% trans "Total Responses" %}
</thead>
<tbody>
<tr>
<td>{{ proposal.plus_two }}</td>
<td>{{ proposal.plus_one }}</td>
<td>{{ proposal.minus_one }}</td>
<td>{{ proposal.minus_two }}</td>
<td>{{ proposal.total_votes }}</td>
</tr>
</tbody>
</table>
<hr /> <div class="tabbable">
<ul class="nav nav-pills">
{% if review_form %} <li class="nav-item"><a class="nav-link active" href="#proposal-detail" data-toggle="tab">{% trans "Proposal Details" %}</a></li>
<li class="nav-item"><a class="nav-link" href="#proposal-reviews" data-toggle="tab">{% trans "Reviews" %} <span class="badge">{{ reviews|length }}</span></a></li>
<li class="nav-item"><a class="nav-link" href="#proposal-feedback" data-toggle="tab">{% trans "Speaker Feedback" %} <span class="badge">{{ proposal.messages.all|length }}</span></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="proposal-detail">
{% include "symposion/proposals/_proposal_fields.html" %}
</div>
<div class="tab-pane" id="proposal-reviews">
<div class="row my-4">
<div class="col-12">
<h2>{% trans "Current Results" %}</h2>
<table class="table table-striped">
<thead>
<th>+2 votes</th>
<th>+1 votes</th>
<th>-1 votes</th>
<th>-2 votes</th>
<th>{% trans "Total Responses" %}</th>
</thead>
<tbody>
<tr>
<td>{{ proposal.plus_two }}</td>
<td>{{ proposal.plus_one }}</td>
<td>{{ proposal.minus_one }}</td>
<td>{{ proposal.minus_two }}</td>
<td>{{ proposal.total_votes }}</td>
</tr>
</tbody>
</table>
<hr />
{% if review_form %}
<form method="POST" action="#proposal-reviews" class="review-form form-horizontal"> <form method="POST" action="#proposal-reviews" class="review-form form-horizontal">
<legend>{% trans "Submit Review" %}</legend> <legend>{% trans "Submit Review" %}</legend>
<p>Enter your vote and any comment to go along with it. You can revise your vote or comment multiple times with an existing vote (your previously recorded score will be replaced during calculations). <b>Your vote and comments are not public and will only be viewable by other reviewers.</b></p> <p>Enter your vote and any comment to go along with it. You can revise your vote or comment multiple times with an existing vote (your previously recorded score will be replaced during calculations). <b>Your vote and comments are not public and will only be viewable by other reviewers.</b></p>
{% csrf_token %} {% csrf_token %}
{{ review_form|bootstrap }} {{ review_form|bootstrap }}
<div class="form-action"> <div class="form-action">
<input type="submit" class="btn btn-primary" name="vote_submit" value="Submit Review" /> <input type="submit" class="btn btn-primary" name="vote_submit" value="Submit Review" />
<input type="submit" class="btn btn-primary" name="vote_submit_and_random" value="Submit Review and jump to random proposal" /> <input type="submit" class="btn btn-primary" name="vote_submit_and_random" value="Submit Review and jump to random proposal" />
</div> </div>
</form> </form>
{% else %} {% else %}
<p>You do not have permission to vote on this proposal.</p> <p>You do not have permission to vote on this proposal.</p>
{% endif %} {% endif %}
{% if reviews %} {% if reviews %}
<h5>Review Comments</h5> <h5>Review Comments</h5>
{% for review in reviews %} {% for review in reviews %}
<div class="review-box"> <div class="review-box">
<div class="vote pull-left"> <div class="vote pull-left">
<span>{{ review.vote }}</span> <span>{{ review.vote }}</span>
</div>
{% if is_manager %}
<div class="pull-right">
<form class="form-inline form-horizontal" action="{% url "review_delete" review.id %}" method="POST">
{% csrf_token %}
<button class="btn btn-xs btn-danger" type="submit">Delete</button>
</form>
</div>
{% endif %}
<div class="review-content">
&nbsp;
<b>
{% if review.user.speaker_profile %}
{{ review.user.speaker_profile.name }}
{% else %}
{{ review.user.username }}
{% endif %}
</b>
{{ review.submitted_at|timesince }} ago <br />
{{ review.comment_html|safe }}
</div>
</div> </div>
{% if is_manager %}
<div class="pull-right">
<form class="form-inline form-horizontal" action="{% url "review_delete" review.id %}" method="POST">
{% csrf_token %}
<button class="btn btn-xs btn-danger" type="submit">Delete</button>
</form>
</div>
{% endif %}
<div class="review-content">
&nbsp;
<b>
{% if review.user.speaker_profile %}
{{ review.user.speaker_profile.name }}
{% else %}
{{ review.user.username }}
{% endif %}
</b>
{{ review.submitted_at|timesince }} ago <br />
{{ review.comment_html|safe }}
</div>
</div>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
</div>
</div> </div>
<div class="tab-pane" id="proposal-feedback"> </div>
{% if review_messages %} <div class="tab-pane" id="proposal-feedback">
<h3>{% trans "Conversation with the submitter" %}</h3> <div class="row my-4">
<div class="col-12">
{% if review_messages %}
<h2>{% trans "Conversation with the submitter" %}</h2>
{% for message in review_messages %} {% for message in review_messages %}
<div class="comment-box"> <div class="comment-box">
<div class="commment-content"> <div class="commment-content">
<b>{{ message.user.username }}</b> <b>{{ message.user.username }}</b>
{{ message.submitted_at|timesince }} ago <br /> {{ message.submitted_at|timesince }} ago <br />
{{ message.message|safe }} {{ message.message|safe }}
</div>
</div> </div>
</div>
{% endfor %} {% endfor %}
<hr /> <hr />
{% endif %} {% endif %}
<form class="form-horizontal" action="" method="POST"accept-charset="utf-8"> <form class="form-horizontal" action="" method="POST"accept-charset="utf-8">
<legend>{% trans "Send a message" %}</legend> <h3>{% trans "Send a message" %}</h3>
<p> <p>
{% blocktrans %} {% blocktrans %}
If you'd like to communicate with the submitter, use the following form and he or she will be If you'd like to communicate with the submitter, use the following form and he or she will be
notified and given the opportunity to respond. notified and given the opportunity to respond.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
{% csrf_token %} {% csrf_token %}
{{ message_form|bootstrap }} {{ message_form|bootstrap }}
<div class="form-actions"> <div class="form-actions">
<input type="submit" class="btn btn-primary" name="message_submit" value="Send Message" /> <input type="submit" class="btn btn-primary" name="message_submit" value="Send Message" />
</div> </div>
</form> </form>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<div> <div>
<a class="btn btn-primary" href="{% url "user_random" proposal.section.slug %}"> <a href="{% url "user_random" proposal.section.slug %}">
{% trans "Jump to a random unreviewed proposal" %} {% trans "Jump to a random unreviewed proposal" %}
</a> </a>
</div> </div>
</div>
</div>
</div>
</div>
{% endblock %} {% endblock %}