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

i18n-ed templates and proposals #10

Open
wants to merge 2 commits into
base: master
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
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ python:
- "2.7"
install:
- pip install -q flake8
- pip install -e .
script:
- flake8 project_name
3 changes: 2 additions & 1 deletion project_name/proposals/forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django import forms
from django.utils.translation import ugettext_lazy as _

from markitup.widgets import MarkItUpWidget

Expand All @@ -11,7 +12,7 @@ def clean_description(self):
value = self.cleaned_data["description"]
if len(value) > 400:
raise forms.ValidationError(
u"The description must be less than 400 characters"
_(u"The description must be less than 400 characters")
)
return value

Expand Down
13 changes: 7 additions & 6 deletions project_name/proposals/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _

from symposion.proposals.models import ProposalBase

Expand All @@ -10,16 +11,16 @@ class Proposal(ProposalBase):
AUDIENCE_LEVEL_INTERMEDIATE = 3

AUDIENCE_LEVELS = [
(AUDIENCE_LEVEL_NOVICE, "Novice"),
(AUDIENCE_LEVEL_INTERMEDIATE, "Intermediate"),
(AUDIENCE_LEVEL_EXPERIENCED, "Experienced"),
(AUDIENCE_LEVEL_NOVICE, _("Novice")),
(AUDIENCE_LEVEL_INTERMEDIATE, _("Intermediate")),
(AUDIENCE_LEVEL_EXPERIENCED, _("Experienced")),
]

audience_level = models.IntegerField(choices=AUDIENCE_LEVELS)

recording_release = models.BooleanField(
default=True,
help_text="By submitting your proposal, you agree to give permission to the conference organizers to record, edit, and release audio and/or video of your presentation. If you do not agree to this, please uncheck this box."
help_text=_("By submitting your proposal, you agree to give permission to the conference organizers to record, edit, and release audio and/or video of your presentation. If you do not agree to this, please uncheck this box.")
)

class Meta:
Expand All @@ -28,9 +29,9 @@ class Meta:

class TalkProposal(Proposal):
class Meta:
verbose_name = "talk proposal"
verbose_name = _("talk proposal")


class TutorialProposal(Proposal):
class Meta:
verbose_name = "tutorial proposal"
verbose_name = _("tutorial proposal")
8 changes: 4 additions & 4 deletions project_name/templates/boxes/box.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ <h3>{% trans "Editing content:" %} {{ label }}</h3>
{% markitup_editor form.content.auto_id %}
</div>
<div class="modal-footer">
<div class="pull-left">Content is processed using <a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">Markdown</a></div>
<a href="#" class="btn" data-dismiss="modal">Close</a>
<button type="submit" class="btn btn-primary">Save changes</a>
<div class="pull-left">{% blocktrans %} Content is processed using <a href="http://daringfireball.net/projects/markdown/syntax" target="_blank">Markdown</a>{% endblocktrans %}</div>
<a href="#" class="btn" data-dismiss="modal">{% trans "Close" %}</a>
<button type="submit" class="btn btn-primary">{% trans "Save changes" %}</a>
</div>
</form>
</div>
{% endif %}

<div id="content_{{ label }}" class="content-box {% if form %}editable{% endif %}">
{% if form %}
<a href="#edit_{{ label }}" data-toggle="modal" class="btn edit-toggle"><i class="fa fa-pencil"></i> Edit this content</a>
<a href="#edit_{{ label }}" data-toggle="modal" class="btn edit-toggle"><i class="fa fa-pencil"></i>{% trans "Edit this content" %}</a>
{% endif %}
{{ box.content|safe }}
</div>
2 changes: 1 addition & 1 deletion project_name/templates/conference/user_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% load i18n %}
{% load sitetree %}

{% block head_title %}User List{% endblock %}
{% block head_title %}{% trans "User List" %}{% endblock %}

{% block extra_style %}
<style type="text/css">
Expand Down
73 changes: 39 additions & 34 deletions project_name/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,62 @@
{% load review_tags %}
{% load teams_tags %}

{% block head_title %}Dashboard{% endblock %}
{% block head_title %}{% trans "Dashboard" %}{% endblock %}

{% block body_class %}auth{% endblock %}
{% block body_class %}{% trans "auth" %}{% endblock %}

{% block body %}
<div class="dashboard-panel">
<div class="dashboard-panel-header">
<i class="fa fa-bullhorn"></i>
<h3>{% trans "Speaking" %}</h3>
<div class="pull-right header-actions">
<div class="pull-right header-actions">
{% if not user.speaker_profile %}
<a href="{% url "speaker_create" %}" class="btn btn-default">
<i class="fa fa-plus-sign"></i> Create a speaker profile
<i class="fa fa-plus-sign"></i>{% trans "Create a speaker profile" %}
</a>
{% else %}
<a href="{% url "speaker_edit" %}" class="btn btn-default">
<i class="fa fa-pencil"></i> Edit your speaker profile
<i class="fa fa-pencil"></i>{% trans "Edit your speaker profile" %}
</a>
<a href="{% url "proposal_submit" %}" class="btn btn-default">
<i class="fa fa-plus-sign"></i> Submit a new proposal
<i class="fa fa-plus-sign"></i>{% trans "Submit a new proposal" %}
</a>
{% endif %}
</div>
</div>

