Fixed proposal views in dashboard

This commit is contained in:
Tobias Schulmann 2018-06-30 10:56:52 +12:00
parent 6a18824aa3
commit 8c28ca0f79
11 changed files with 5557 additions and 259 deletions

5260
dev_db.json Normal file

File diff suppressed because it is too large Load diff

View file

@ -16,217 +16,36 @@
{% block content %} {% block content %}
{% available_categories as categories %} {% available_categories as categories %}
<div class="container"> <div class="container mb-5">
<h1 class="text-primary mb-5">Dashboard</h1> <h1 class="text-primary">Dashboard</h1>
</div> </div>
{% if categories %}
{% if user.is_staff %} {% if categories %}
<div class="container"> {% include "symposion/dashboard/_categories.html" %}
<h2>Administration</h2>
<div class="page-row">
<div class="col-xs-12">
<a class="btn btn-lg btn-info" role="button" href="{% url "reports_list" %}">Reports</a>
</div>
</div>
</div>
{% endif %} {% endif %}
<div class="container">
<div class="col-12">
<h2>{% trans "Attend" %} {% conference_name %}</h2>
</div>
<div class="page-row">
{% if not user.attendee.completed_registration %}
<div class="panel panel-default">
<div class="panel-heading">
<h4>Register</h4>
</div>
<div class="panel-body">
<p>To attend the conference, you must create an attendee profile and purchase your ticket</p>
<a class="btn btn-lg btn-success" role="button" href="{% url "guided_registration" %}">Get your ticket</a>
</div>
</div>
{% else %}
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Attendee Profile</h4>
</div>
<div class="panel-body">
<p>If you would like to change the details on your badge or your attendee statistics, you may edit your attendee profile up until the 15th January 2018</p>
<a class="btn btn-lg btn-primary pull-left" role="button" href="{% url "user_badge" %}">Preview my badge</a>
<a class="btn btn-lg btn-primary pull-right" role="button" href="{% url "attendee_edit" %}">Edit attendee profile</a>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Account Management</h4>
</div>
<div class="panel-body">
<p>If you would like to change your registered email address or password, you can use our self-service account management portal</p>
<a class="btn btn-lg btn-primary pull-right" role="button" href="https://login.linux.conf.au/manage/">Account Management</a>
</div>
</div>
</div>
{% items_pending as pending %} <div class="container mb-5">
{% include "symposion/dashboard/speaking.html" %}
<div class="col-xs-12 col-sm-12 col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Account</h4>
</div>
<div class="panel-body">
{% if pending %}
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-warning">
<div class="panel-heading">
<h5>Items pending payment</h5>
</div>
<div class="panel-body">
{% include "registrasion/_items_list.html" with items=pending %}
<div class="right">
<a class="btn btn-lg btn-success pull-right" role="button" href="{% url "checkout" %}">Check out and pay</a>
</div>
</div>
</div>
</div>
{% endif %}
{% items_purchased as purchased %}
{% if purchased %}
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-success">
<div class="panel-heading">
<h5>Paid Items</h5>
</div>
<div class="panel-body">
{% include "registrasion/_items_list.html" with items=purchased %}
</div>
</div>
</div>
{% endif %}
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-success">
<div class="panel-heading">
<h5>Add/Update Items</h5>
</div>
<div class="panel-body">
{% include "registrasion/_category_list.html" with categories=categories %}
</div>
</div>
</div>
{% invoices as invoices %}
{% if invoices %}
<div class="col-xs-12 col-sm-12 col-lg-12">
<div class="panel panel-info">
<div class="panel-heading">
<h5>Invoices</h5>
</div>
<div class="panel-body">
<ul>
{% for invoice in invoices %}
{% if invoice.is_void %}
<li class="void-invoice" style="display: none;">
{% else %}
<li>
{% endif %}
<a href="{% url "invoice" invoice.id %}" >Invoice {{ invoice.id }}</a>
- ${{ invoice.value }} ({{ invoice.get_status_display }})
</li>
{% endfor %}
</ul>
<button id="toggle-void-invoices" onclick="toggleVoidInvoices();">Show void invoices</button>
</div>
</div>
</div>
{% endif %}
{% available_credit as credit %}
{% if credit %}
<div class="col-xs-12 col-sm-12 col-lg-12">
<div class="panel panel-danger">
<div class="panel-heading">
<h5>Credit</h5>
</div>
<div class="panel-body">
<p>You have ${{ credit }} leftover from refunded invoices. This credit will be automatically applied to new invoices. Contact the conference organisers to for a refund to your original payment source.</p>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}
</div>
</div>
{% endif %}
<div class="container">
<div class="row">
<div class="col-12">
<h2 class="text-primary mb-5">{% trans "Speaking and Miniconfs" %}</h2>
</div>
</div>
<div class="row">
<div class="col-md-6 text-primary d-flex flex-column">
<h3 class="text-upper">Speaker Profile</h3>
{% if not user.speaker_profile %}
<p>
To create a speaking or miniconf proposal you must first create a speaker
profile.
</p>
{% endif %}
<p>
Your speaker profile is independent of your attendee profile and the
details you provide here will be used during selection and to populate
your speaker bio on the conference website.
</p>
<div class="mt-auto">
{% if not user.speaker_profile %}
<a href="{% url "speaker_create" %}" class="btn btn-primary btn-lg" role="button">Create Profile</a>
{% else %}
<a href="{% url "speaker_edit" %}" class="btn btn-primary btn-lg" role="button">Edit Profile</a>
{% endif %}
</div>
</div>
{% if user.speaker_profile %}
<div class="col-md-6 text-primary d-flex flex-column">
<h3 class="text-upper">New Proposal</h3>
<p>You may use the following form to create a speaking or miniconf proposal.</p>
<p>Once submitted you will be able to see the status of your proposals, as well manage the submission and co-speakers from this page</p>
<div class="mt-auto">
<a class="btn btn-lg btn-primary" role="button" href="{% url "proposal_submit" %}">New Proposal</a>
</div>
</div>
{% endif %}
</div>
</div> </div>
{% if user.speaker_profile %} {% if user.speaker_profile %}
{% if user.speaker_profile.proposals.exists %} {% if user.speaker_profile.proposals.exists %}
<div class="container"> <div class="container mb-5">
<div class="page-header"> <div class="row">
<h2>Your Proposals</h2> <div class="col-12">
<h2 class="text-primary my-5">Your Proposals</h2>
</div>
</div> </div>
<div class="page-row"> <div class="row">
{% if user.speaker_profile.proposals.exists %} <div class="col-12">
{% for proposal in user.speaker_profile.proposals.all %} <div class="card-deck">
{% include "symposion/proposals/_proposal_row.html" %} {% for proposal in user.speaker_profile.proposals.all %}
{% endfor %} {% include "symposion/proposals/_proposal_row.html" %}
{% endif %} {% endfor %}
</div>
</div>
</div> </div>
</div> </div>
{% endif %} {% endif %}
@ -237,7 +56,7 @@
{% associated_proposals as associated_proposals %} {% associated_proposals as associated_proposals %}
{% pending_proposals as pending_proposals %} {% pending_proposals as pending_proposals %}
{% if associated_proposals or pending_proposals %} {% if associated_proposals or pending_proposals %}
<div class="container"> <div class="container mb-5">
<div class="page-header"> <div class="page-header">
<h2>Copresenter Proposals</h2> <h2>Copresenter Proposals</h2>
</div> </div>
@ -254,8 +73,7 @@
{% endif %} {% endif %}
{% if review_sections %} {% if review_sections %}
<div class="bg-primary text-secondary mt-5 pb-5"> <div class="container text-primary mb-5">
<div class="container">
<div class="row"> <div class="row">
<h2 class="col-12 my-5">{% trans "Reviews" %}</h2> <h2 class="col-12 my-5">{% trans "Reviews" %}</h2>
{% for section in review_sections %} {% for section in review_sections %}
@ -276,13 +94,12 @@
{% endif %} {% endif %}
</div> </div>
{% endfor %} {% endfor %}
</div>
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% available_teams as available_teams %} {% available_teams as available_teams %}
{% if user.memberships.exists or available_teams %} {% if user.memberships.exists or available_teams %}
<div class="container"> <div class="container mb-t text-primary">
<div class="page-header"> <div class="page-header">
<h2>{% trans "Teams" %}</h2> <h2>{% trans "Teams" %}</h2>
</div> </div>
@ -296,11 +113,11 @@
<div clas="page-row"> <div clas="page-row">
{% for membership in user.memberships.all %} {% for membership in user.memberships.all %}
<div class="col-xs-12 col-sm-6 col-lg-6"> <div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-primary"> <div class="card card-primary">
<div class="panel-heading"> <div class="card-header">
<h5>{{ membership.team.name }}</h5> <h5>{{ membership.team.name }}</h5>
</div> </div>
<div class="panel-body"> <div class="card-body">
{% if membership.team.description %}<p>{{ membership.team.description }}</p>{% endif %} {% if membership.team.description %}<p>{{ membership.team.description }}</p>{% endif %}
<a class="btn btn-lg btn-primary" role="button" href="{% url "team_detail" membership.team.slug %}">Details</a> <a class="btn btn-lg btn-primary" role="button" href="{% url "team_detail" membership.team.slug %}">Details</a>
<span class="{% if membership.state == 'invited' %} label-info{% endif %}">{{ membership.get_state_display }}</span> <span class="{% if membership.state == 'invited' %} label-info{% endif %}">{{ membership.get_state_display }}</span>
@ -324,11 +141,11 @@
<div class="page-row"> <div class="page-row">
{% for team in available_teams %} {% for team in available_teams %}
<div class="col-xs-12 col-sm-6 col-lg-6"> <div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-primary"> <div class="card card-primary">
<div class="panel-heading"> <div class="card-header">
<h5>{{ team }}</h5> <h5>{{ team }}</h5>
</div> </div>
<div class="panel-body"> <div class="card-body">
{% if team.description %}<p>{{ team.description }}</p>{% endif %} {% if team.description %}<p>{{ team.description }}</p>{% endif %}
<span class="label label-default">{{ team.get_access_display }}</span> <span class="label label-default">{{ team.get_access_display }}</span>
<a class="btn btn-lg btn-primary" role="button" href="{% url "team_detail" team.slug %}">Details</a> <a class="btn btn-lg btn-primary" role="button" href="{% url "team_detail" team.slug %}">Details</a>

