From 84bd8f8971d3712c5052e8b738042258dd377d27 Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Mon, 13 Jan 2014 16:39:20 -0500 Subject: [PATCH 01/14] Update urls import format --- symposion/boxes/urls.py | 4 ++-- symposion/cms/urls.py | 4 +++- symposion/conference/urls.py | 2 +- symposion/proposals/urls.py | 2 +- symposion/reviews/urls.py | 6 +++--- symposion/schedule/urls.py | 2 +- symposion/speakers/urls.py | 2 +- symposion/sponsorship/urls.py | 2 +- symposion/teams/urls.py | 2 +- 9 files changed, 14 insertions(+), 12 deletions(-) diff --git a/symposion/boxes/urls.py b/symposion/boxes/urls.py index dc57fe6b..a3be13dc 100644 --- a/symposion/boxes/urls.py +++ b/symposion/boxes/urls.py @@ -1,6 +1,6 @@ -from django.conf.urls.defaults import url, patterns +from django.conf.urls import patterns, url urlpatterns = patterns("symposion.boxes.views", url(r"^([-\w]+)/edit/$", "box_edit", name="box_edit"), -) \ No newline at end of file +) diff --git a/symposion/cms/urls.py b/symposion/cms/urls.py index 3297ce53..1271f06e 100644 --- a/symposion/cms/urls.py +++ b/symposion/cms/urls.py @@ -1,7 +1,9 @@ -from django.conf.urls.defaults import url, patterns +from django.conf.urls import url, patterns + PAGE_RE = r"(([\w-]{1,})(/[\w-]{1,})*)/" + urlpatterns = patterns("symposion.cms.views", url(r"^files/$", "file_index", name="file_index"), url(r"^files/create/$", "file_create", name="file_create"), diff --git a/symposion/conference/urls.py b/symposion/conference/urls.py index a25aa583..90ae79f8 100644 --- a/symposion/conference/urls.py +++ b/symposion/conference/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url urlpatterns = patterns("symposion.conference.views", diff --git a/symposion/proposals/urls.py b/symposion/proposals/urls.py index 443540bb..a69e6136 100644 --- a/symposion/proposals/urls.py +++ b/symposion/proposals/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url urlpatterns = patterns("symposion.proposals.views", diff --git a/symposion/reviews/urls.py b/symposion/reviews/urls.py index 564bd35e..1719eb0e 100644 --- a/symposion/reviews/urls.py +++ b/symposion/reviews/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url urlpatterns = patterns("symposion.reviews.views", @@ -14,9 +14,9 @@ urlpatterns = patterns("symposion.reviews.views", url(r"^section/(?P[\w\-]+)/notification/(?P\w+)/$", "result_notification", name="result_notification"), url(r"^section/(?P[\w\-]+)/notification/(?P\w+)/prepare/$", "result_notification_prepare", name="result_notification_prepare"), url(r"^section/(?P[\w\-]+)/notification/(?P\w+)/send/$", "result_notification_send", name="result_notification_send"), - + url(r"^review/(?P\d+)/$", "review_detail", name="review_detail"), - + url(r"^(?P\d+)/delete/$", "review_delete", name="review_delete"), url(r"^assignments/$", "review_assignments", name="review_assignments"), url(r"^assignment/(?P\d+)/opt-out/$", "review_assignment_opt_out", name="review_assignment_opt_out"), diff --git a/symposion/schedule/urls.py b/symposion/schedule/urls.py index 58890827..049aa7da 100644 --- a/symposion/schedule/urls.py +++ b/symposion/schedule/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import url, patterns +from django.conf.urls import url, patterns urlpatterns = patterns("symposion.schedule.views", diff --git a/symposion/speakers/urls.py b/symposion/speakers/urls.py index 9a00ea3c..fb30e787 100644 --- a/symposion/speakers/urls.py +++ b/symposion/speakers/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url urlpatterns = patterns("symposion.speakers.views", diff --git a/symposion/sponsorship/urls.py b/symposion/sponsorship/urls.py index e5d32bb0..f7b946c6 100644 --- a/symposion/sponsorship/urls.py +++ b/symposion/sponsorship/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url from django.views.generic.simple import direct_to_template diff --git a/symposion/teams/urls.py b/symposion/teams/urls.py index ed2f7645..785c4300 100644 --- a/symposion/teams/urls.py +++ b/symposion/teams/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url urlpatterns = patterns("symposion.teams.views", From b495eddc61bad6ad27cdab58e8729ceca1634fa4 Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Mon, 13 Jan 2014 16:40:27 -0500 Subject: [PATCH 02/14] direct_to_template -> TemplateView --- symposion/sponsorship/urls.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/symposion/sponsorship/urls.py b/symposion/sponsorship/urls.py index f7b946c6..c7dc581c 100644 --- a/symposion/sponsorship/urls.py +++ b/symposion/sponsorship/urls.py @@ -1,9 +1,9 @@ from django.conf.urls import patterns, url -from django.views.generic.simple import direct_to_template +from django.views.generic import TemplateView urlpatterns = patterns("symposion.sponsorship.views", - url(r"^$", direct_to_template, {"template": "sponsorship/list.html"}, name="sponsor_list"), + url(r"^$", TemplateView.as_view(template_name="sponsorship/list.html"), name="sponsor_list"), url(r"^apply/$", "sponsor_apply", name="sponsor_apply"), url(r"^add/$", "sponsor_add", name="sponsor_add"), url(r"^(?P\d+)/$", "sponsor_detail", name="sponsor_detail"), From 8857e7b7608c7fd3038126f7449c187b514fed34 Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Wed, 15 Jan 2014 08:55:58 -0500 Subject: [PATCH 03/14] Use {% load url from future %} in cms templates Using https://github.com/django-future-url --- symposion/templates/cms/file_create.html | 5 ++++- symposion/templates/cms/file_index.html | 7 +++++-- symposion/templates/cms/page_detail.html | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/symposion/templates/cms/file_create.html b/symposion/templates/cms/file_create.html index 547fc5d3..210a9e1d 100644 --- a/symposion/templates/cms/file_create.html +++ b/symposion/templates/cms/file_create.html @@ -1,5 +1,8 @@ {% extends "site_base.html" %} +{% load url from future %} + + {% load bootstrap_tags %} {% block head_title %}Upload File{% endblock %} @@ -8,7 +11,7 @@

Upload File

-
+ {% csrf_token %} {{ form|as_bootstrap }}
diff --git a/symposion/templates/cms/file_index.html b/symposion/templates/cms/file_index.html index bfe1337c..76e02354 100644 --- a/symposion/templates/cms/file_index.html +++ b/symposion/templates/cms/file_index.html @@ -1,5 +1,8 @@ {% extends "site_base.html" %} +{% load url from future %} + + {% block head_title %}Uploaded Files{% endblock %} {% block body_outer %} @@ -9,7 +12,7 @@ {% for file in files %}
- + {% csrf_token %} @@ -20,7 +23,7 @@

No uploaded files.

{% endfor %}
- + Add File diff --git a/symposion/templates/cms/page_detail.html b/symposion/templates/cms/page_detail.html index 770eae29..6f35395b 100644 --- a/symposion/templates/cms/page_detail.html +++ b/symposion/templates/cms/page_detail.html @@ -1,5 +1,8 @@ {% extends "site_base.html" %} +{% load url from future %} + + {% load sitetree %} {% load i18n %} @@ -12,7 +15,7 @@ {% block body %} {% if editable %} {% endif %}

{{ page.title }}

From 55d37c13bdf48e91c0bbcbdab93ad3394f75360a Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Wed, 15 Jan 2014 08:56:30 -0500 Subject: [PATCH 04/14] Use {% load url from future %} in conference templates Using https://github.com/futurecolors/django-future-url --- symposion/templates/conference/user_list.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/symposion/templates/conference/user_list.html b/symposion/templates/conference/user_list.html index 22caaede..04b6a5ca 100644 --- a/symposion/templates/conference/user_list.html +++ b/symposion/templates/conference/user_list.html @@ -1,5 +1,8 @@ {% extends "site_base.html" %} +{% load url from future %} + + {% load i18n %} {% load sitetree %} @@ -68,9 +71,9 @@ {{ user.get_full_name }} {% if user.speaker_profile %} - {{ user.speaker_profile }} + {{ user.speaker_profile }} {% else %} - create + create {% endif %} From 935ec48032d1e2228ce647f151255ce2db3ac34f Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Wed, 15 Jan 2014 08:57:03 -0500 Subject: [PATCH 05/14] Use {% load url from future %} in emails templates Using https://github.com/futurecolors/django-future-url --- symposion/templates/emails/proposal_new_message/message.html | 3 ++- symposion/templates/emails/proposal_updated/message.html | 3 ++- symposion/templates/emails/speaker_addition/message.html | 3 ++- symposion/templates/emails/speaker_invite/message.html | 3 ++- symposion/templates/emails/speaker_no_profile/message.html | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/symposion/templates/emails/proposal_new_message/message.html b/symposion/templates/emails/proposal_new_message/message.html index 90bbd8c8..3a9addf5 100644 --- a/symposion/templates/emails/proposal_new_message/message.html +++ b/symposion/templates/emails/proposal_new_message/message.html @@ -1,3 +1,4 @@ +{% load url from future %} {% load account_tags %}

{% user_display message.user %} has added a message on {{ proposal.title }}. @@ -6,6 +7,6 @@ {{ message.message|safe }}

- {% if reviewer %}{% url review_detail proposal.pk as detail_url %}{% else %}{% url proposal_detail proposal.pk as detail_url %}{% endif %} + {% if reviewer %}{% url 'review_detail' proposal.pk as detail_url %}{% else %}{% url 'proposal_detail' proposal.pk as detail_url %}{% endif %} Respond online at http://{{ current_site }}{{ detail_url }}#proposal-feedback

\ No newline at end of file diff --git a/symposion/templates/emails/proposal_updated/message.html b/symposion/templates/emails/proposal_updated/message.html index d5ed74ec..eef8af8d 100644 --- a/symposion/templates/emails/proposal_updated/message.html +++ b/symposion/templates/emails/proposal_updated/message.html @@ -1,8 +1,9 @@ +{% load url from future %} {% load account_tags %}

{% user_display user %} has made changes to {{ proposal.title }} which you have previously reviewed or commented on.

- {% url review_detail proposal.pk as detail_url %} + {% url 'review_detail' proposal.pk as detail_url %} View the latest version of the proposal online at http://{{ current_site }}{{ detail_url }}

diff --git a/symposion/templates/emails/speaker_addition/message.html b/symposion/templates/emails/speaker_addition/message.html index dff0c7ba..dec1ac76 100644 --- a/symposion/templates/emails/speaker_addition/message.html +++ b/symposion/templates/emails/speaker_addition/message.html @@ -1,6 +1,7 @@ +{% load url from future %}

{{ proposal.speaker.name }} attached you as an additional speaker to a talk proposal for {{ current_site.name }} entitled "{{ proposal.title }}".

For more details, visit the {{ current_site.name }} speaker dashboard: - http://{{ current_site }}{% url dashboard %} + http://{{ current_site }}{% url 'dashboard' %}

diff --git a/symposion/templates/emails/speaker_invite/message.html b/symposion/templates/emails/speaker_invite/message.html index 5ab2c2e8..5e32bd4a 100644 --- a/symposion/templates/emails/speaker_invite/message.html +++ b/symposion/templates/emails/speaker_invite/message.html @@ -1,9 +1,10 @@ +{% load url from future %}

{{ proposal.speaker.name }} attached you as an additional speaker to a talk proposal for {{ current_site.name }} entitled "{{ proposal.title }}".

Go to

-

http://{{ current_site }}{% url speaker_create_token token %}

+

http://{{ current_site }}{% url 'speaker_create_token' token %}

to confirm.

diff --git a/symposion/templates/emails/speaker_no_profile/message.html b/symposion/templates/emails/speaker_no_profile/message.html index 14007092..d77693c1 100644 --- a/symposion/templates/emails/speaker_no_profile/message.html +++ b/symposion/templates/emails/speaker_no_profile/message.html @@ -1,8 +1,9 @@ +{% load url from future %}

{{ proposal.speaker.name }} attached you as an additional speaker to a talk proposal for {{ current_site.name }} entitled "{{ proposal.title }}".

Go to

-

http://{{ current_site }}{% url speaker_create_token token %}

+

http://{{ current_site }}{% url 'speaker_create_token' token %}

to confirm and fill out your speaker profile.

From ed7278e9260ad986d1d30a625025213351081e4d Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Wed, 15 Jan 2014 08:57:33 -0500 Subject: [PATCH 06/14] Use {% load url from future %} in proposals templates Using https://github.com/futurecolors/django-future-url --- .../templates/proposals/_pending_proposal_row.html | 7 ++++--- symposion/templates/proposals/_proposal_fields.html | 3 ++- symposion/templates/proposals/_proposal_row.html | 7 ++++--- symposion/templates/proposals/proposal_cancel.html | 5 ++++- symposion/templates/proposals/proposal_detail.html | 13 ++++++++----- symposion/templates/proposals/proposal_edit.html | 7 +++++-- .../proposals/proposal_speaker_manage.html | 5 ++++- symposion/templates/proposals/proposal_submit.html | 5 ++++- 8 files changed, 35 insertions(+), 17 deletions(-) diff --git a/symposion/templates/proposals/_pending_proposal_row.html b/symposion/templates/proposals/_pending_proposal_row.html index fafd0ea0..ed147b0c 100644 --- a/symposion/templates/proposals/_pending_proposal_row.html +++ b/symposion/templates/proposals/_pending_proposal_row.html @@ -1,8 +1,9 @@ +{% load url from future %} {% load i18n %} - {{ proposal.title }} + {{ proposal.title }} {{ proposal.kind.name }} @@ -31,9 +32,9 @@
diff --git a/symposion/templates/proposals/_proposal_fields.html b/symposion/templates/proposals/_proposal_fields.html index a1040625..d75bdf3f 100644 --- a/symposion/templates/proposals/_proposal_fields.html +++ b/symposion/templates/proposals/_proposal_fields.html @@ -1,3 +1,4 @@ +{% load url from future %} {% load i18n %}
@@ -45,7 +46,7 @@ {{ document.description }} -
+ {% csrf_token %}
diff --git a/symposion/templates/proposals/_proposal_row.html b/symposion/templates/proposals/_proposal_row.html index 6ed15607..8dcb6261 100644 --- a/symposion/templates/proposals/_proposal_row.html +++ b/symposion/templates/proposals/_proposal_row.html @@ -1,6 +1,7 @@ +{% load url from future %} - {{ proposal.title }} + {{ proposal.title }} {{ proposal.kind.name }} @@ -24,8 +25,8 @@ {% if not proposal.cancelled %} {% if request.user == proposal.speaker.user and proposal.can_edit %} - Edit - Manage Additional Speakers + Edit + Manage Additional Speakers {% endif %} {% endif %} diff --git a/symposion/templates/proposals/proposal_cancel.html b/symposion/templates/proposals/proposal_cancel.html index 93a1204a..03bbd40d 100644 --- a/symposion/templates/proposals/proposal_cancel.html +++ b/symposion/templates/proposals/proposal_cancel.html @@ -1,5 +1,8 @@ {% extends "proposals/base.html" %} +{% load url from future %} + + {% load i18n %} {% load bootstrap_tags %} @@ -13,6 +16,6 @@ {% csrf_token %}

Are you sure you want to cancel {{ proposal.title }}?

- {% trans 'No, keep it for now' %} + {% trans 'No, keep it for now' %} {% endblock %} diff --git a/symposion/templates/proposals/proposal_detail.html b/symposion/templates/proposals/proposal_detail.html index a9b881e7..240e1c02 100644 --- a/symposion/templates/proposals/proposal_detail.html +++ b/symposion/templates/proposals/proposal_detail.html @@ -1,5 +1,8 @@ {% extends "proposals/base.html" %} +{% load url from future %} + + {% load i18n %} {% load account_tags %} {% load bootstrap_tags %} @@ -10,14 +13,14 @@
{% if not proposal.cancelled %} {% if request.user == proposal.speaker.user %} - + {% trans "Edit this proposal" %} - + {% trans "Cancel this proposal" %} {% else %} - + {% trans "Remove me from this proposal" %} {% endif %} @@ -52,7 +55,7 @@ {{ document.description }} -
+ {% csrf_token %}
@@ -63,7 +66,7 @@ {% else %}

{% trans 'No supporting documents attached to this proposal.' %}

{% endif %} - {% trans 'Add Document' %} + {% trans 'Add Document' %}
{% endif %} diff --git a/symposion/templates/proposals/proposal_edit.html b/symposion/templates/proposals/proposal_edit.html index 67c847a2..d968a7a3 100644 --- a/symposion/templates/proposals/proposal_edit.html +++ b/symposion/templates/proposals/proposal_edit.html @@ -1,5 +1,8 @@ {% extends "proposals/base.html" %} +{% load url from future %} + + {% load bootstrap_tags %} {% load markitup_tags %} @@ -8,7 +11,7 @@ {% block body %}

Edit: {{ proposal.title }}

-

Manage speakers

+

Manage speakers

{% csrf_token %} @@ -17,7 +20,7 @@
{% endblock %} diff --git a/symposion/templates/proposals/proposal_speaker_manage.html b/symposion/templates/proposals/proposal_speaker_manage.html index b1e9990d..2faa7085 100644 --- a/symposion/templates/proposals/proposal_speaker_manage.html +++ b/symposion/templates/proposals/proposal_speaker_manage.html @@ -1,4 +1,7 @@ {% extends "proposals/base.html" %} + +{% load url from future %} + {% load i18n %} {% load bootstrap_tags %} @@ -7,7 +10,7 @@

{% trans 'Proposal:' %} {{ proposal.title }}

- {% trans 'Edit proposal' %} + {% trans 'Edit proposal' %}

diff --git a/symposion/templates/proposals/proposal_submit.html b/symposion/templates/proposals/proposal_submit.html index 0a1b34e5..23175054 100644 --- a/symposion/templates/proposals/proposal_submit.html +++ b/symposion/templates/proposals/proposal_submit.html @@ -1,5 +1,8 @@ {% extends "proposals/base.html" %} +{% load url from future %} + + {% load boxes_tags %} {% load i18n %} @@ -13,7 +16,7 @@ {% else %} From 4c912da4aca6c953ac35a3cb5b40aeff0588ba77 Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Wed, 15 Jan 2014 08:57:57 -0500 Subject: [PATCH 07/14] Use {% load url from future %} in reviews templates Using https://github.com/futurecolors/django-future-url --- .../templates/reviews/_review_table.html | 3 ++- symposion/templates/reviews/base.html | 11 +++++---- .../reviews/result_notification.html | 13 +++++++---- .../reviews/result_notification_prepare.html | 7 ++++-- symposion/templates/reviews/review_admin.html | 5 +++- .../templates/reviews/review_assignment.html | 7 ++++-- .../templates/reviews/review_detail.html | 5 +++- .../templates/reviews/review_review.html | 7 ++++-- symposion/templates/reviews/review_stats.html | 23 +++++++++++-------- 9 files changed, 53 insertions(+), 28 deletions(-) diff --git a/symposion/templates/reviews/_review_table.html b/symposion/templates/reviews/_review_table.html index 9c1804b7..9e94cf83 100644 --- a/symposion/templates/reviews/_review_table.html +++ b/symposion/templates/reviews/_review_table.html @@ -1,3 +1,4 @@ +{% load url from future %} {% load i18n %} @@ -18,7 +19,7 @@
{{ proposal.number }} - + {{ proposal.speaker }}
{{ proposal.title }} diff --git a/symposion/templates/reviews/base.html b/symposion/templates/reviews/base.html index 695d9c8c..a09bde0e 100644 --- a/symposion/templates/reviews/base.html +++ b/symposion/templates/reviews/base.html @@ -1,5 +1,8 @@ {% extends "site_base.html" %} +{% load url from future %} + + {% load i18n %} {% load sitetree %} @@ -60,25 +63,25 @@ {{ section }}
  • - + {% trans "All Reviews" %}
  • {% comment %}
  • - + {% trans "Your Assignments" %}
  • {% endcomment %}
  • - + {% trans "Voting Status" %}
  • {% if request.user.is_staff %}
  • - Result Notification + Result Notification
  • {% endif %} {% endfor %} diff --git a/symposion/templates/reviews/result_notification.html b/symposion/templates/reviews/result_notification.html index cbd5c4c2..af250baa 100644 --- a/symposion/templates/reviews/result_notification.html +++ b/symposion/templates/reviews/result_notification.html @@ -1,5 +1,8 @@ {% extends "reviews/base.html" %} +{% load url from future %} + + {% load i18n %} {% block extra_style %} @@ -13,14 +16,14 @@ {% block body %}

    Result Notification

    -
    + {% csrf_token %} @@ -54,7 +57,7 @@
    {{ proposal.number }} - + {{ proposal.speaker }}
    {{ proposal.title }} diff --git a/symposion/templates/reviews/result_notification_prepare.html b/symposion/templates/reviews/result_notification_prepare.html index 2248c204..bfe2e433 100644 --- a/symposion/templates/reviews/result_notification_prepare.html +++ b/symposion/templates/reviews/result_notification_prepare.html @@ -1,5 +1,8 @@ {% extends "reviews/base.html" %} +{% load url from future %} + + {% load i18n %} {% block body %} @@ -23,7 +26,7 @@
    diff --git a/symposion/templates/reviews/review_admin.html b/symposion/templates/reviews/review_admin.html index 1e762416..24ac217f 100644 --- a/symposion/templates/reviews/review_admin.html +++ b/symposion/templates/reviews/review_admin.html @@ -1,5 +1,8 @@ {% extends "reviews/base.html" %} +{% load url from future %} + + {% block body %}

    Reviewers

    @@ -30,7 +33,7 @@ {% for reviewer in reviewers %}
    - {{ reviewer.get_full_name }} + {{ reviewer.get_full_name }} {{ reviewer.total_votes }} diff --git a/symposion/templates/reviews/review_assignment.html b/symposion/templates/reviews/review_assignment.html index 8bcc1fef..448b85c0 100644 --- a/symposion/templates/reviews/review_assignment.html +++ b/symposion/templates/reviews/review_assignment.html @@ -1,5 +1,8 @@ {% extends "reviews/base.html" %} +{% load url from future %} + + {% block body %}

    Review Assignments

    @@ -13,12 +16,12 @@ {% for assignment in assignments %}
    - + {{ assignment.proposal.title }} -
    + {% csrf_token %}
    diff --git a/symposion/templates/reviews/review_detail.html b/symposion/templates/reviews/review_detail.html index 9a2de066..98b4043a 100644 --- a/symposion/templates/reviews/review_detail.html +++ b/symposion/templates/reviews/review_detail.html @@ -1,5 +1,8 @@ {% extends "reviews/base.html" %} +{% load url from future %} + + {% load i18n %} {% load markitup_tags %} {% load bootstrap_tags %} @@ -126,7 +129,7 @@ {% if is_manager %}
    -
    + {% csrf_token %}
    diff --git a/symposion/templates/reviews/review_review.html b/symposion/templates/reviews/review_review.html index 2168e899..7f753ddc 100644 --- a/symposion/templates/reviews/review_review.html +++ b/symposion/templates/reviews/review_review.html @@ -1,5 +1,8 @@ {% extends "site_base.html" %} +{% load url from future %} + + {% load markitup_tags %} {% load uni_form_tags %} @@ -55,7 +58,7 @@

    Review

    -
    + {% csrf_token %}
    {{ review_form|as_uni_form }} @@ -67,7 +70,7 @@

    Comment

    - + {% csrf_token %}
    {{ comment_form|as_uni_form }} diff --git a/symposion/templates/reviews/review_stats.html b/symposion/templates/reviews/review_stats.html index 8f4a09cb..40936af5 100644 --- a/symposion/templates/reviews/review_stats.html +++ b/symposion/templates/reviews/review_stats.html @@ -1,15 +1,18 @@ {% extends "reviews/base.html" %} +{% load url from future %} + + {% block body %}

    Voting Status ({{ section_slug }})

    {% if key %}
    @@ -42,35 +45,35 @@
    - Positive + Positive {{ proposals.positive|length }}
    proposals with at least {{ vote_threshold }} vote{{ vote_threshold|pluralize }} and at least one +1 and no −1s
    - Negative + Negative {{ proposals.negative|length }}
    proposals with at least {{ vote_threshold }} vote{{ vote_threshold|pluralize }} and at least one −1 and no +1s
    - Indifferent + Indifferent {{ proposals.indifferent|length }}
    proposals with at least {{ vote_threshold }} vote{{ vote_threshold|pluralize }} and neither a +1 or a −1
    - Controversial + Controversial {{ proposals.controversial|length }}
    proposals with at least {{ vote_threshold }} vote{{ vote_threshold|pluralize }} and both a +1 and −1
    - Too Few Reviews + Too Few Reviews {{ proposals.too_few|length }}
    From 76a5e08e2fe5a5e4052b700efbf48f50ebc91150 Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Wed, 15 Jan 2014 08:58:21 -0500 Subject: [PATCH 08/14] Use {% load url from future %} in schedule templates Using https://github.com/futurecolors/django-future-url --- symposion/templates/schedule/_edit_grid.html | 7 ++++--- symposion/templates/schedule/_grid.html | 3 ++- symposion/templates/schedule/_slot_edit.html | 3 ++- symposion/templates/schedule/presentation_detail.html | 5 ++++- symposion/templates/schedule/schedule_list.html | 5 ++++- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/symposion/templates/schedule/_edit_grid.html b/symposion/templates/schedule/_edit_grid.html index ff9afe78..870391b5 100644 --- a/symposion/templates/schedule/_edit_grid.html +++ b/symposion/templates/schedule/_edit_grid.html @@ -1,3 +1,4 @@ +{% load url from future %} @@ -15,9 +16,9 @@ {% endfor %} diff --git a/symposion/templates/schedule/_grid.html b/symposion/templates/schedule/_grid.html index be62d912..71f98448 100644 --- a/symposion/templates/schedule/_grid.html +++ b/symposion/templates/schedule/_grid.html @@ -1,3 +1,4 @@ +{% load url from future %}
    {% if slot.kind.label == "talk" or slot.kind.label == "tutorial" %} {% if not slot.content %} - + + + {% else %} - {{ slot.content.title }} + {{ slot.content.title }} {{ slot.content.speaker }} {% endif %} {% else %} @@ -26,7 +27,7 @@ {% else %} {{ slot.kind.label }} {% endif %} - — edit + — edit {% endif %}
    @@ -17,7 +18,7 @@ {% if not slot.content %} {% else %} - {{ slot.content.title }} + {{ slot.content.title }} {{ slot.content.speakers|join:", " }} diff --git a/symposion/templates/schedule/_slot_edit.html b/symposion/templates/schedule/_slot_edit.html index d8b5ae9e..385ff89f 100644 --- a/symposion/templates/schedule/_slot_edit.html +++ b/symposion/templates/schedule/_slot_edit.html @@ -1,5 +1,6 @@ +{% load url from future %} {% load i18n bootstrap_tags %} - + {% endfor %} @@ -57,7 +60,7 @@ {% endfor %} @@ -70,8 +73,8 @@ {% endfor %} From 280a2c2d2098329ebabdf86c66351946134f31d1 Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Wed, 15 Jan 2014 09:00:15 -0500 Subject: [PATCH 12/14] Use {% load url from future %} in dashboard template Using https://github.com/futurecolors/django-future-url --- symposion/templates/dashboard.html | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/symposion/templates/dashboard.html b/symposion/templates/dashboard.html index a88b4a3f..d47c2729 100644 --- a/symposion/templates/dashboard.html +++ b/symposion/templates/dashboard.html @@ -1,5 +1,8 @@ {% extends "site_base.html" %} +{% load url from future %} + + {% load i18n %} {% load proposal_tags %} {% load review_tags %} @@ -16,14 +19,14 @@

    {% trans "Speaking" %}

    {% if not user.speaker_profile %} - + Create a speaker profile {% else %} - + Edit your speaker profile - + Submit a new proposal {% endif %} @@ -32,7 +35,7 @@
    {% if not user.speaker_profile %} -

    To submit a proposal, you must first create a speaker profile.

    +

    To submit a proposal, you must first create a speaker profile.

    {% else %}

    Your Proposals

    {% if user.speaker_profile.proposals.exists %} @@ -92,7 +95,7 @@

    {% trans "Sponsorship" %}

    {% if not user.sponsorships.exists %} - + Apply to be a sponsor {% endif %} @@ -101,13 +104,13 @@
    {% if not user.sponsorships.exists %} -

    If you or your organization would be interested in sponsorship opportunities, use our online form to apply to be a sponsor. +

    If you or your organization would be interested in sponsorship opportunities, use our online form to apply to be a sponsor. {% else %}

    Your Sponsorship

    {{ membership.user.email }}{% if user == membership.user %} you{% endif %} -
    {% csrf_token %}
    +
    {% csrf_token %}
    {{ membership.user.email }}{% if user == membership.user %} you{% endif %} -
    {% csrf_token %}
    +
    {% csrf_token %}
    {{ membership.user.email }} -
    {% csrf_token %}
    -
    {% csrf_token %}
    +
    {% csrf_token %}
    +
    {% csrf_token %}
    - {{ membership.team.name }} + {{ membership.team.name }} {% if membership.team.description %}
    {{ membership.team.description }}{% endif %}
    @@ -204,7 +207,7 @@ {% for team in available_teams %}
    - {{ team }} + {{ team }} {% if team.description %}
    {{ team.description }}{% endif %}
    From e9c97a9586f2215bfe7a4714d5467e33201881bb Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Wed, 15 Jan 2014 09:05:08 -0500 Subject: [PATCH 13/14] mimetype -> content_type mimetype is deprecated and to be removed in Django 1.7. --- symposion/proposals/actions.py | 2 +- symposion/schedule/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/symposion/proposals/actions.py b/symposion/proposals/actions.py index e46e2524..c502c0fe 100644 --- a/symposion/proposals/actions.py +++ b/symposion/proposals/actions.py @@ -23,7 +23,7 @@ def export_as_csv_action( elif exclude: excludeset = set(exclude) field_names = field_names - excludeset - response = HttpResponse(mimetype="text/csv") + response = HttpResponse(content_type="text/csv") response["Content-Disposition"] = "attachment; filename=%s.csv" % unicode(opts).replace(".", "_") writer = csv.writer(response) if header: diff --git a/symposion/schedule/views.py b/symposion/schedule/views.py index 98771b59..1367808b 100644 --- a/symposion/schedule/views.py +++ b/symposion/schedule/views.py @@ -78,7 +78,7 @@ def schedule_list_csv(request, slug=None): presentations = Presentation.objects.filter(section=schedule.section) presentations = presentations.exclude(cancelled=True).order_by("id") - response = HttpResponse(mimetype="text/csv") + response = HttpResponse(content_type="text/csv") if slug: file_slug = slug else: From dff5c4b1bb043cf02e1f504eb1e8fba151a73733 Mon Sep 17 00:00:00 2001 From: Rebecca Lovewell Date: Wed, 15 Jan 2014 09:22:16 -0500 Subject: [PATCH 14/14] Use hashlib rather than django.utils.hashcompat --- symposion/proposals/views.py | 62 ++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/symposion/proposals/views.py b/symposion/proposals/views.py index cf532c2b..f8dde53c 100644 --- a/symposion/proposals/views.py +++ b/symposion/proposals/views.py @@ -1,3 +1,4 @@ +import hashlib import random import sys @@ -6,7 +7,6 @@ from django.core.exceptions import ObjectDoesNotExist from django.db.models import Q from django.http import Http404, HttpResponse, HttpResponseForbidden from django.shortcuts import render, redirect, get_object_or_404 -from django.utils.hashcompat import sha_constructor from django.views import static from django.contrib import messages @@ -37,21 +37,21 @@ def proposal_submit(request): request.user.speaker_profile except ObjectDoesNotExist: return redirect("dashboard") - + kinds = [] for proposal_section in ProposalSection.available(): for kind in proposal_section.section.proposal_kinds.all(): kinds.append(kind) - + return render(request, "proposals/proposal_submit.html", { "kinds": kinds, }) def proposal_submit_kind(request, kind_slug): - + kind = get_object_or_404(ProposalKind, slug=kind_slug) - + if not request.user.is_authenticated(): return redirect("home") # @@@ unauth'd speaker info page? else: @@ -59,12 +59,12 @@ def proposal_submit_kind(request, kind_slug): speaker_profile = request.user.speaker_profile except ObjectDoesNotExist: return redirect("dashboard") - + if not kind.section.proposalsection.is_available(): return redirect("proposal_submit") - + form_class = get_form(settings.PROPOSAL_FORMS[kind_slug]) - + if request.method == "POST": form = form_class(request.POST) if form.is_valid(): @@ -79,7 +79,7 @@ def proposal_submit_kind(request, kind_slug): return redirect("dashboard") else: form = form_class() - + return render(request, "proposals/proposal_submit_kind.html", { "kind": kind, "form": form, @@ -91,17 +91,17 @@ def proposal_speaker_manage(request, pk): queryset = ProposalBase.objects.select_related("speaker") proposal = get_object_or_404(queryset, pk=pk) proposal = ProposalBase.objects.get_subclass(pk=proposal.pk) - + if proposal.speaker != request.user.speaker_profile: raise Http404() - + if request.method == "POST": add_speaker_form = AddSpeakerForm(request.POST, proposal=proposal) if add_speaker_form.is_valid(): message_ctx = { "proposal": proposal, } - + def create_speaker_token(email_address): # create token and look for an existing speaker to prevent # duplicate tokens and confusing the pending speaker @@ -110,8 +110,8 @@ def proposal_speaker_manage(request, pk): Q(user=None, invite_email=email_address) ) except Speaker.DoesNotExist: - salt = sha_constructor(str(random.random())).hexdigest()[:5] - token = sha_constructor(salt + email_address).hexdigest() + salt = hashlib.sha1(str(random.random())).hexdigest()[:5] + token = hashlib.sha1(salt + email_address).hexdigest() pending = Speaker.objects.create( invite_email=email_address, invite_token=token, @@ -173,14 +173,14 @@ def proposal_edit(request, pk): if request.user != proposal.speaker.user: raise Http404() - + if not proposal.can_edit(): ctx = { "title": "Proposal editing closed", "body": "Proposal editing is closed for this session type." } return render(request, "proposals/proposal_error.html", ctx) - + form_class = get_form(settings.PROPOSAL_FORMS[proposal.kind.slug]) if request.method == "POST": @@ -206,7 +206,7 @@ def proposal_edit(request, pk): return redirect("proposal_detail", proposal.pk) else: form = form_class(instance=proposal) - + return render(request, "proposals/proposal_edit.html", { "proposal": proposal, "form": form, @@ -218,22 +218,22 @@ def proposal_detail(request, pk): queryset = ProposalBase.objects.select_related("speaker", "speaker__user") proposal = get_object_or_404(queryset, pk=pk) proposal = ProposalBase.objects.get_subclass(pk=proposal.pk) - + if request.user not in [p.user for p in proposal.speakers()]: raise Http404() - + if "symposion.reviews" in settings.INSTALLED_APPS: from symposion.reviews.forms import SpeakerCommentForm message_form = SpeakerCommentForm() if request.method == "POST": message_form = SpeakerCommentForm(request.POST) if message_form.is_valid(): - + message = message_form.save(commit=False) message.user = request.user message.proposal = proposal message.save() - + ProposalMessage = SpeakerCommentForm.Meta.model reviewers = User.objects.filter( id__in=ProposalMessage.objects.filter( @@ -242,7 +242,7 @@ def proposal_detail(request, pk): user=request.user ).distinct().values_list("user", flat=True) ) - + for reviewer in reviewers: ctx = { "proposal": proposal, @@ -253,13 +253,13 @@ def proposal_detail(request, pk): [reviewer.email], "proposal_new_message", context=ctx ) - + return redirect(request.path) else: message_form = SpeakerCommentForm() else: message_form = None - + return render(request, "proposals/proposal_detail.html", { "proposal": proposal, "message_form": message_form @@ -271,7 +271,7 @@ def proposal_cancel(request, pk): queryset = ProposalBase.objects.select_related("speaker") proposal = get_object_or_404(queryset, pk=pk) proposal = ProposalBase.objects.get_subclass(pk=proposal.pk) - + if proposal.speaker.user != request.user: return HttpResponseForbidden() @@ -281,7 +281,7 @@ def proposal_cancel(request, pk): # @@@ fire off email to submitter and other speakers messages.success(request, "%s has been cancelled" % proposal.title) return redirect("dashboard") - + return render(request, "proposals/proposal_cancel.html", { "proposal": proposal, }) @@ -339,10 +339,10 @@ def document_create(request, proposal_pk): queryset = ProposalBase.objects.select_related("speaker") proposal = get_object_or_404(queryset, pk=proposal_pk) proposal = ProposalBase.objects.get_subclass(pk=proposal.pk) - + if proposal.cancelled: return HttpResponseForbidden() - + if request.method == "POST": form = SupportingDocumentCreateForm(request.POST, request.FILES) if form.is_valid(): @@ -353,7 +353,7 @@ def document_create(request, proposal_pk): return redirect("proposal_detail", proposal.pk) else: form = SupportingDocumentCreateForm() - + return render(request, "proposals/document_create.html", { "proposal": proposal, "form": form, @@ -378,8 +378,8 @@ def document_download(request, pk, *args): def document_delete(request, pk): document = get_object_or_404(SupportingDocument, pk=pk, uploaded_by=request.user) proposal_pk = document.proposal.pk - + if request.method == "POST": document.delete() - + return redirect("proposal_detail", proposal_pk)