Fix the cla.txt template problem, fix initial inserts in schema, and gettext calls in template.

This commit is contained in:
Ricky Zhou (周家杰) 2008-03-15 02:31:10 -04:00
parent 3388021462
commit 6285bd18a2
3 changed files with 7 additions and 9 deletions

View file

@ -7,8 +7,7 @@ import cherrypy
from datetime import datetime from datetime import datetime
import re import re
import turbomail import turbomail
from genshi.template import TemplateLoader from genshi.template.plugin import TextTemplateEnginePlugin
from genshi.template import TextTemplate
from fas.model import People from fas.model import People
from fas.model import Log from fas.model import Log
@ -109,9 +108,8 @@ Date: %(date)s
'facsimile': person.facsimile, 'facsimile': person.facsimile,
'date': dt.ctime(),} 'date': dt.ctime(),}
# Sigh.. if only there were a nicer way. # Sigh.. if only there were a nicer way.
loader = TemplateLoader('fas/templates/cla') plugin = TextTemplateEnginePlugin()
template = loader.load('cla.txt', cls=TextTemplate) message.plain += plugin.render(template='fas.templates.cla.cla', info=dict(person=person), format='text')
message.plain += template.generate(person=person).render('text')
turbomail.enqueue(message) turbomail.enqueue(message)
turbogears.flash(_("You have successfully completed the CLA. You are now in the '%s' group.") % group.name) turbogears.flash(_("You have successfully completed the CLA. You are now in the '%s' group.") % group.name)
turbogears.redirect('/user/view/%s' % person.username) turbogears.redirect('/user/view/%s' % person.username)

View file

@ -21,8 +21,8 @@
</py:if> </py:if>
</py:for> </py:for>
<ul class="queue"> <ul class="queue">
<li py:if="not cla" class="unapproved">${_('CLA not completed. To become a full Fedora Contributor please ')}<a href="${tg.url('/cla/')}">${_('Complete the CLA')}</a>.</li> <li py:if="not cla" class="unapproved">${Markup(_('CLA not completed. To become a full Fedora Contributor please &lt;a href="%s"&gt;complete the CLA&lt;/a&gt;.') % tg.url('/cla/'))}</li>
<li py:if="not person.ssh_key">You have not submitted an SSH key, some Fedora resources require an SSH key. Please submit yours by editing <a href="${tg.url('/user/edit')}">My Account</a></li> <li py:if="not person.ssh_key">${Markup(_('You have not submitted an SSH key, some Fedora resources require an SSH key. Please submit yours by editing &lt;a href="%s"&gt;My Account&lt;/a&gt;') % tg.url('/user/edit'))}</li>
</ul> </ul>
<div> <div>
<!-- TODO: Make this entire page more friendly --> <!-- TODO: Make this entire page more friendly -->

View file

@ -347,8 +347,8 @@ GRANT ALL ON TABLE people, groups, person_roles, group_roles, bugzilla_queue, co
INSERT INTO people (id, username, human_name, password, email) VALUES (100001, 'admin', 'Admin User', '$1$djFfnacd$b6NFqFlac743Lb4sKWXj4/', 'root@localhost'); INSERT INTO people (id, username, human_name, password, email) VALUES (100001, 'admin', 'Admin User', '$1$djFfnacd$b6NFqFlac743Lb4sKWXj4/', 'root@localhost');
-- Create default groups and populate -- Create default groups and populate
INSERT INTO groups (id, name, display_name, owner_id, group_type) VALUES (100002, 'cla_done', 'CLA Done Group', (SELECT id from people where username='admin'), 'tracking'); INSERT INTO groups (id, name, display_name, owner_id, group_type, user_can_remove) VALUES (100002, 'cla_done', 'CLA Done Group', (SELECT id from people where username='admin'), 'tracking', false);
INSERT INTO groups (id, name, display_name, owner_id, group_type) VALUES (101441, 'cla_fedora', 'Fedora CLA Group', (SELECT id from people where username='admin'), 'tracking'); INSERT INTO groups (id, name, display_name, owner_id, group_type, user_can_remove) VALUES (101441, 'cla_fedora', 'Fedora CLA Group', (SELECT id from people where username='admin'), 'tracking', false);
INSERT INTO groups (id, name, display_name, owner_id, group_type) VALUES (100006, 'accounts', 'Account System Admins', (SELECT id from people where username='admin'), 'tracking'); INSERT INTO groups (id, name, display_name, owner_id, group_type) VALUES (100006, 'accounts', 'Account System Admins', (SELECT id from people where username='admin'), 'tracking');
INSERT INTO groups (id, name, display_name, owner_id, group_type) VALUES (100148, 'fedorabugs', 'Fedora Bugs Group', (SELECT id from people where username='admin'), 'tracking'); INSERT INTO groups (id, name, display_name, owner_id, group_type) VALUES (100148, 'fedorabugs', 'Fedora Bugs Group', (SELECT id from people where username='admin'), 'tracking');
INSERT INTO groups (name, display_name, owner_id, group_type) VALUES ('fas-system', 'System users allowed to get password and key information', (SELECT id from people where username='admin'), 'system'); INSERT INTO groups (name, display_name, owner_id, group_type) VALUES ('fas-system', 'System users allowed to get password and key information', (SELECT id from people where username='admin'), 'system');