View file

@ -0,0 +1,146 @@
{% if user.is_staff %}
<div class="container">
<h2>Administration</h2>
<div class="page-row">
<div class="col-xs-12">
<a class="btn btn-lg btn-info" role="button" href="{% url "reports_list" %}">Reports</a>
</div>
</div>
</div>
{% endif %}
<div class="container">
<div class="col-12">
<h2>{% trans "Attend" %} {% conference_name %}</h2>
</div>
<div class="page-row">
{% if not user.attendee.completed_registration %}
<div class="panel panel-default">
<div class="panel-heading">
<h4>Register</h4>
</div>
<div class="panel-body">
<p>To attend the conference, you must create an attendee profile and purchase your ticket</p>
<a class="btn btn-lg btn-success" role="button" href="{% url "guided_registration" %}">Get your ticket</a>
</div>
</div>
{% else %}
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Attendee Profile</h4>
</div>
<div class="panel-body">
<p>If you would like to change the details on your badge or your attendee statistics, you may edit your attendee profile up until the 15th January 2018</p>
<a class="btn btn-lg btn-primary pull-left" role="button" href="{% url "user_badge" %}">Preview my badge</a>
<a class="btn btn-lg btn-primary pull-right" role="button" href="{% url "attendee_edit" %}">Edit attendee profile</a>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Account Management</h4>
</div>
<div class="panel-body">
<p>If you would like to change your registered email address or password, you can use our self-service account management portal</p>
<a class="btn btn-lg btn-primary pull-right" role="button" href="https://login.linux.conf.au/manage/">Account Management</a>
</div>
</div>
</div>
{% items_pending as pending %}
<div class="col-xs-12 col-sm-12 col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Account</h4>
</div>
<div class="panel-body">
{% if pending %}
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-warning">
<div class="panel-heading">
<h5>Items pending payment</h5>
</div>
<div class="panel-body">
{% include "registrasion/_items_list.html" with items=pending %}
<div class="right">
<a class="btn btn-lg btn-success pull-right" role="button" href="{% url "checkout" %}">Check out and pay</a>
</div>
</div>
</div>
</div>
{% endif %}
{% items_purchased as purchased %}
{% if purchased %}
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-success">
<div class="panel-heading">
<h5>Paid Items</h5>
</div>
<div class="panel-body">
{% include "registrasion/_items_list.html" with items=purchased %}
</div>
</div>
</div>
{% endif %}
<div class="col-xs-12 col-sm-6 col-lg-6">
<div class="panel panel-success">
<div class="panel-heading">
<h5>Add/Update Items</h5>
</div>
<div class="panel-body">
{% include "registrasion/_category_list.html" with categories=categories %}
</div>
</div>
</div>
{% invoices as invoices %}
{% if invoices %}
<div class="col-xs-12 col-sm-12 col-lg-12">
<div class="panel panel-info">
<div class="panel-heading">
<h5>Invoices</h5>
</div>
<div class="panel-body">
<ul>
{% for invoice in invoices %}
{% if invoice.is_void %}
<li class="void-invoice" style="display: none;">
{% else %}
<li>
{% endif %}
<a href="{% url "invoice" invoice.id %}" >Invoice {{ invoice.id }}</a>
- ${{ invoice.value }} ({{ invoice.get_status_display }})
</li>
{% endfor %}
</ul>
<button id="toggle-void-invoices" onclick="toggleVoidInvoices();">Show void invoices</button>
</div>
</div>
</div>
{% endif %}
{% available_credit as credit %}
{% if credit %}
<div class="col-xs-12 col-sm-12 col-lg-12">
<div class="panel panel-danger">
<div class="panel-heading">
<h5>Credit</h5>
</div>
<div class="panel-body">
<p>You have ${{ credit }} leftover from refunded invoices. This credit will be automatically applied to new invoices. Contact the conference organisers to for a refund to your original payment source.</p>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endif %}
</div>
</div>

