Commit e98e9c98 authored by Claude Paroz's avatar Claude Paroz

Add more editable details for teams

Two more fields are editable for teams:
* presentation is a free text field (markdown syntax) for team
coordinators to add information about their team, displayed on
the top of the team page.
* use_workflow is a flag that allows teams to specify whether they
use the Damned Lies Vertimus workflow. If False, the Actions widgets
are not displayed on the Vertimus templates.
parent 4454cd00
......@@ -29,14 +29,16 @@ Requirements
See http://south.aeracode.org/wiki/Download for installation instructions
5 - [Optional] Django Debug Toolbar
5 - Markdown (python-markdown) for Team presentation markup rendering
6 - [Optional] Django Debug Toolbar
git clone git://github.com/dcramer/django-debug-toolbar.git
Define USE_DEBUG_TOOLBAR to True in settings.py to use it.
6 - [Optional] python-openid and django-openid (see OpenID support
7 - [Optional] python-openid and django-openid (see OpenID support
below).
7 - [Optional] python-pyicu for correct sorting in various languages
8 - [Optional] python-pyicu for correct sorting in various languages
Installation
============
......
......@@ -423,3 +423,8 @@ div#content {
ul.foot li {
list-style-image: url(../img/foot-16.png);
}
ul.smallspacing {
margin-top: 0.2em;
margin-bottom: 0.2em;
}
......@@ -123,6 +123,7 @@ INSTALLED_APPS = (
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.humanize',
'django.contrib.markup',
# 'django_openid',
'south',
'common',
......
from django.contrib import admin
from teams.models import Team, Role
from languages.models import Language
class LanguageInline(admin.TabularInline):
model = Language
# Languages are not supposed to be created in this form
extra = 0
class TeamAdmin(admin.ModelAdmin):
search_fields = ('name',)
inlines = [ LanguageInline ]
def formfield_for_dbfield(self, db_field, **kwargs):
# Reduced text area for aliases
......
......@@ -4,12 +4,13 @@ from teams.models import Team, ROLE_CHOICES
class EditTeamDetailsForm(forms.ModelForm):
class Meta:
model = Team
fields = ('webpage_url', 'mailing_list', 'mailing_list_subscribe')
fields = ('webpage_url', 'mailing_list', 'mailing_list_subscribe', 'use_workflow', 'presentation')
def __init__(self, *args, **kwargs):
super(EditTeamDetailsForm, self).__init__(*args, **kwargs)
for f in ('webpage_url', 'mailing_list', 'mailing_list_subscribe'):
self.fields[f].widget.attrs['size'] = 60
self.fields['presentation'].widget.attrs["cols"] = 60
class EditMemberRoleForm(forms.Form):
......
# -*- coding: utf-8 -*-
from south.db import db
from django.db import models
from teams.models import *
class Migration:
def forwards(self, orm):
# Adding field 'Team.presentation'
db.add_column('team', 'presentation', orm['teams.team:presentation'])
# Adding field 'Team.use_workflow'
db.add_column('team', 'use_workflow', orm['teams.team:use_workflow'])
def backwards(self, orm):
# Deleting field 'Team.presentation'
db.delete_column('team', 'presentation')
# Deleting field 'Team.use_workflow'
db.delete_column('team', 'use_workflow')
models = {
'auth.group': {
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'})
},
'auth.permission': {
'Meta': {'unique_together': "(('content_type', 'codename'),)"},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'unique_together': "(('app_label', 'model'),)", 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'people.person': {
'Meta': {'db_table': "'person'"},
'activation_key': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
'bugzilla_account': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
'image': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'irc_nick': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '20', 'null': 'True', 'blank': 'True'}),
'svn_account': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '20', 'null': 'True', 'blank': 'True'}),
'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
'webpage_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
},
'teams.role': {
'Meta': {'unique_together': "(('team', 'person'),)", 'db_table': "'role'"},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['people.Person']"}),
'role': ('django.db.models.fields.CharField', [], {'default': "'translator'", 'max_length': '15'}),
'team': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['teams.Team']"})
},
'teams.team': {
'Meta': {'db_table': "'team'"},
'description': ('django.db.models.fields.TextField', [], {}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'mailing_list': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
'mailing_list_subscribe': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'members': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['people.Person']"}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
'presentation': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'use_workflow': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
'webpage_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'})
}
}
complete_apps = ['teams']
......@@ -85,6 +85,8 @@ class Team(models.Model):
name = models.CharField(max_length=80)
description = models.TextField()
use_workflow = models.BooleanField(default=True)
presentation = models.TextField(blank=True, verbose_name=_("Presentation"))
members = models.ManyToManyField(Person, through='Role', related_name='teams')
webpage_url = models.URLField(null=True, blank=True, verbose_name=_("Web page"))
mailing_list = models.EmailField(null=True, blank=True, verbose_name=_("Mailing list"))
......
......@@ -16,14 +16,14 @@
{% endif %}
<br/><strong>{% trans "Bugzilla:" %}</strong>
<ul>
<ul class="smallspacing">
<li><a href="{{ language.bugs_url_enter|safe }}">{% trans "Report Bug in Translation" %}</a></li>
<li><a href="{{ language.bugs_url_show|safe }}">{% trans "Show Existing Bugs" %}</a></li>
</ul>
{% if team.mailing_list %}
<br/><strong>{% trans "Mailing List:" %}</strong>
<ul>
<ul class="smallspacing">
<li><a href="mailto:{{ team.mailing_list }}">{% trans "Send e-mail to the list" %}</a></li>
{% if team.mailing_list_subscribe %}
<li><a href="{{ team.mailing_list_subscribe }}">{% trans "Subscribe" %}</a></li>
......
{% extends "base.html" %}
{% load i18n %}
{% load stats_extras %}
{% load markup %}
{% block extrahead %}
<link rel="alternate" type="application/rss+xml"
title="{% blocktrans with team.get_description as lang %}Last actions made by the {{ lang }} team of the GNOME Translation Project{% endblocktrans %}"
......@@ -37,6 +38,7 @@ $(document).ready(function() {
{% if not team.fake %}
<h1>{% blocktrans with team.get_description as lang %}{{ lang }} Translation Team{% endblocktrans %}</h1>
{% if team.presentation %}<p>{{ team.presentation|markdown }}</p>{% endif %}
{% with team.get_languages.0 as language %}
{% include "teams/team_base.html" %}
......
......@@ -2,14 +2,29 @@
{% load i18n %}
{% block title %}{{ team.get_description }}{% endblock %}
{% block extrahead %}
<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.growfield2.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#id_presentation").growfield();
});
</script>
{% endblock %}
{% block content %}
<div class="mainpage">
<h1>{{ team.get_description }}</h1>
<h1>{% blocktrans with team.get_description as lang %}{{ lang }} Translation Team{% endblocktrans %}</h1>
<form action="#" method="POST">
<table>
{{ form.as_table }}
<tr><td colspan="2" align="right"><input type="submit" value="{% trans 'Save' %}"/></td></tr>
<tr><th>{{ form.webpage_url.label }}:</th><td>{{ form.webpage_url }}</td></tr>
<tr><th>{{ form.mailing_list.label }}:</th><td>{{ form.mailing_list }}</td></tr>
<tr><th>{{ form.mailing_list_subscribe.label }}:</th><td>{{ form.mailing_list_subscribe }}</td></tr>
<tr><th></th><td>{{ form.use_workflow }} <label for="id_use_workflow">{% trans "This team is using the Vertimus translation workflow" %}</label>
<tr><th valign="top"><span class="help">&nbsp;</span><br />{{ form.presentation.label }}:</th>
<td><span class="help">{% trans "This content may use <a href='http://en.wikipedia.org/wiki/Markdown'>Markdown</a> syntax</a>" %}<br />
{{ form.presentation }}</td></tr>
<tr><td colspan="2" align="right"><input type="submit" value="{% trans 'Save' %}"/></td></tr>
</table>
</form>
......
......@@ -99,6 +99,7 @@ $(document).ready(function() {
</div>
{% endif %}
{% if language.team.use_workflow %}
<div id="vertimus_actions_title">
<h2>
{% ifequal level 0 %}
......@@ -186,5 +187,6 @@ $(document).ready(function() {
{% blocktrans with language.team.get_description as team_name %}You need to be authenticated and to be member of the {{ team_name }} team.{% endblocktrans %}
{% endif %}
{% endifequal %}
{% endif %}
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment