Commit 4a86615cbc465999070157424ba0fd09ea6ee203

Authored by Sergio Oliveira
2 parents 4c3b20b3 e4f0799b

Merge pull request #2 from TracyWebTech/master

Bug fixing
fabfile.py
... ... @@ -81,6 +81,7 @@ def deploy(update=False):
81 81 if update:
82 82 update_requirements()
83 83  
  84 + load_badges()
84 85 with cd('~/colab/src/'), prefix(WORKON_COLAB):
85 86 run('python manage.py syncdb')
86 87 run('python manage.py migrate')
... ...
puppet/modules/colab/manifests/cronjobs.pp
... ... @@ -8,26 +8,32 @@ class colab::cronjobs {
8 8 user => colab,
9 9 }
10 10  
  11 + cron { 'feedzilla':
  12 + command => "$manage_colab feedzilla_update &> /dev/null",
  13 + hour => '*',
  14 + minute => '0',
  15 + }
  16 +
11 17 cron { 'update-badges':
12   - command => "$manage_colab update_badges",
  18 + command => "$manage_colab update_badges &> /dev/null",
13 19 hour => '*',
14 20 minute => '*/5',
15 21 }
16 22  
17 23 cron { 'update-haystack-index':
18   - command => "$manage_colab update_index --age=1",
  24 + command => "$manage_colab update_index --age=1 &> /dev/null",
19 25 hour => '*',
20 26 minute => '*',
21 27 }
22 28  
23 29 cron { 'rebuild-haystack-index':
24   - command => "$manage_colab rebuild_index --noinput",
  30 + command => "$manage_colab rebuild_index --noinput &> /dev/null",
25 31 hour => '2',
26 32 minute => '34',
27 33 }
28 34  
29 35 cron { 'import-mailman-messages':
30   - command => "$manage_colab import_emails --archives_path=/mnt/mailman/archives/ --exclude-list=saberes-divulgacao --exclude-list=pml --exclude-list=mailman --exclude-list=lexml-anuncios",
  36 + command => "$manage_colab import_emails --archives_path=/mnt/mailman/archives/ --exclude-list=saberes-divulgacao --exclude-list=pml --exclude-list=mailman --exclude-list=lexml-anuncios &> /dev/null",
31 37 hour => '*',
32 38 minute => '*',
33 39 }
... ... @@ -42,7 +48,7 @@ class colab::cronjobs {
42 48 }
43 49  
44 50 cron { 'mount-sshfs':
45   - command => 'test -e /mnt/mailman/archives/flag || sshfs root@listas.interlegis.gov.br:/var/lib/mailman/archives/private /mnt/mailman/archives/ -o ro,nosuid,nodev,max_read=65536,allow_other,IdentityFile=/root/.ssh/id_rsa && touch /mnt/mailman/archives/flag',
  51 + command => 'test -e /mnt/mailman/archives/flag || sshfs root@listas.interlegis.gov.br:/var/lib/mailman/archives/private /mnt/mailman/archives/ -o ro,nosuid,nodev,max_read=65536,allow_other,IdentityFile=/root/.ssh/id_rsa && touch /mnt/mailman/archives/flag &> /dev/null',
46 52 minute => '*/5',
47 53 user => 'root',
48 54 require => [
... ...
puppet/modules/colab/manifests/init.pp
... ... @@ -19,6 +19,15 @@ class colab {
19 19 require => Apt::Ppa['ppa:nginx/stable'],
20 20 }
21 21  
  22 + Mailalias {
  23 + notify => Exec['newaliases'],
  24 + }
  25 +
  26 + exec { 'newaliases':
  27 + path => '/usr/bin/newaliases',
  28 + refreshonly => true,
  29 + }
  30 +
22 31 group { 'colab':
23 32 ensure => present,
24 33 }
... ...
puppet/modules/colab/templates/nginx/site_default.erb
... ... @@ -33,11 +33,11 @@ server {
33 33 }
34 34  
35 35 location /chrome {
36   - proxy_pass http://ambientedev01a.interlegis.leg.br;
  36 + proxy_pass http://10.1.2.81;
37 37 }
38 38  
39 39 location /raw-attachment {
40   - proxy_pass http://ambientedev01a.interlegis.leg.br;
  40 + proxy_pass http://10.1.2.81;
41 41 }
42 42  
43 43 location / {
... ...
requirements.txt
... ... @@ -11,23 +11,24 @@ django-haystack==2.1
11 11 pysolr==2.1
12 12 poster==0.8.1
13 13 etiquetando==0.1
14   -html2text
15   -django-taggit
16   -python-memcached
17   -django-hitcounter
18   -Pillow
19   -django-i18n-model
  14 +html2text==3.200.3
  15 +django-taggit==0.10
  16 +python-memcached==1.53
  17 +django-hitcounter==0.1.1
  18 +Pillow==2.2.1
  19 +django-i18n-model==0.0.7
20 20  
21   -gunicorn
22   -gevent
  21 +gunicorn==18.0
  22 +gevent==0.13.8
23 23  
24 24 # Deps for sentry client (raven)
25   -raven
26   -tornado
  25 +raven==3.5.2
  26 +tornado==3.1.1
27 27  
28 28 # Deps for Single SignOn (SSO)
29   -git+https://github.com/TracyWebTech/django-browserid@issue210
30   -django-revproxy
  29 +git+https://github.com/mozilla/django-browserid
  30 +
  31 +django-revproxy==0.2.5
31 32  
32 33 # Converse.js (XMPP client)
33 34 django-conversejs==0.2.8
... ... @@ -35,12 +36,13 @@ git+https://github.com/TracyWebTech/SleekXMPP@fix-gevent
35 36  
36 37 # Feedzilla (planet) and deps
37 38 #feedzilla==0.22
38   -hg+https://bitbucket.org/lorien/feedzilla
39   -django-common
40   -feedparser
41   -lxml
42   -grab
43   -transliterate
  39 +#hg+https://bitbucket.org/lorien/feedzilla
  40 +hg+https://bitbucket.org/TracyWebTech/feedzilla/
  41 +django-common==0.1.51
  42 +feedparser==5.1.3
  43 +lxml==3.2.4
  44 +grab==0.4.13
  45 +transliterate==1.5
44 46  
45 47 # Diazo
46 48 #diazo
... ...
src/accounts/templates/accounts/user_detail.html
... ... @@ -133,7 +133,7 @@
133 133 </div>
134 134  
135 135 <div class="col-lg-6 col-md-6 col-sm-12">
136   - <h3>{% trans "Community inside participations" %}</h3>
  136 + <h3>{% trans "Contributions" %}</h3>
137 137 <ul class="message-list">
138 138 {% for result in results %}
139 139 {% include "message-preview.html" %}
... ...
src/accounts/templates/accounts/user_update_form.html
... ... @@ -5,15 +5,11 @@
5 5 <script>
6 6 $(function() {
7 7  
8   - // Reset buttons to default state
9   - $('.set-primary').button('reset');
10   - $('.delete-email').button('reset');
11   -
12 8 $('#add-email').on('click', function(event) {
13 9 $.ajax({
14 10 url: "{% url 'archive_email_view' %}",
15 11 type: 'post',
16   - data: { email: $('#new_email').val() },
  12 + data: { email: $('#new_email').val(), user: '{{ user_.pk }}' },
17 13 beforeSend: function(xhr, settings) {
18 14 xhr.setRequestHeader("X-CSRFToken", $.cookie('csrftoken'));
19 15 }
... ... @@ -36,7 +32,10 @@ $(function() {
36 32 $.ajax({
37 33 url: "{% url 'archive_email_view' %}",
38 34 type: 'delete',
39   - data: { email: $('.email-address', $email_block).text() },
  35 + data: {
  36 + email: $('.email-address', $email_block).text(),
  37 + user: '{{ user_.pk }}'
  38 + },
40 39 context: $email_block[0],
41 40 beforeSend: function(xhr, settings) {
42 41 xhr.setRequestHeader("X-CSRFToken", $.cookie('csrftoken'));
... ... @@ -53,7 +52,10 @@ $(function() {
53 52 $.ajax({
54 53 url: "{% url 'archive_email_validation_view' %}",
55 54 type: 'post',
56   - data: { email: $('.email-address', $email_block).text() },
  55 + data: {
  56 + email: $('.email-address', $email_block).text(),
  57 + user: '{{ user_.pk }}'
  58 + },
57 59 context: $email_block[0],
58 60 beforeSend: function(xhr, settings) {
59 61 xhr.setRequestHeader("X-CSRFToken", $.cookie('csrftoken'));
... ... @@ -77,7 +79,10 @@ $(function() {
77 79 $.ajax({
78 80 url: "{% url 'archive_email_view' %}",
79 81 type: 'update',
80   - data: { email: $('.email-address', $email_block).text() },
  82 + data: {
  83 + email: $('.email-address', $email_block).text(),
  84 + user: '{{ user_.pk }}'
  85 + },
81 86 beforeSend: function(xhr, settings) {
82 87 xhr.setRequestHeader("X-CSRFToken", $.cookie('csrftoken'));
83 88 }
... ... @@ -89,16 +94,8 @@ $(function() {
89 94 });
90 95  
91 96 // User feedbacks
92   - $('.panel-default').on('click', '.set-primary', function() {
93   - $('.set-primary').button('loading');
94   - });
95   -
96   - $('.panel-default').on('click', '.verify-email', function() {
97   - $('.verify-email').button('loading');
98   - });
99   -
100   - $('.panel-default').on('click', '.delete-email', function() {
101   - $('.delete-email').button('loading');
  97 + $('.panel-default').on('click', '.set-primary, .verify-email, .delete-email', function() {
  98 + $(this).button('loading');
102 99 });
103 100  
104 101 });
... ...
src/colab/custom_settings.py
... ... @@ -5,8 +5,6 @@ DEBUG = False
5 5  
6 6 TEMPLATE_DEBUG = False
7 7  
8   -TIME_ZONE = 'America/Sao_Paulo'
9   -
10 8 LANGUAGES = (
11 9 ('en', _('English')),
12 10 ('pt-br', _('Portuguese')),
... ... @@ -119,6 +117,7 @@ INSTALLED_APPS = INSTALLED_APPS + (
119 117 'proxy',
120 118 'search',
121 119 'badger',
  120 + 'tz',
122 121  
123 122 # Feedzilla and deps
124 123 'feedzilla',
... ... @@ -221,6 +220,7 @@ MIDDLEWARE_CLASSES = (
221 220 'django.middleware.clickjacking.XFrameOptionsMiddleware',
222 221 'django_mobile.middleware.MobileDetectionMiddleware',
223 222 'django_mobile.middleware.SetFlavourMiddleware',
  223 + 'tz.middleware.TimezoneMiddleware',
224 224 )
225 225  
226 226 # Add the django_browserid authentication backend.
... ...
src/colab/urls.py
... ... @@ -24,7 +24,7 @@ urlpatterns = patterns(&#39;&#39;,
24 24  
25 25 url(r'^planet/', include('feedzilla.urls')),
26 26  
27   - url(r'^browserid/', include('django_browserid.urls')),
  27 + url(r'', include('django_browserid.urls')),
28 28  
29 29 # Uncomment the next line to enable the admin:
30 30 url(r'^colab/admin/', include(admin.site.urls)),
... ...
src/locale/pt_BR/LC_MESSAGES/django.mo
No preview for this file type
src/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -7,7 +7,7 @@ msgid &quot;&quot;
7 7 msgstr ""
8 8 "Project-Id-Version: PACKAGE VERSION\n"
9 9 "Report-Msgid-Bugs-To: \n"
10   -"POT-Creation-Date: 2013-11-14 15:22-0200\n"
  10 +"POT-Creation-Date: 2013-11-21 10:48+0000\n"
11 11 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12 12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 13 "Language-Team: LANGUAGE <LL@li.org>\n"
... ... @@ -82,7 +82,7 @@ msgstr &quot;Informações pessoais&quot;
82 82 msgid "Subscribe to mail lists"
83 83 msgstr "Inscreva-se para listas de e-mails"
84 84  
85   -#: accounts/templates/accounts/user_create_form.html:60 templates/base.html:96
  85 +#: accounts/templates/accounts/user_create_form.html:60 templates/base.html:97
86 86 msgid "Register"
87 87 msgstr "Cadastre-se"
88 88  
... ... @@ -92,7 +92,7 @@ msgstr &quot;perfil&quot;
92 92  
93 93 #: accounts/templates/accounts/user_detail.html:26
94 94 msgid "list membership"
95   -msgstr "membros da lista"
  95 +msgstr "participação em listas"
96 96  
97 97 #: accounts/templates/accounts/user_detail.html:51
98 98 msgid "Twitter account"
... ... @@ -130,72 +130,72 @@ msgstr &quot;Últimas postagens&quot;
130 130 msgid "There are no posts by this user so far."
131 131 msgstr "Não há posts deste usuário até agora."
132 132  
133   -#: accounts/templates/accounts/user_detail.html:136
134   -msgid "Community inside participations"
135   -msgstr "Participações em comunidades internas"
  133 +#: accounts/templates/accounts/user_detail.html:136 badger/models.py:24
  134 +msgid "Contributions"
  135 +msgstr "Contribuições"
136 136  
137 137 #: accounts/templates/accounts/user_detail.html:141
138 138 msgid "No contributions of this user so far."
139 139 msgstr "Não há posts deste usuário até agora."
140 140  
141   -#: accounts/templates/accounts/user_update_form.html:63
  141 +#: accounts/templates/accounts/user_update_form.html:65
142 142 msgid "We sent a verification email to "
143 143 msgstr "Enviamos um email de verificação para "
144 144  
145   -#: accounts/templates/accounts/user_update_form.html:64
  145 +#: accounts/templates/accounts/user_update_form.html:66
146 146 msgid "Please follow the instructions in it."
147 147 msgstr "Por favor, siga as instruções."
148 148  
149   -#: accounts/templates/accounts/user_update_form.html:113
  149 +#: accounts/templates/accounts/user_update_form.html:110
150 150 msgid "profile information"
151 151 msgstr "informações do perfil"
152 152  
153   -#: accounts/templates/accounts/user_update_form.html:118
  153 +#: accounts/templates/accounts/user_update_form.html:115
154 154 msgid "Change your avatar at Gravatar.com"
155 155 msgstr "Troque seu avatar em Gravatar.com"
156 156  
157   -#: accounts/templates/accounts/user_update_form.html:145 search/utils.py:8
  157 +#: accounts/templates/accounts/user_update_form.html:142 search/utils.py:8
158 158 msgid "Emails"
159 159 msgstr "E-mails"
160 160  
161   -#: accounts/templates/accounts/user_update_form.html:154
  161 +#: accounts/templates/accounts/user_update_form.html:151
162 162 msgid "Primary"
163   -msgstr "Primários"
  163 +msgstr "Primário"
164 164  
165   -#: accounts/templates/accounts/user_update_form.html:157
  165 +#: accounts/templates/accounts/user_update_form.html:154
166 166 msgid "Setting..."
167 167 msgstr "Definindo..."
168 168  
169   -#: accounts/templates/accounts/user_update_form.html:157
  169 +#: accounts/templates/accounts/user_update_form.html:154
170 170 msgid "Set as Primary"
171 171 msgstr "Definir como Primário"
172 172  
173   -#: accounts/templates/accounts/user_update_form.html:158
  173 +#: accounts/templates/accounts/user_update_form.html:155
174 174 msgid "Deleting..."
175 175 msgstr "Deletando..."
176 176  
177   -#: accounts/templates/accounts/user_update_form.html:158
178   -#: accounts/templates/accounts/user_update_form.html:170
  177 +#: accounts/templates/accounts/user_update_form.html:155
  178 +#: accounts/templates/accounts/user_update_form.html:167
179 179 msgid "Delete"
180 180 msgstr "Apagar"
181 181  
182   -#: accounts/templates/accounts/user_update_form.html:169
  182 +#: accounts/templates/accounts/user_update_form.html:166
183 183 msgid "Sending verification..."
184 184 msgstr "Enviando verificação..."
185 185  
186   -#: accounts/templates/accounts/user_update_form.html:169
  186 +#: accounts/templates/accounts/user_update_form.html:166
187 187 msgid "Verify"
188 188 msgstr "Verificar"
189 189  
190   -#: accounts/templates/accounts/user_update_form.html:177
  190 +#: accounts/templates/accounts/user_update_form.html:174
191 191 msgid "Add another email address:"
192 192 msgstr "Adicionar outro endereço de e-mail"
193 193  
194   -#: accounts/templates/accounts/user_update_form.html:180
  194 +#: accounts/templates/accounts/user_update_form.html:177
195 195 msgid "Add"
196 196 msgstr "Adicionar"
197 197  
198   -#: accounts/templates/accounts/user_update_form.html:187
  198 +#: accounts/templates/accounts/user_update_form.html:184
199 199 msgid "Update"
200 200 msgstr "Atualizar"
201 201  
... ... @@ -223,14 +223,10 @@ msgstr &quot;Automaticamente&quot;
223 223 msgid "Manual"
224 224 msgstr "Manual"
225 225  
226   -#: badger/models.py:23 super_archives/models.py:262
  226 +#: badger/models.py:23 super_archives/models.py:258
227 227 msgid "Messages"
228 228 msgstr "Mensagens"
229 229  
230   -#: badger/models.py:24
231   -msgid "Contributions"
232   -msgstr "Contribuições"
233   -
234 230 #: badger/models.py:25
235 231 msgid "Wikis"
236 232 msgstr "Wikis"
... ... @@ -280,51 +276,51 @@ msgstr &quot;Ordem&quot;
280 276 msgid "Badge"
281 277 msgstr "Medalha"
282 278  
283   -#: colab/custom_settings.py:11
  279 +#: colab/custom_settings.py:9
284 280 msgid "English"
285 281 msgstr "Inglês"
286 282  
287   -#: colab/custom_settings.py:12
  283 +#: colab/custom_settings.py:10
288 284 msgid "Portuguese"
289 285 msgstr "Português"
290 286  
291   -#: colab/custom_settings.py:13
  287 +#: colab/custom_settings.py:11
292 288 msgid "Spanish"
293 289 msgstr "Espanhol"
294 290  
295   -#: colab/custom_settings.py:36
  291 +#: colab/custom_settings.py:34
296 292 msgid "Recent activity"
297 293 msgstr "Atividade recente"
298 294  
299   -#: colab/custom_settings.py:40
  295 +#: colab/custom_settings.py:38
300 296 msgid "Relevance"
301 297 msgstr "Relevância"
302 298  
303   -#: colab/custom_settings.py:48
  299 +#: colab/custom_settings.py:46
304 300 msgid "Document"
305 301 msgstr "Documento"
306 302  
307   -#: colab/custom_settings.py:50
  303 +#: colab/custom_settings.py:48
308 304 msgid "Presentation"
309 305 msgstr "Apresentação"
310 306  
311   -#: colab/custom_settings.py:51
  307 +#: colab/custom_settings.py:49
312 308 msgid "Text"
313 309 msgstr "Texto"
314 310  
315   -#: colab/custom_settings.py:52 search/utils.py:9
  311 +#: colab/custom_settings.py:50 search/utils.py:9
316 312 msgid "Code"
317 313 msgstr "Código"
318 314  
319   -#: colab/custom_settings.py:54
  315 +#: colab/custom_settings.py:52
320 316 msgid "Compressed"
321 317 msgstr "Compactado"
322 318  
323   -#: colab/custom_settings.py:55
  319 +#: colab/custom_settings.py:53
324 320 msgid "Image"
325 321 msgstr "Imagem"
326 322  
327   -#: colab/custom_settings.py:57
  323 +#: colab/custom_settings.py:55
328 324 msgid "Spreadsheet"
329 325 msgstr "Planilha"
330 326  
... ... @@ -348,7 +344,7 @@ msgstr &quot;em&quot;
348 344 msgid "Read original"
349 345 msgstr "Leia o original"
350 346  
351   -#: planet/templates/feedzilla/base.html:5 templates/base.html:74
  347 +#: planet/templates/feedzilla/base.html:5 templates/base.html:75
352 348 msgid "Planet"
353 349 msgstr ""
354 350  
... ... @@ -363,7 +359,7 @@ msgstr &quot;Blogs de origem&quot;
363 359 #: planet/templates/feedzilla/base.html:22
364 360 #: planet/templates/feedzilla/submit_blog.html:5
365 361 msgid "Submit a blog"
366   -msgstr "Enviar um blog"
  362 +msgstr "Sugerir um blog"
367 363  
368 364 #: planet/templates/feedzilla/index.html:10
369 365 msgid "There is no RSS registered"
... ... @@ -413,8 +409,8 @@ msgstr &quot;Discussões Mais Relevantes&quot;
413 409 msgid "Latest collaborations"
414 410 msgstr "Últimas colaborações"
415 411  
416   -#: search/forms.py:16 search/templates/search/search.html:39
417   -#: templates/base.html:90
  412 +#: search/forms.py:16 search/templates/search/search.html:41
  413 +#: templates/base.html:91
418 414 msgid "Search"
419 415 msgstr "Busca"
420 416  
... ... @@ -539,24 +535,28 @@ msgstr &quot;Usuário&quot;
539 535 msgid "Attachment"
540 536 msgstr "Anexo"
541 537  
542   -#: search/templates/search/search.html:44
  538 +#: search/templates/search/search.html:4
  539 +msgid "search"
  540 +msgstr "busca"
  541 +
  542 +#: search/templates/search/search.html:46
543 543 msgid "documents found"
544 544 msgstr "documentos encontrados"
545 545  
546   -#: search/templates/search/search.html:55
  546 +#: search/templates/search/search.html:57
547 547 msgid "Search here"
548 548 msgstr "Pesquise aqui"
549 549  
550   -#: search/templates/search/search.html:67
551   -#: search/templates/search/search.html:77
  550 +#: search/templates/search/search.html:69
  551 +#: search/templates/search/search.html:79
552 552 msgid "Filters"
553 553 msgstr "Filtros"
554 554  
555   -#: search/templates/search/search.html:98
  555 +#: search/templates/search/search.html:100
556 556 msgid "No results for your search."
557 557 msgstr "Não há resultados para sua busca."
558 558  
559   -#: search/templates/search/search.html:100
  559 +#: search/templates/search/search.html:102
560 560 msgid "You are searching for"
561 561 msgstr "Você está procurando por"
562 562  
... ... @@ -617,51 +617,51 @@ msgstr &quot;Conjunto de mensagens&quot;
617 617 msgid "Threads"
618 618 msgstr "Conjuntos de mensagens"
619 619  
620   -#: super_archives/models.py:246
  620 +#: super_archives/models.py:242
621 621 msgid "Subject"
622 622 msgstr "Assunto"
623 623  
624   -#: super_archives/models.py:247
  624 +#: super_archives/models.py:243
625 625 msgid "Please enter a message subject"
626 626 msgstr "Por favor, digite o assunto da mensagem"
627 627  
628   -#: super_archives/models.py:250
  628 +#: super_archives/models.py:246
629 629 msgid "Message body"
630 630 msgstr "Corpo da mensagem"
631 631  
632   -#: super_archives/models.py:251
  632 +#: super_archives/models.py:247
633 633 msgid "Please enter a message body"
634 634 msgstr "Por favor, digite o corpo da mensagem"
635 635  
636   -#: super_archives/models.py:261
  636 +#: super_archives/models.py:257
637 637 msgid "Message"
638 638 msgstr "Mensagem"
639 639  
640   -#: super_archives/views.py:89
  640 +#: super_archives/views.py:90
641 641 msgid "Error trying to connect to Mailman API"
642 642 msgstr "Erro na conexão com a API do Mailman"
643 643  
644   -#: super_archives/views.py:92
  644 +#: super_archives/views.py:93
645 645 msgid "Timeout trying to connect to Mailman API"
646 646 msgstr "Tempo de espera esgotado na conexão com a API do Mailman"
647 647  
648   -#: super_archives/views.py:95
  648 +#: super_archives/views.py:96
649 649 msgid ""
650 650 "Your message was sent. It may take some minutes before it's delivered. Why "
651   -"don't you breath some fresh air in the meanwhile."
  651 +"don't you breath some fresh air in the meanwhile?"
652 652 msgstr ""
653 653 "Sua mensagem foi enviada. Pode levar alguns minutos antes de ser entregue. "
654   -"Por quê você respira um ar fresco enquanto isso."
  654 +"Por quê você respira um ar fresco enquanto isso?"
655 655  
656   -#: super_archives/views.py:103
  656 +#: super_archives/views.py:104
657 657 msgid "You cannot send an empty email"
658 658 msgstr "Você não pode enviar um e-mail vazio"
659 659  
660   -#: super_archives/views.py:105
  660 +#: super_archives/views.py:106
661 661 msgid "Mailing list does not exist"
662 662 msgstr "Lista de e-mail não existe"
663 663  
664   -#: super_archives/views.py:107
  664 +#: super_archives/views.py:108
665 665 msgid "Unknown error trying to connect to Mailman API"
666 666 msgstr "Erro desconhecido na conexão com a API do Mailman"
667 667  
... ... @@ -685,73 +685,73 @@ msgstr &quot;&quot;
685 685 msgid "Email address verified!"
686 686 msgstr "Endereço de e-mail verificado!"
687 687  
688   -#: super_archives/templates/message-preview.html:34
  688 +#: super_archives/templates/message-preview.html:42
689 689 msgid "by"
690 690 msgstr "por"
691 691  
692   -#: super_archives/templates/message-preview.html:49
693   -#: super_archives/templates/message-thread.html:155
  692 +#: super_archives/templates/message-preview.html:57
  693 +#: super_archives/templates/message-thread.html:157
694 694 msgid "ago"
695 695 msgstr "atrás"
696 696  
697 697 #: super_archives/templates/message-thread.html:33
698 698 msgid "You must login before voting."
699   -msgstr "Você deve está logado antes de votar."
  699 +msgstr "Você deve estar logado antes de votar."
700 700  
701   -#: super_archives/templates/message-thread.html:126
  701 +#: super_archives/templates/message-thread.html:128
702 702 msgid "Order by"
703 703 msgstr "Ordernar por"
704 704  
705   -#: super_archives/templates/message-thread.html:130
  705 +#: super_archives/templates/message-thread.html:132
706 706 msgid "Votes"
707 707 msgstr "Votos"
708 708  
709   -#: super_archives/templates/message-thread.html:134
  709 +#: super_archives/templates/message-thread.html:136
710 710 msgid "Date"
711 711 msgstr "Data"
712 712  
713   -#: super_archives/templates/message-thread.html:139
  713 +#: super_archives/templates/message-thread.html:141
714 714 msgid "Related:"
715 715 msgstr "Relacionado:"
716 716  
717   -#: super_archives/templates/message-thread.html:150
  717 +#: super_archives/templates/message-thread.html:152
718 718 msgid "Statistics:"
719 719 msgstr "Estátisticas:"
720 720  
721   -#: super_archives/templates/message-thread.html:154
  721 +#: super_archives/templates/message-thread.html:156
722 722 msgid "started at"
723 723 msgstr "começou às"
724 724  
725   -#: super_archives/templates/message-thread.html:160
  725 +#: super_archives/templates/message-thread.html:162
726 726 msgid "viewed"
727 727 msgstr "visualizado"
728 728  
729   -#: super_archives/templates/message-thread.html:161
730   -#: super_archives/templates/message-thread.html:166
731   -#: super_archives/templates/message-thread.html:171
  729 +#: super_archives/templates/message-thread.html:163
  730 +#: super_archives/templates/message-thread.html:168
  731 +#: super_archives/templates/message-thread.html:173
732 732 msgid "times"
733 733 msgstr "vezes"
734 734  
735   -#: super_archives/templates/message-thread.html:165
  735 +#: super_archives/templates/message-thread.html:167
736 736 msgid "answered"
737 737 msgstr "respondido"
738 738  
739   -#: super_archives/templates/message-thread.html:170
  739 +#: super_archives/templates/message-thread.html:172
740 740 msgid "voted"
741 741 msgstr "votado"
742 742  
743   -#: super_archives/templates/message-thread.html:176
  743 +#: super_archives/templates/message-thread.html:178
744 744 msgid "Tags:"
745 745 msgstr "Etiquetas:"
746 746  
747 747 #: super_archives/templates/superarchives/thread-dashboard.html:5
748   -#: templates/base.html:71
  748 +#: templates/base.html:72
749 749 msgid "Discussions"
750 750 msgstr "Discussões"
751 751  
752 752 #: super_archives/templates/superarchives/thread-dashboard.html:15
753 753 msgid "latest"
754   -msgstr "mais recente"
  754 +msgstr "mais recentes"
755 755  
756 756 #: super_archives/templates/superarchives/thread-dashboard.html:23
757 757 #: super_archives/templates/superarchives/thread-dashboard.html:37
... ... @@ -760,7 +760,7 @@ msgstr &quot;mais...&quot;
760 760  
761 761 #: super_archives/templates/superarchives/thread-dashboard.html:29
762 762 msgid "most relevant"
763   -msgstr "mais relevante"
  763 +msgstr "mais relevantes"
764 764  
765 765 #: super_archives/templates/superarchives/emails/email_verification.txt:2
766 766 #, python-format
... ... @@ -812,55 +812,55 @@ msgstr &quot;Inscrição na lista de e-mail&quot;
812 812 msgid "Not found. Keep searching! :)"
813 813 msgstr "Não encontrado. Continue procurando! :)"
814 814  
815   -#: templates/500.html:5
  815 +#: templates/500.html:2
816 816 msgid "Ooopz... something went wrong!"
817 817 msgstr "Opa... algo saiu errado!"
818 818  
819   -#: templates/base.html:77
  819 +#: templates/base.html:78
820 820 msgid "Contribute"
821 821 msgstr "Contribua"
822 822  
823   -#: templates/base.html:81
  823 +#: templates/base.html:82
824 824 msgid "New Ticket"
825 825 msgstr "Novo Tíquete"
826 826  
827   -#: templates/base.html:83
  827 +#: templates/base.html:84
828 828 msgid "Timeline"
829 829 msgstr "Histórico"
830 830  
831   -#: templates/base.html:84
  831 +#: templates/base.html:85
832 832 msgid "Roadmap"
833 833 msgstr "Planejamento"
834 834  
835   -#: templates/base.html:85
  835 +#: templates/base.html:86
836 836 msgid "Browse Source"
837 837 msgstr "Ver Código"
838 838  
839   -#: templates/base.html:86
  839 +#: templates/base.html:87
840 840 msgid "View Tickets"
841 841 msgstr "Visualizar Tiquetes"
842 842  
843   -#: templates/base.html:110
  843 +#: templates/base.html:111
844 844 msgid "My Profile"
845 845 msgstr "Meu Perfil"
846 846  
847   -#: templates/base.html:122 templates/base.html.py:125
  847 +#: templates/base.html:123 templates/base.html.py:126
848 848 msgid "Search here..."
849 849 msgstr "Pesquise aqui..."
850 850  
851   -#: templates/base.html:138
  851 +#: templates/base.html:139
852 852 msgid "The login has failed. Please, try again."
853 853 msgstr "O login falhou. Por favor, tente novamente."
854 854  
855   -#: templates/base.html:163
  855 +#: templates/base.html:164
856 856 msgid "Last email imported at"
857 857 msgstr "Último e-mail importado em"
858 858  
859   -#: templates/base.html:168
  859 +#: templates/base.html:169
860 860 msgid "The contents of this site is published under license"
861 861 msgstr "O conteúdo deste site está publicado sob a licença"
862 862  
863   -#: templates/base.html:170
  863 +#: templates/base.html:171
864 864 msgid "Creative Commons - attribution, non-commercial"
865 865 msgstr "Creative Commons - atribuição e não-comercial"
866 866  
... ... @@ -908,6 +908,9 @@ msgstr &quot;Vontade de ajudar&quot;
908 908 msgid "INTERLEGIS COMMUNITIES"
909 909 msgstr "COMUNIDADES INTERLEGIS"
910 910  
  911 +#~ msgid "Community inside participations"
  912 +#~ msgstr "Participações internas da comunidade"
  913 +
911 914 #~ msgid "documents found in"
912 915 #~ msgstr "documentos encontrados em"
913 916  
... ...
src/proxy/diazo/trac.xml
... ... @@ -5,6 +5,7 @@
5 5  
6 6 <replace css:theme="#trac-css" content="//head/link" />
7 7 <replace css:theme="#trac-js" content="//head/script" />
  8 + <replace theme="//head/title" content="//head/title" />
8 9  
9 10 <before css:theme-children="#main-content" css:content="#main" />
10 11  
... ...
src/proxy/urls.py
... ... @@ -6,7 +6,7 @@ from .views import TracProxyView, JenkinsProxyView
6 6  
7 7 urlpatterns = patterns('',
8 8 # Trac URLs
9   - url(r'^(?P<path>(?:admin|wiki|changeset|newticket|ticket|chrome|timeline|roadmap|browser|report|tags|query|about|prefs|log|attachment|raw-attachment|diff).*)$',
  9 + url(r'^(?P<path>(?:admin|wiki|changeset|newticket|ticket|chrome|timeline|roadmap|browser|report|tags|query|about|prefs|log|attachment|raw-attachment|diff|milestone).*)$',
10 10 TracProxyView.as_view()),
11 11  
12 12 # Jenkins URLs
... ...
src/proxy/views.py
... ... @@ -36,7 +36,10 @@ class TracProxyView(HitCounterViewMixin, ProxyView):
36 36 except (Ticket.DoesNotExist, ValueError):
37 37 return None
38 38 elif self.request.path_info.startswith('/changeset'):
39   - changeset, repo = self.request.path_info.split('/')[2:4]
  39 + try:
  40 + changeset, repo = self.request.path_info.split('/')[2:4]
  41 + except ValueError:
  42 + return None
40 43 try:
41 44 obj = Revision.objects.get(rev=changeset,
42 45 repository_name=repo)
... ...
src/search/templates/search/search.html
1 1 {% extends "base.html" %}
2 2 {% load i18n highlight superarchives %}
3 3  
  4 +{% block title %}{% trans 'search'|title %}{% endblock %}
  5 +
4 6 {% block head_js %}
5 7 <script type="text/javascript" src="{{ STATIC_URL }}third-party/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
6 8 {% if use_language %}
... ...
src/static/css/screen.css
... ... @@ -406,5 +406,10 @@ span.highlighted {
406 406  
407 407 /* paginator icon */
408 408 .small-icon {
409   - font-size: 10px;
  409 + font-size: 10px;
  410 +}
  411 +
  412 +/* Subscribe list */
  413 +.vcard .label {
  414 + line-height: 2;
410 415 }
... ...
src/static/img/favicon.ico
No preview for this file type
src/static/img/interlegis.ico 0 → 100644
No preview for this file type
src/super_archives/management/commands/import_emails.py
... ... @@ -145,6 +145,7 @@ class Command(BaseCommand, object):
145 145 self.THREAD_CACHE[subject_slug][mailinglist.id] = thread
146 146  
147 147 thread.latest_message = email
  148 + thread.update_keywords()
148 149 thread.save()
149 150 return thread
150 151  
... ... @@ -206,6 +207,7 @@ class Command(BaseCommand, object):
206 207 )
207 208 email.thread = self.get_thread(email, mailinglist)
208 209 email.save()
  210 + email.update_blocks()
209 211  
210 212 @transaction.commit_manually
211 213 def import_emails(self, archives_path, all, exclude_lists=None):
... ...
src/super_archives/management/commands/update_blocks.py 0 → 100644
... ... @@ -0,0 +1,12 @@
  1 +#!/usr/bin/env python
  2 +
  3 +from django.core.management.base import BaseCommand
  4 +from super_archives.models import Message
  5 +
  6 +
  7 +class Command(BaseCommand):
  8 + help = "Update message blocks (used to hide the reply part messages)"
  9 +
  10 + def handle(self, *args, **kwargs):
  11 + for message in Message.objects.iterator():
  12 + message.update_blocks()
... ...
src/super_archives/management/commands/update_keywords.py 0 → 100644
... ... @@ -0,0 +1,12 @@
  1 +#!/usr/bin/env python
  2 +
  3 +from django.core.management.base import BaseCommand, CommandError
  4 +from super_archives.models import Thread
  5 +
  6 +
  7 +class Command(BaseCommand):
  8 + help = "Update keywords used in tag cloud and related thread"
  9 +
  10 + def handle(self, *args, **kwargs):
  11 + for thread in Thread.objects.iterator():
  12 + thread.update_keywords()
... ...
src/super_archives/models.py
... ... @@ -166,10 +166,6 @@ class Thread(models.Model, HitCounterModelMixin):
166 166  
167 167 return tuple()
168 168  
169   - def save(self, *args, **kwargs):
170   - super(Thread, self).save(*args, **kwargs)
171   - self.update_keywords()
172   -
173 169 def __unicode__(self):
174 170 return '%s - %s (%s)' % (self.id,
175 171 self.subject_token,
... ...
src/super_archives/search_indexes.py
... ... @@ -12,12 +12,12 @@ class ThreadIndex(BaseIndex, indexes.Indexable):
12 12 title = indexes.CharField(model_attr='latest_message__subject_clean')
13 13 description = indexes.CharField(use_template=True)
14 14 latest_description = indexes.CharField(
15   - model_attr='latest_message__body',
  15 + model_attr='latest_message__description',
16 16 indexed=False,
17 17 )
18 18 created = indexes.DateTimeField()
19 19 modified = indexes.DateTimeField(
20   - model_attr='latest_message__received_time'
  20 + model_attr='latest_message__modified'
21 21 )
22 22 tag = indexes.CharField(model_attr='mailinglist__name')
23 23 collaborators = indexes.CharField(use_template=True, stored=False)
... ... @@ -33,12 +33,6 @@ class ThreadIndex(BaseIndex, indexes.Indexable):
33 33 def get_updated_field(self):
34 34 return 'latest_message__received_time'
35 35  
36   - def prepare_author(self, obj):
37   - from_address = obj.message_set.first().from_address
38   - if from_address.user:
39   - return from_address.user.username
40   - return None
41   -
42 36 def prepare_fullname(self, obj):
43 37 return obj.message_set.first().from_address.get_full_name()
44 38  
... ... @@ -52,6 +46,9 @@ class ThreadIndex(BaseIndex, indexes.Indexable):
52 46 from_address.user.username,
53 47 )
54 48  
  49 + def prepare_author(self, obj):
  50 + return obj.latest_message.author
  51 +
55 52 def prepare_author_url(self, obj):
56 53 first_message = obj.message_set.first()
57 54 if first_message.from_address.user:
... ...
src/super_archives/templates/message-preview.html
1   -{% load i18n %}
2   -{% load highlight %}
  1 +{% load i18n tz highlight %}
3 2  
4 3 <li class="preview-message">
5 4 <span class="glyphicon glyphicon-{{ result.icon_name }}" title="{{ result.type }}"></span>
... ... @@ -11,7 +10,7 @@
11 10 {% endif %}
12 11  
13 12 {% if result.title %}
14   - <a href="{{ result.url }}" {% if result.description %}title="{{ result.description|escape|truncatechars:200 }}"{% endif %}>
  13 + <a href="{{ result.url }}" {% if result.latest_description %}title="{{ result.latest_description|escape|truncatechars:150 }}"{% elif result.description %}title="{{ result.description|escape|truncatechars:150 }}"{% endif %}>
15 14 <span class="subject">
16 15 <!-- a striptags filter was raising an error here because using with highlight -->
17 16 {% if query %}
... ... @@ -25,7 +24,16 @@
25 24  
26 25 {% if result.description %}
27 26 <!-- a striptags filter was raising an error here because using with highlight -->
28   - <span class="quiet">- {% if query %}{% highlight result.description with query max_length "150" %}{% else %}{{ result.description }}{% endif %}</span>
  27 + <span class="quiet">- {% if query %}
  28 + {% highlight result.description with query max_length "150" %}
  29 + {% else %}
  30 + {% if result.latest_description %}
  31 + {{ result.latest_description|escape|truncatechars:150 }}
  32 + {% elif result.description %}
  33 + {{ result.description|escape|truncatechars:150 }}
  34 + {% endif %}
  35 + {% endif %}
  36 + </span>
29 37 {% endif %}
30 38  
31 39 {% if result.fullname or result.modified %}
... ... @@ -46,7 +54,7 @@
46 54 </span>
47 55 {% endif %}
48 56 {% if result.modified %}
49   - <span class="pull-right">{{ result.modified|timesince }} {% trans "ago" %}</span>
  57 + <span class="pull-right">{{ result.modified|localtime|timesince }} {% trans "ago" %}</span>
50 58 {% endif %}
51 59 </div>
52 60 {% endif %}
... ...
src/super_archives/templates/message-thread.html
1 1 {% extends "base.html" %}
2   -{% load i18n superarchives %}
  2 +{% load i18n tz superarchives %}
3 3  
4 4 {% trans "Anonymous" as anonymous %}
5 5  
... ... @@ -95,7 +95,9 @@
95 95 });
96 96  
97 97 $('.vote.btn', this).on('click', vote);
98   - $('.reply.btn', this).on('click', focus_reply);
  98 + {% if user.is_active %}
  99 + $('.reply.btn', this).on('click', focus_reply);
  100 + {% endif %}
99 101 });
100 102  
101 103 </script>
... ... @@ -152,7 +154,7 @@
152 154 <li>
153 155 <span class="glyphicon glyphicon-chevron-right"></span>
154 156 {% trans "started at" %}
155   - <h5>{{ first_msg.received_time|timesince }} {% trans "ago" %}</h5>
  157 + <h5>{{ first_msg.received_time|localtime|timesince }} {% trans "ago" %}</h5>
156 158 </li>
157 159  
158 160 <li>
... ...
src/super_archives/templates/superarchives/includes/message.html
1   -{% load gravatar superarchives i18n %}
  1 +{% load gravatar superarchives tz i18n %}
2 2 <li>
3 3 {% spaceless %}
4 4 <div class="email-message" id="msg-{% firstof email.id 'reply' %}">
... ... @@ -19,7 +19,7 @@
19 19 <div class="col-lg-6 col-md-6 col-sm-6">
20 20 <div class="pull-right text-right">
21 21 <span class="date">
22   - {{ email.received_time|date:'DATETIME_FORMAT' }}
  22 + {{ email.received_time|localtime|date:'DATETIME_FORMAT' }}
23 23 </span>
24 24  
25 25 <div class="btn-group">
... ...
src/super_archives/utils/email.py
... ... @@ -31,4 +31,4 @@ def send_email_lists(user, mailing_lists):
31 31 subscribe_addr = list_name + '-subscribe@listas.interlegis.gov.br'
32 32 to.append(subscribe_addr)
33 33  
34   - send_mail(subject, '', from_, to)
  34 + mail.send_mail(subject, '', from_, to)
... ...
src/super_archives/views.py
... ... @@ -16,7 +16,7 @@ from django.utils.translation import ugettext as _
16 16 from django.core.exceptions import ObjectDoesNotExist
17 17 from django.utils.decorators import method_decorator
18 18 from django.contrib.auth.decorators import login_required
19   -from django.shortcuts import render, redirect
  19 +from django.shortcuts import render, redirect, get_object_or_404
20 20  
21 21 from haystack.query import SearchQuerySet
22 22  
... ... @@ -30,8 +30,8 @@ class ThreadView(View):
30 30  
31 31 def get(self, request, mailinglist, thread_token):
32 32  
33   - thread = Thread.objects.get(subject_token=thread_token,
34   - mailinglist__name=mailinglist)
  33 + thread = get_object_or_404(Thread, subject_token=thread_token,
  34 + mailinglist__name=mailinglist)
35 35 thread.hit(request)
36 36  
37 37 try:
... ... @@ -73,11 +73,12 @@ class ThreadView(View):
73 73 except Thread.DoesNotExist:
74 74 raise http.Http404
75 75  
76   - data = {}
77   - data['from'] = '{} <{}>'.format(request.user.get_full_name(),
78   - request.user.email)
79   - data['subject'] = thread.message_set.first().subject_clean
80   - data['body'] = request.POST.get('emailbody', '').strip()
  76 + data = {
  77 + 'email_from': request.user.email,
  78 + 'name_from': request.user.get_full_name(),
  79 + 'subject': thread.message_set.first().subject_clean,
  80 + 'body': request.POST.get('emailbody', '').strip(),
  81 + }
81 82  
82 83 url = urlparse.urljoin(settings.MAILMAN_API_URL, mailinglist + '/sendmail')
83 84  
... ... @@ -95,7 +96,7 @@ class ThreadView(View):
95 96 messages.success(request, _("Your message was sent. It may take "
96 97 "some minutes before it's delivered. "
97 98 "Why don't you breath some fresh air "
98   - "in the meanwhile."))
  99 + "in the meanwhile?"))
99 100 else:
100 101 if not error_msg:
101 102 if resp is not None:
... ... @@ -137,8 +138,7 @@ class EmailView(View):
137 138 """Validate an email with the given key"""
138 139  
139 140 try:
140   - email_val = EmailAddressValidation.objects.get(validation_key=key,
141   - user__pk=request.user.pk)
  141 + email_val = EmailAddressValidation.objects.get(validation_key=key)
142 142 except EmailAddressValidation.DoesNotExist:
143 143 messages.error(request, _('The email address you are trying to '
144 144 'verify either has already been verified '
... ... @@ -170,12 +170,13 @@ class EmailView(View):
170 170 """Create new email address that will wait for validation"""
171 171  
172 172 email = request.POST.get('email')
  173 + user_id = request.POST.get('user')
173 174 if not email:
174 175 return http.HttpResponseBadRequest()
175 176  
176 177 try:
177 178 EmailAddressValidation.objects.create(address=email,
178   - user=request.user)
  179 + user_id=user_id)
179 180 except IntegrityError:
180 181 # 409 Conflict
181 182 # duplicated entries
... ... @@ -190,13 +191,14 @@ class EmailView(View):
190 191  
191 192 request.DELETE = http.QueryDict(request.body)
192 193 email_addr = request.DELETE.get('email')
  194 + user_id = request.DELETE.get('user')
193 195  
194 196 if not email_addr:
195 197 return http.HttpResponseBadRequest()
196 198  
197 199 try:
198 200 email = EmailAddressValidation.objects.get(address=email_addr,
199   - user=request.user)
  201 + user_id=user_id)
200 202 except EmailAddressValidation.DoesNotExist:
201 203 pass
202 204 else:
... ... @@ -205,7 +207,7 @@ class EmailView(View):
205 207  
206 208 try:
207 209 email = EmailAddress.objects.get(address=email_addr,
208   - user=request.user)
  210 + user_id=user_id)
209 211 except EmailAddress.DoesNotExist:
210 212 raise http.Http404
211 213  
... ... @@ -220,17 +222,18 @@ class EmailView(View):
220 222 request.UPDATE = http.QueryDict(request.body)
221 223  
222 224 email_addr = request.UPDATE.get('email')
  225 + user_id = request.UPDATE.get('user')
223 226 if not email_addr:
224 227 return http.HttpResponseBadRequest()
225 228  
226 229 try:
227 230 email = EmailAddress.objects.get(address=email_addr,
228   - user=request.user)
  231 + user_id=user_id)
229 232 except EmailAddress.DoesNotExist:
230 233 raise http.Http404
231 234  
232   - request.user.email = email_addr
233   - request.user.save()
  235 + email.user.email = email_addr
  236 + email.user.save()
234 237 return http.HttpResponse(status=204)
235 238  
236 239  
... ... @@ -240,14 +243,15 @@ class EmailValidationView(View):
240 243  
241 244 def post(self, request):
242 245 email_addr = request.POST.get('email')
  246 + user_id = request.POST.get('user')
243 247 try:
244 248 email = EmailAddressValidation.objects.get(address=email_addr,
245   - user=request.user)
  249 + user_id=user_id)
246 250 except http.DoesNotExist:
247 251 raise http.Http404
248 252  
249 253 try:
250   - send_verification_email(email_addr, request.user,
  254 + send_verification_email(email_addr, email.user,
251 255 email.validation_key)
252 256 except smtplib.SMTPException:
253 257 logging.exception('Error sending validation email')
... ...
src/templates/500.html
1   -{% extends "base.html" %}
2 1 {% load i18n %}
3   -
4   -{% block main-content %}
5   - <h1>{% trans "Ooopz... something went wrong!" %}</h1>
6   -{% endblock %}
7   -
8   -{% block footer %}{% endblock %}
  2 +<h1>{% trans "Ooopz... something went wrong!" %}</h1>
  3 +<h2>Internal Server Error</h2>
... ...
src/templates/base.html
... ... @@ -5,19 +5,22 @@
5 5 {% block head %}
6 6 <meta charset="UTF-8" />
7 7 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  8 + <title>Colab - {% block title %}Colab{% endblock %}</title>
  9 +
  10 + <link rel="shortcut icon" type="image/x-icon" href="{{ STATIC_URL }}img/interlegis.ico">
8 11  
9 12 <link rel="stylesheet" href="{{ STATIC_URL }}third-party/bootstrap/css/bootstrap.min.css" type="text/css" media="screen, projection" />
10 13  
11 14 <link rel="stylesheet"
12 15 href="{{ STATIC_URL }}third-party/font-awesome/css/font-awesome.min.css"
13   - type="text/css" media="screen" charset="utf-8"/>
  16 + type="text/css" media="screen" />
14 17  
15 18 {% if not is_mobile %}
16 19 {% conversejs_static %}
17 20 {% endif %}
18 21  
19 22 <link rel="stylesheet" href="{{ STATIC_URL }}css/screen.css"
20   - type="text/css" media="screen" charset="utf-8"/>
  23 + type="text/css" media="screen" />
21 24  
22 25 <script type="text/javascript" src="{{ STATIC_URL }}third-party/jquery-2.0.3.min.js"></script>
23 26 <script type="text/javascript" src="{{ STATIC_URL }}third-party/jquery.debouncedresize.js"></script>
... ... @@ -47,8 +50,6 @@
47 50 </head>
48 51  
49 52 <body class="container">
50   - {% browserid_info %}
51   -
52 53  
53 54 {% block navbar %}
54 55 <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
... ... @@ -94,7 +95,7 @@
94 95 <ul class="nav navbar-nav navbar-right">
95 96 {% if not user.is_authenticated %}
96 97 <li><a href="{% url 'signup' %}">{% trans "Register" %}</a></li>
97   - <li>{% browserid_login text='Login' next=request.path %}</li>
  98 + <li>{% browserid_login text='Login' %}</li>
98 99 {% else %}
99 100 <li id="user-menu" class="dropdown">
100 101 <a href="#" class="dropdown-toggle user" data-toggle="dropdown">{% gravatar user.email 40 %} <b class="caret"></b>&nbsp;&nbsp;</a>
... ... @@ -179,6 +180,7 @@
179 180 {% conversejs_initialize %}
180 181 {% endif %}
181 182  
  183 + {% include "tz/set_utc_offset.html" %}
182 184 {% browserid_js %}
183 185 </body>
184 186 </html>
... ...
src/templates/home.html
... ... @@ -26,7 +26,7 @@
26 26 {% endfor %}
27 27 </ul>
28 28 <a class="column-align"
29   - href="{% url 'haystack_search' %}?order=latest&type=thread">
  29 + href="{% url 'haystack_search' %}?order=latest">
30 30 {% trans "View more collaborations..." %}
31 31 </a>
32 32 <div>&nbsp;</div>
... ... @@ -72,7 +72,7 @@
72 72 {% include "message-preview.html" with result=thread.latest_message %}
73 73 {% endfor %}
74 74 </ul>
75   - <a href="{% url 'haystack_search' %}?type=thread&order=latest">
  75 + <a href="{% url 'haystack_search' %}?type=thread&amp;order=latest">
76 76 {% trans "View more discussions..." %}
77 77 </a>
78 78 <div>&nbsp;</div>
... ...
src/templates/includes/big_header.html
... ... @@ -2,7 +2,7 @@
2 2  
3 3 <div class="row hidden-xs hidden-sm">
4 4 <div class="col-lg-2 col-lg-offset-5 text-center">
5   - <img src="{{ STATIC_URL }}img/logo.png" />
  5 + <img src="{{ STATIC_URL }}img/logo.png" alt="Colab" />
6 6 </div>
7 7 </div>
8 8  
... ...
src/tz/__init__.py 0 → 100644
src/tz/middleware.py 0 → 100644
... ... @@ -0,0 +1,20 @@
  1 +
  2 +import pytz
  3 +
  4 +from django.utils import timezone
  5 +
  6 +
  7 +class TimezoneMiddleware(object):
  8 + def process_request(self, request):
  9 + offset = request.COOKIES.get('utc_offset', 0)
  10 +
  11 + try:
  12 + offset = int(offset) * -1
  13 + except ValueError:
  14 + offset = 0
  15 +
  16 + if offset:
  17 + tz = pytz.FixedOffset(offset)
  18 + timezone.activate(tz)
  19 + else:
  20 + timezone.deactivate()
... ...
src/tz/templates/tz/set_utc_offset.html 0 → 100644
... ... @@ -0,0 +1,4 @@
  1 +<script type="text/javascript">
  2 + var date = new Date();
  3 + $.cookie('utc_offset', date.getTimezoneOffset(), { path: '/' });
  4 +</script>
... ...