View file

@ -0,0 +1,8 @@
<h3 class="text-upper">New Proposal</h3>
<p>Click one of the following links to create a speaking or miniconf proposal.</p>
<p>Once submitted you will be able to see the status of your proposals, as well manage the submission and co-speakers from this page</p>
<div class="mt-auto">
{% for kind in proposal_kinds %}
<a class="btn btn-lg btn-primary" role="button" href="{% url "proposal_submit_kind" kind.slug %}">{{ kind }}</a>
{% endfor %}
</div>

View file

@ -0,0 +1,19 @@
<h3 class="text-upper">Speaker Profile</h3>
{% if not user.speaker_profile %}
<p>
To create a speaking or miniconf proposal you must first create a speaker
profile.
</p>
{% endif %}
<p>
Your speaker profile is independent of your attendee profile and the
details you provide here will be used during selection and to populate
your speaker bio on the conference website.
</p>
<div class="mt-auto">
{% if not user.speaker_profile %}
<a href="{% url "speaker_create" %}" class="btn btn-primary btn-lg" role="button">Create Profile</a>
{% else %}
<a href="{% url "speaker_edit" %}" class="btn btn-primary btn-lg" role="button">Edit Profile</a>
{% endif %}
</div>

View file

@ -0,0 +1,18 @@
{% load i18n %}
<div class="row">
<div class="col-12">
<h2 class="text-primary mb-5">{% trans "Speaking and Miniconfs" %}</h2>
</div>
</div>
<div class="row">
{% if user.speaker_profile %}
<div class="col-md-6 text-primary d-flex flex-column">
{% include "symposion/dashboard/_new_proposal.html" %}
</div>
{% endif %}
<div class="col-md-6 text-primary d-flex flex-column">
{% include "symposion/dashboard/_profile.html" %}
</div>
</div>

