Merge pull request #628 from rtfd/languagepicker

Add a basic language picker to the footer.
refactor-builder
Eric Holscher 2014-01-17 00:18:50 -08:00
commit c960df21d3
7 changed files with 44 additions and 48 deletions

View File

@ -133,7 +133,7 @@ def checkout(user=None):
'deploy_requirements.txt') % (home, home))
def setup_env(user=None):
def setup_env(user=None, role=None):
if user:
users = [user]
else:
@ -142,8 +142,9 @@ def setup_env(user=None):
env.user = user
home = '/home/%s' % user
put('files/bash_profile', '%s/.bash_profile' % home)
#put('files/%s_supervisord.conf' % user,
#'%s/etc/supervisord.conf' % home)
if role:
put('files/%s_supervisord.conf' % role,
'%s/etc/supervisord.conf' % home)
#run('%s/bin/pip install -U supervisor ipython gunicorn' % home)

View File

@ -1,24 +1,22 @@
[unix_http_server]
file=/home/builder/run/supervisord-builder.sock
file=/home/docs/run/supervisord-docs.sock
chmod=0700
[supervisord]
logfile=/home/builder/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile=/home/docs/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/home/builder/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
pidfile=/home/docs/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl = unix:///home/builder/run/supervisord-builder.sock
serverurl = unix:///home/docs/run/supervisord-docs.sock
[program:celery]
command=django-admin.py celeryd -l DEBUG -v 2 -f /home/builder/log/celery_proc.log -Q builder
stdout_logfile=/home/builder/log/celery.log
stderr_logfile=/home/builder/log/celery.err
command=newrelic-admin run-program python /home/docs/bin/django-admin.py celeryd -B -l INFO -v 2 -f /home/docs/log/celery_proc.log -c 12 -Q celery,default,builder
environment=NEW_RELIC_CONFIG_FILE=/home/docs/newrelic.ini
stdout_logfile=/home/docs/log/celery.log
stderr_logfile=/home/docs/log/celery.err

View File

@ -1,24 +0,0 @@
[unix_http_server]
file=/home/builder/run/supervisord-builder.sock
chmod=0700
[supervisord]
logfile=/home/builder/log/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/home/builder/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl = unix:///home/builder/run/supervisord-builder.sock
[program:celery]
command=django-admin.py celeryd -l DEBUG -v 2 -f /home/builder/log/celery_proc.log -Q builder
stdout_logfile=/home/builder/log/celery.log
stderr_logfile=/home/builder/log/celery.err

View File

@ -18,13 +18,8 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl = unix:///home/docs/run/supervisord-docs.sock
#[program:web]
#command=gunicorn_django -b 0.0.0.0:8000
#directory=/home/docs/checkouts/readthedocs.org/readthedocs
#stdout_logfile=/home/docs/log/web.log
#stderr_logfile=/home/docs/log/web.err
[program:celery]
command=django-admin.py celeryd -l DEBUG -v 2 -f /home/docs/log/celery_proc.log
stdout_logfile=/home/docs/log/celery.log
stderr_logfile=/home/docs/log/celery.err
[program:web]
command=gunicorn_django -b 0.0.0.0:8000
directory=/home/docs/checkouts/readthedocs.org/readthedocs
stdout_logfile=/home/docs/log/web.log
stderr_logfile=/home/docs/log/web.err

View File

@ -58,8 +58,8 @@ LANGUAGES = (
('ru', gettext('Russian')),
('de', gettext('German')),
('gl', gettext('Galician')),
('zh', gettext('Chinese')),
('vi', gettext('Vietnamese')),
('zh-cn', gettext('Chinese')),
)
LOCALE_PATHS = [

View File

@ -79,6 +79,7 @@
<hr>
{% block footer-content %}
<p>{% blocktrans with "<a href='http://ericholscher.com/'>Eric Holscher</a>" as eric and "<a href='http://charlesleifer.com/'>Charles Leifer<a>" as charles and "<a href='http://bobbygrace.info/'>Bobby Grace</a>" as bobby and "<a href='http://djangodash.com/'>Django Dash</a>" as djangodash %}Copyright 2010-2013. Created by {{ eric }}, {{ charles }}, and {{ bobby }} for the 2010 {{ djangodash }}.{% endblocktrans %}
</p>
@ -88,6 +89,30 @@
</p>
{% endblock %}
<p>
Change Site Language
</p>
{% get_current_language as current_lang %}
<form action="/i18n/setlang/" method="post">{% csrf_token %}
<input name="next" type="hidden" value="/" />
{% csrf_token %}
<select style="float: left; height: 33px;" name="language">
{% for lang in LANGUAGES %}
{% if lang.0 == current_lang %}
<option selected="selected" value="{{ lang.0 }}">{{ lang.0|language_name_local }} [{{ lang.1 }}]</option>
{% else %}
<option value="{{ lang.0 }}">{{ lang.0|language_name_local }} [{{ lang.1 }}]</option>
{% endif %}
}
{% endfor %}
</select>
<input style="float: left; height: 33px; margin: 0px;" type="submit" value="Change Language" name="submit">
</form>
<br>
<br>
<p>
Read the Docs Announcements

View File

@ -62,6 +62,7 @@ urlpatterns = patterns(
'core.views.serve_single_version_docs',
name='docs_detail'),
url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^projects/', include('projects.urls.public')),
url(r'^builds/', include('builds.urls')),
url(r'^flagging/', include('basic.flagging.urls')),