Commit 4a86615cbc465999070157424ba0fd09ea6ee203

Authored by Sergio Oliveira
2 parents 4c3b20b3 e4f0799b

Merge pull request #2 from TracyWebTech/master

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