View file

@ -1,49 +1,47 @@
<div class="col-xs-12 col-sm-6 col-lg-6"> <!-- {% if proposal.result.status == "accepted" %}
{% if proposal.result.status == "accepted" %} <div class="card card-success mx-4">
<div class="panel panel-success">
{% elif proposal.result.status == "rejected" %} {% elif proposal.result.status == "rejected" %}
<div class="panel panel-danger"> <div class="card card-danger mx-4">
{% elif proposal.result.status == "standby" %} {% elif proposal.result.status == "standby" %}
<div class="panel panel-warning"> <div class="card card-warning mx-4">
{% else %} {% else %}
<div class="panel panel-primary"> <div class="card card-primary mx-4">
{% endif %} {% endif %} -->
<div class="panel-heading"> <div class="card border-primary">
<h5>{{ proposal.title }}</h5> <div class="card-body">
</div> <h4 class="card-title text-primary">
<div class="panel-body"> {{ proposal.title }}
<ul> </h4>
<li><strong>Type:</strong> {{ proposal.kind.name }}</li> <div class="card-text">
<li> <p>
<strong>Status:</strong> <small class="text-muted">{{ proposal.kind.name }}</small>
{% if proposal.cancelled %} {% if proposal.cancelled %}
<span class="label label-danger">Cancelled</span> <small class="badge badge-pill float-right badge-danger">Cancelled</small>
{% else %}
{% if request.user == proposal.speaker.user %}
{% if proposal.result.status == "accepted" %}
<span class="label label-success">Accepted</span>
{% elif proposal.result.status == "rejected" %}
<span class="label label-danger">Rejected</span>
{% elif proposal.result.status == "standby" %}
<span class="label label-warning">Standby</span>
{% else %}
<span class="label label-default">Submitted</span>
{% endif %}
{% else %} {% else %}
<span class="label label-default">Associated</span> {% if request.user == proposal.speaker.user %}
{% if proposal.result.status == "accepted" %}
<small class="badge badge-pill float-right badge-success">Accepted</small>
{% elif proposal.result.status == "rejected" %}
<small class="badge badge-pill float-right badge-danger">Rejected</small>
{% elif proposal.result.status == "standby" %}
<small class="badge badge-pill float-right badge-warning">Standby</small>
{% else %}
<small class="badge badge-pill float-right badge-default">Submitted</small>
{% endif %}
{% else %}
<small class="badge badge-pill float-right badge-default">Associated</small>
{% endif %}
{% endif %} {% endif %}
{% endif %} </p>
</li> <p>{{ proposal.abstract|truncatewords:40 }}</p>
</ul> </div>
<div> </div>
<a class="btn btn-lg btn-success" role="button" href="{% url "proposal_detail" proposal.pk %}">View Details</a> <div class="card-footer bg-primary">
<a href="{% url "proposal_detail" proposal.pk %}">View Details</a>
{% if not proposal.cancelled %} {% if not proposal.cancelled %}
{% if request.user == proposal.speaker.user and proposal.can_edit %} {% if request.user == proposal.speaker.user and proposal.can_edit %}
<a class="btn btn-lg btn-success" role="button" href="{% url "proposal_edit" proposal.pk %}">Edit</a> <br/><a href="{% url "proposal_edit" proposal.pk %}">Edit</a>
<a class="btn btn-lg btn-success" role="button" href="{% url "proposal_speaker_manage" proposal.id %}">Manage Additional Speakers</a> {% endif %}
{% endif %}
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
</div>

