Commit ca702a629868c6ad888e04237c89a23711826cfa
1 parent
b534565b
Exists in
master
and in
39 other branches
Merge com https://bitbucket.org/seocam/atu-colab/src/810a0e848fcd
git-svn-id: http://repositorio.interlegis.gov.br/colab/trunk@6208 bee1b3ed-c3eb-0310-9994-b88e04532788
Showing
13 changed files
with
87 additions
and
17 deletions
Show diff stats
colab/rss/feeds.py
... | ... | @@ -19,7 +19,9 @@ class LatestThreadsFeeds(Feed): |
19 | 19 | return item.latest_message.url |
20 | 20 | |
21 | 21 | def item_title(self, item): |
22 | - return item.latest_message.subject_clean | |
22 | + title = '[' + item.mailinglist.name + '] ' | |
23 | + title += item.latest_message.subject_clean | |
24 | + return title | |
23 | 25 | |
24 | 26 | def item_description(self, item): |
25 | 27 | return item.latest_message.body |
... | ... | @@ -36,7 +38,9 @@ class HottestThreadsFeeds(Feed): |
36 | 38 | return item.latest_message.url |
37 | 39 | |
38 | 40 | def item_title(self, item): |
39 | - return item.latest_message.subject_clean | |
41 | + title = '[' + item.mailinglist.name + '] ' | |
42 | + title += item.latest_message.subject_clean | |
43 | + return title | |
40 | 44 | |
41 | 45 | def item_description(self, item): |
42 | 46 | return item.latest_message.body | ... | ... |
colab/rss/urls.py
... | ... | @@ -2,8 +2,8 @@ from django.conf.urls.defaults import patterns, url |
2 | 2 | import feeds |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
5 | - url(r'threads/latest/$', feeds.LatestThreadsFeeds()), | |
6 | - url(r'colab/latest/$', feeds.LatestColabFeeds()), | |
7 | - url(r'threads/hottest/$', feeds.HottestThreadsFeeds()), | |
5 | + url(r'threads/latest/$', feeds.LatestThreadsFeeds(), name='rss_latest_threads'), | |
6 | + url(r'colab/latest/$', feeds.LatestColabFeeds(), name='rss_latest_colab'), | |
7 | + url(r'threads/hottest/$', feeds.HottestThreadsFeeds(), name='rss_hottest_threads'), | |
8 | 8 | ) |
9 | 9 | ... | ... |
colab/settings.py
... | ... | @@ -155,7 +155,7 @@ SOLR_SELECT_PATH = '/solr/select' |
155 | 155 | |
156 | 156 | SOLR_COLAB_URI = 'http://colab.interlegis.gov.br' |
157 | 157 | SOLR_BASE_QUERY = """ |
158 | - (Type:changeset OR Type:ticket OR Type:wiki OR Type:thread) | |
158 | + ((Type:changeset OR Type:ticket OR Type:wiki OR Type:thread) AND Title:["" TO *]) | |
159 | 159 | """ |
160 | 160 | |
161 | 161 | from settings_local import * | ... | ... |
colab/static/css/screen.css
colab/static/img/COPYRIGHT
405 Bytes
colab/super_archives/views.py
... | ... | @@ -56,7 +56,10 @@ def list_messages(request): |
56 | 56 | threads = threads.filter(mailinglist__name=mail_list) |
57 | 57 | |
58 | 58 | paginator = Paginator(threads, 16) |
59 | - page = int(request.GET.get('p', '1')) | |
59 | + try: | |
60 | + page = int(request.GET.get('p', '1')) | |
61 | + except ValueError: | |
62 | + page = 1 | |
60 | 63 | threads = paginator.page(page) |
61 | 64 | |
62 | 65 | lists = MailingList.objects.all() | ... | ... |
colab/templates/base.html
... | ... | @@ -44,6 +44,23 @@ |
44 | 44 | </style> |
45 | 45 | |
46 | 46 | {% endblock %} |
47 | + | |
48 | + {% block google_analytics %} | |
49 | + <script type="text/javascript"> | |
50 | + | |
51 | + var _gaq = _gaq || []; | |
52 | + _gaq.push(['_setAccount', 'UA-30841845-2']); | |
53 | + _gaq.push(['_trackPageview']); | |
54 | + | |
55 | + (function() { | |
56 | + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; | |
57 | + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | |
58 | + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | |
59 | + })(); | |
60 | + | |
61 | + </script> | |
62 | + {% endblock %} | |
63 | + | |
47 | 64 | </head> |
48 | 65 | |
49 | 66 | <body class="container"> | ... | ... |
colab/templates/home.html
... | ... | @@ -18,7 +18,11 @@ |
18 | 18 | {% block main-content %} |
19 | 19 | |
20 | 20 | <div class="span-12 colborder"> |
21 | - <h3>{% trans "Últimas Colaborações" %}</h3> | |
21 | + <h3>{% trans "Últimas Colaborações" %}<a class="rss" target="_blank" | |
22 | + href="{% url rss_latest_colab %}" | |
23 | + title="{% trans "RSS - Últimas Colaborações" %}"> | |
24 | + <img src="{{ STATIC_URL }}img/rss.png" alt="RSS"/></a> | |
25 | + </h3> | |
22 | 26 | <ul> |
23 | 27 | {% for doc in latest_docs %} |
24 | 28 | {% include "message-preview.html" %} |
... | ... | @@ -39,7 +43,11 @@ |
39 | 43 | <hr/> |
40 | 44 | |
41 | 45 | <div class="span-12 colborder"> |
42 | - <h3>{% trans "Discussões Mais Relevantes" %}</h3> | |
46 | + <h3>{% trans "Discussões Mais Relevantes" %}<a class="rss" target="_blank" | |
47 | + href="{% url rss_hottest_threads %}" | |
48 | + title="{% trans "RSS - Discussões Mais Relevantes" %}"> | |
49 | + <img src="{{ STATIC_URL }}img/rss.png" alt="RSS"/></a> | |
50 | + </h3> | |
43 | 51 | <ul> |
44 | 52 | {% for thread in hottest_threads %} |
45 | 53 | {% include "message-preview.html" with doc=thread.latest_message %} |
... | ... | @@ -52,7 +60,11 @@ |
52 | 60 | </div> |
53 | 61 | |
54 | 62 | <div class="span-11 last"> |
55 | - <h3>{% trans "Últimas Discussões" %}</h3> | |
63 | + <h3>{% trans "Últimas Discussões" %}<a class="rss" target="_blank" | |
64 | + href="{% url rss_latest_threads %}" | |
65 | + title="{% trans "RSS - Últimas Discussões" %}"> | |
66 | + <img src="{{ STATIC_URL }}img/rss.png" alt="RSS"/></a> | |
67 | + </h3> | |
56 | 68 | <ul> |
57 | 69 | {% for thread in latest_threads %} |
58 | 70 | {% include "message-preview.html" with doc=thread.latest_message %} | ... | ... |
colab/urls.py
... | ... | @@ -22,7 +22,7 @@ urlpatterns = patterns('', |
22 | 22 | url(r'^user/hash/(?P<emailhash>[\w]+)$', |
23 | 23 | 'colab.views.userprofile.by_emailhash'), |
24 | 24 | |
25 | - url(r'^user/(?P<username>[\w]+)/edit/?$', | |
25 | + url(r'^user/(?P<username>[\w@+.-]+)/edit/?$', | |
26 | 26 | 'colab.views.userprofile.update', name='user_profile_update'), |
27 | 27 | |
28 | 28 | url(r'^search/$', 'colab.views.other.search', name='search'), | ... | ... |
colab/views/other.py
... | ... | @@ -7,6 +7,7 @@ Created by Sergio Campos on 2012-01-10. |
7 | 7 | """ |
8 | 8 | |
9 | 9 | from django.template import RequestContext |
10 | +from django.http import HttpResponseNotAllowed | |
10 | 11 | from django.shortcuts import render_to_response |
11 | 12 | from django.utils.translation import ugettext as _ |
12 | 13 | |
... | ... | @@ -31,12 +32,21 @@ def home(request): |
31 | 32 | |
32 | 33 | |
33 | 34 | def search(request): |
34 | - if request.method == 'GET': | |
35 | - query = request.GET.get('q') | |
36 | - sort = request.GET.get('o') | |
37 | - type_ = request.GET.get('type') | |
38 | - page_number = int(request.GET.get('p', 1)) | |
35 | + if request.method != 'GET': | |
36 | + return HttpResponseNotAllowed(['GET']) | |
37 | + | |
38 | + query = request.GET.get('q') | |
39 | + sort = request.GET.get('o') | |
40 | + type_ = request.GET.get('type') | |
41 | + try: | |
42 | + page_number = int(request.GET.get('p', '1')) | |
43 | + except ValueError: | |
44 | + page_number = 1 | |
45 | + | |
46 | + try: | |
39 | 47 | results_per_page = int(request.GET.get('per_page', 16)) |
48 | + except ValueError: | |
49 | + results_per_page = 16 | |
40 | 50 | |
41 | 51 | filters = { |
42 | 52 | 'Type': type_, | ... | ... |
solr-conf/schema.xml
... | ... | @@ -465,7 +465,7 @@ |
465 | 465 | <field name="Type" type="string" indexed="true" |
466 | 466 | stored="true" required="true" multiValued="false"/> |
467 | 467 | <field name="Title" type="text_ptbr" indexed="true" |
468 | - stored="true" required="false" multiValued="false"/> | |
468 | + stored="true" required="true" multiValued="false"/> | |
469 | 469 | <field name="Description" type="text_ptbr" indexed="true" |
470 | 470 | stored="true" required="false" multiValued="false"/> |
471 | 471 | <field name="Creator" type="string" indexed="true" | ... | ... |
... | ... | @@ -0,0 +1,19 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +cd /usr/local/src/colab/ | |
4 | +hg pull | |
5 | +hg up | |
6 | +rm -fR dist/ | |
7 | +python setup.py sdist | |
8 | + | |
9 | +if [[ $1 == 'deps' ]] ; then | |
10 | + # com dependencias | |
11 | + /usr/local/django/colab/bin/pip install dist/*.gz -U | |
12 | +else | |
13 | + # sem dependencias | |
14 | + /usr/local/django/colab/bin/pip install dist/*.gz -U --no-deps | |
15 | +fi | |
16 | + | |
17 | +/usr/local/django/colab/bin/python colab/manage.py syncdb | |
18 | +/usr/local/django/colab/bin/python colab/manage.py migrate | |
19 | +touch /usr/local/django/colab/wsgi/colab.wsgi | ... | ... |