<div class="dashboard-panel-content">
{% if not user.speaker_profile %}
<p>To submit a proposal, you must first <a href="{% url "speaker_create" %}">create a speaker profile</a>.</p>
{% url "speaker_create" as dest %}
{% blocktrans %}<p>To submit a proposal, you must first <a href="{{ dest }}"> create a speaker profile</a>.</p>{% endblocktrans %}
{% else %}
<h4>Your Proposals</h4>
<h4>{% trans "Your Proposals" %}</h4>
{% if user.speaker_profile.proposals.exists %}
<table class="table">
<tr>
<th>Title</th>
<th>Session type</th>
<th>Status</th>
<th>Actions</th>
<th>{% trans "Title" %}</th>
<th>{% trans "Session type" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
{% for proposal in user.speaker_profile.proposals.all %}
{% include "proposals/_proposal_row.html" %}
{% endfor %}
</table>
{% else %}
<p>No proposals submitted yet.</p>
<p>{% trans "No proposals submitted yet." %}</p>
{% endif %}

{% associated_proposals as associated_proposals %}
{% if associated_proposals %}
<h4>Proposals you have joined as an additional speaker</h4>
<h4>{% trans "Proposals you have joined as an additional speaker" %}</h4>
<table class="table">
<tr>
<th>Title</th>
<th>Session type</th>
<th>Status</th>
<th>Actions</th>
<th>{% trans "Title" %}</th>
<th>{% trans "Session type" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
{% for proposal in associated_proposals %}
{% include "proposals/_proposal_row.html" %}
Expand All @@ -69,13 +70,13 @@ <h4>Proposals you have joined as an additional speaker</h4>

{% pending_proposals as pending_proposals %}
{% if pending_proposals %}
<h4>Proposals you have been invited to join</h4>
<h4>{% trans "Proposals you have been invited to join" %}</h4>
<table class="table">
<tr>
<th>Title</th>
<th>Session type</th>
<th>Status</th>
<th>Actions</th>
<th>{% trans "Title" %}</th>
<th>{% trans "Session type" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
{% for proposal in pending_proposals %}
{% include "proposals/_pending_proposal_row.html" %}
Expand All @@ -93,34 +94,38 @@ <h3>{% trans "Sponsorship" %}</h3>
<div class="pull-right header-actions">
{% if not user.sponsorships.exists %}
<a href="{% url "sponsor_apply" %}" class="btn btn-default">
<i class="fa fa-plus-sign"></i> Apply to be a sponsor
<i class="fa fa-plus-sign"></i>{% trans "Apply to be a sponsor" %}
</a>
{% endif %}
</div>
</div>

<div class="dashboard-panel-content">
{% if not user.sponsorships.exists %}
<p>If you or your organization would be interested in sponsorship opportunities, <a href="{% url "sponsor_apply" %}">use our online form to apply to be a sponsor</a>.
{% url "sponsor_apply" as dest %}
{% blocktrans %}<p>If you or your organization would be interested in sponsorship opportunities,<a href="{{ dest }}">use our online form to apply to be a sponsor</a>.{% endblocktrans %}
{% else %}
<h4>Your Sponsorship</h4>
<h4>{% trans "Your Sponsorship" %}</h4>
<ul>
{% for sponsorship in user.sponsorships.all %}
<li>
<a href="{% url "sponsor_detail" sponsorship.pk %}"><b>{{ sponsorship.name }}</b></a>
({{ sponsorship.level }})
{% if not sponsorship.active %}
<span class="label label-warning">awaiting approval</span>
<span class="label label-warning">{% trans "awaiting approval" %}</span>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
{% if user.is_staff %}
<p>
As staff, you can directly <a href="{% url "sponsor_add" %}">add a sponsor</a> if the organization isn't
{% url "sponsor_add" as dest %}
{% blocktrans %}
<p>
As staff, you can directly <a href="{{ dest }}">add a sponsor</a> if the organization isn't
applying themselves.
</p>
</p>
{% endblocktrans %}
{% endif %}
</div>
</div>
Expand All @@ -133,14 +138,14 @@ <h3>{% trans "Reviews" %}</h3>
</div>

<div class="dashboard-panel-content">
<h4>Reviews by Section</h4>
<h4>{% trans "Reviews by Section" %}</h4>

<ul>
{% for section in review_sections %}
<h5>{{ section }}</h5>
<li><a href="{% url "review_section" section.section.slug %}">All</a></li>
<li><a href="{% url "user_reviewed" section.section.slug %}">Reviewed by you</a></li>
<li><a href="{% url "user_not_reviewed" section.section.slug %}">Not Reviewed by you</a></li>
<li><a href="{% url "review_section" section.section.slug %}">{% trans "All" %}</a></li>
<li><a href="{% url "user_reviewed" section.section.slug %}">{% trans "Reviewed by you" %}</a></li>
<li><a href="{% url "user_not_reviewed" section.section.slug %}">{% trans "Not Reviewed by you" %}</a></li>
{% endfor %}
</ul>

Expand Down