View file

@ -1,16 +1,17 @@
{% extends "symposion/proposals/base.html" %} {% extends "site_dark.html" %}
{% load i18n %} {% load i18n %}
{% block head_title %}{% trans "Submit A Proposal" %}{% endblock %} {% block head_title %}{% trans "Submit A Proposal" %}{% endblock %}
{% block header_title %}Submit A Proposal{% endblock %} {% block header_title %}Submit A Proposal{% endblock %}
{% block proposals_body %} {% block content %}
{% if kinds %} {% if kinds %}
<h1>Select what kind of proposal you'd like to submit:</h1> <h1>New Proposal</h1>
<p>Select what kind of proposal you'd like to submit:</p>
{% for kind in kinds %} {% for kind in kinds %}
<a class="btn btn-lg btn-primary" role="button" href="{% url "proposal_submit_kind" kind.slug %}">{{ kind }}</a> <h2>{{ kind }}</h2>
<a class="btn btn-lg btn-secondary" role="button" href="{% url "proposal_submit_kind" kind.slug %}">{{ kind }}</a>
{% endfor %} {% endfor %}
{% else %} {% else %}
<h1>Proposals are not currently open for submission.</h1> <h1>Proposals are not currently open for submission.</h1>

21
pinaxcon/views.py Normal file
View file

@ -0,0 +1,21 @@
from django.shortcuts import render, redirect
from account.decorators import login_required
from symposion.proposals.models import ProposalSection
@login_required
def dashboard(request):
"""
Copy of symposion.views.dashboard modified to inject available proposal
kinds into the request context.
"""
if request.session.get("pending-token"):
return redirect("speaker_create_token", request.session["pending-token"])
sections = ProposalSection.available().prefetch_related('section__proposal_kinds')
kinds = [k for kind in section for k in section.proposal_kinds]
return render(request, "dashboard.html", {'kinds': kinds})

View file

@ -250,3 +250,7 @@ main {
font-weight: 600; font-weight: 600;
} }
} }
.card {
min-width: 20rem;
}

View file

@ -1,10 +1,16 @@
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect from django.shortcuts import render, redirect
from symposion.proposals.models import ProposalSection
@login_required @login_required
def dashboard(request): def dashboard(request):
if request.session.get("pending-token"): if request.session.get("pending-token"):
return redirect("speaker_create_token", return redirect("speaker_create_token", request.session["pending-token"])
request.session["pending-token"])
return render(request, "dashboard.html") # Patching available proposal kinds into the dashboard to enable creating
# proposals from the dashboard directly.
sections = ProposalSection.available().prefetch_related('section__proposal_kinds')
kinds = [kind for section in sections for kind in section.section.proposal_kinds.all()]
return render(request, "dashboard.html", {'proposal_kinds': kinds})