damned-lies r1344 - in trunk: . templates/people vertimus
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r1344 - in trunk: . templates/people vertimus
- Date: Tue, 13 Jan 2009 12:44:30 +0000 (UTC)
Author: claudep
Date: Tue Jan 13 12:44:30 2009
New Revision: 1344
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1344&view=rev
Log:
2009-01-13 Claude Paroz <claude 2xlibre net>
* templates/people/person_detail.html: Only show site language popup on
his own page.
* vertimus/forms.py: Add a help text to the File widget.
* vertimus/models.py: Set extension of uploaded files identical to
original file.
Fixes #567512.
Modified:
trunk/ChangeLog
trunk/templates/people/person_detail.html
trunk/vertimus/forms.py
trunk/vertimus/models.py
Modified: trunk/templates/people/person_detail.html
==============================================================================
--- trunk/templates/people/person_detail.html (original)
+++ trunk/templates/people/person_detail.html Tue Jan 13 12:44:30 2009
@@ -4,20 +4,24 @@
{% load stats_extras %}
{% block subcontent %}
-<br clear="right" />
-<div style="float:right; text-align:right;">
-<form action="/i18n/setlang/" method="post">
-{% trans "Site Language:" %} <select name="language">
-{% for lang in LANGUAGES %}
- {% ifequal lang.0 LANGUAGE_CODE %}
- <option value="{{ lang.0 }}" selected="selected">{% trans lang.1 %}</option>
- {% else %}
- <option value="{{ lang.0 }}" >{% trans lang.1 %}</option>
- {% endifequal %}
-{% endfor %}
-</select><br />
-<input type="submit" value="{% trans "Choose" %}" />
-</form></div>
+{% if user.is_authenticated %}
+{% ifequal user.username person.username %}
+ <br clear="right" />
+ <div style="float:right; text-align:right;">
+ <form action="/i18n/setlang/" method="post">
+ {% trans "Site Language:" %} <select name="language">
+ {% for lang in LANGUAGES %}
+ {% ifequal lang.0 LANGUAGE_CODE %}
+ <option value="{{ lang.0 }}" selected="selected">{% trans lang.1 %}</option>
+ {% else %}
+ <option value="{{ lang.0 }}" >{% trans lang.1 %}</option>
+ {% endifequal %}
+ {% endfor %}
+ </select><br />
+ <input type="submit" value="{% trans "Choose" %}" />
+ </form></div>
+{% endifequal %}
+{% endif %}
{% if person.maintains_modules.all %}
<h2>{% trans "Maintains:" %}</h2>
Modified: trunk/vertimus/forms.py
==============================================================================
--- trunk/vertimus/forms.py (original)
+++ trunk/vertimus/forms.py Tue Jan 13 12:44:30 2009
@@ -35,7 +35,8 @@
max_length=1000,
required=False,
widget=forms.Textarea)
- file = forms.FileField(label=_("File"), required=False)
+ file = forms.FileField(label=_("File"), required=False,
+ help_text=_("Upload a .po, .gz, .bz2 or .png file"))
def __init__(self, available_actions, *args, **kwargs):
super(ActionForm, self).__init__(*args, **kwargs)
Modified: trunk/vertimus/models.py
==============================================================================
--- trunk/vertimus/models.py (original)
+++ trunk/vertimus/models.py Tue Jan 13 12:44:30 2009
@@ -254,11 +254,15 @@
'BA', 'UNDO')
def generate_upload_file_name(instance, original_filename):
- filename = "%s-%s-%s-%s-%s.po" % (instance.state_db.branch.module.name,
+ base, ext = os.path.splitext(original_filename)
+ if os.path.splitext(base)[1] == ".tar":
+ ext = ".tar" + ext
+ filename = "%s-%s-%s-%s-%s%s" % (instance.state_db.branch.module.name,
instance.state_db.branch.name,
instance.state_db.domain.name,
instance.state_db.language.locale,
- instance.state_db.id)
+ instance.state_db.id,
+ ext)
return "%s/%s" % (settings.UPLOAD_DIR, filename)
class ActionDb(models.Model):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]