Merge Request #67

Merged
softwarepublico/colab!67
Created by Luciano Prestes

Remove core deps

Remove old colab apps, dependencies and features that are no longer used.

Assignee: Sergio Oliveira
Milestone: None

Merged by Sergio Oliveira

Source branch has been removed
Commits (8)
3 participants
Showing 68 changed files   Show diff stats
colab.spec
... ... @@ -131,8 +131,6 @@ ALLOWED_HOSTS:
131 131 ## Disable indexing
132 132 ROBOTS_NOINDEX: false
133 133  
134   -## Disable browser id authentication
135   -# BROWSERID_ENABLED: true
136 134 EOF
137 135 chown root:colab /etc/colab/settings.yaml
138 136 chmod 0640 /etc/colab/settings.yaml
... ...
colab/accounts/forms.py
... ... @@ -16,8 +16,6 @@ from django.utils.text import capfirst
16 16 from django.utils.translation import ugettext_lazy as _
17 17 from django.utils.safestring import mark_safe
18 18  
19   -from conversejs.models import XMPPAccount
20   -
21 19  
22 20 from .utils.validators import validate_social_account
23 21 from .utils import mailman
... ... @@ -152,42 +150,6 @@ class ListsForm(forms.Form):
152 150 choices=LISTS_NAMES)
153 151  
154 152  
155   -class ChangeXMPPPasswordForm(forms.ModelForm):
156   - password1 = forms.CharField(label=_("Password"),
157   - widget=forms.PasswordInput)
158   - password2 = forms.CharField(label=_("Password confirmation"),
159   - widget=forms.PasswordInput,
160   - help_text=_(("Enter the same password as above"
161   - ", for verification.")))
162   -
163   - class Meta:
164   - model = XMPPAccount
165   - fields = ('password1', 'password2')
166   -
167   - def __init__(self, *args, **kwargs):
168   - super(ChangeXMPPPasswordForm, self).__init__(*args, **kwargs)
169   -
170   - for field_name, field in self.fields.items():
171   - # Adds form-control class to all form fields
172   - field.widget.attrs.update({'class': 'form-control'})
173   -
174   - def clean_password2(self):
175   - password1 = self.cleaned_data.get("password1")
176   - password2 = self.cleaned_data.get("password2")
177   - if password1 and password2 and password1 != password2:
178   - raise forms.ValidationError(
179   - _("Password mismatch"),
180   - code='password_mismatch',
181   - )
182   - return password2
183   -
184   - def save(self, commit=True):
185   - self.instance.password = self.cleaned_data['password2']
186   - if commit:
187   - self.instance.save()
188   - return self.instance
189   -
190   -
191 153 class UserCreationForm(UserForm):
192 154 """
193 155 A form that creates a user, with no privileges, from the given username and
... ...
colab/accounts/models.py
... ... @@ -47,13 +47,6 @@ class User(AbstractUser):
47 47  
48 48 objects = ColabUserManager()
49 49  
50   - def check_password(self, raw_password):
51   -
52   - if self.xmpp.exists() and raw_password == self.xmpp.first().password:
53   - return True
54   -
55   - return super(User, self).check_password(raw_password)
56   -
57 50 def get_absolute_url(self):
58 51 return reverse('user_profile', kwargs={'username': self.username})
59 52  
... ...
colab/accounts/search_indexes.py
1 1 # -*- coding: utf-8 -*-
2 2  
3 3 from haystack import indexes
4   -# from django.db.models import Count
5   -
6   -from colab.badger.utils import get_users_counters
7 4 from .models import User
8 5  
9 6  
... ... @@ -26,30 +23,13 @@ class UserIndex(indexes.SearchIndex, indexes.Indexable):
26 23 stored=False)
27 24 webpage = indexes.CharField(model_attr='webpage', null=True, stored=False)
28 25 message_count = indexes.IntegerField(stored=False)
29   - # changeset_count = indexes.IntegerField(stored=False)
30   - # ticket_count = indexes.IntegerField(stored=False)
31   - # wiki_count = indexes.IntegerField(stored=False)
32   - contribution_count = indexes.IntegerField(stored=False)
33 26  
34 27 def get_model(self):
35 28 return User
36 29  
37   - @property
38   - def badge_counters(self):
39   - if not hasattr(self, '_badge_counters'):
40   - self._badge_counters = get_users_counters()
41   - return self._badge_counters
42   -
43 30 def prepare(self, obj):
44 31 prepared_data = super(UserIndex, self).prepare(obj)
45 32  
46   - prepared_data['contribution_count'] = sum((
47   - self.prepared_data['message_count'],
48   - # self.prepared_data['changeset_count'],
49   - # self.prepared_data['ticket_count'],
50   - # self.prepared_data['wiki_count']
51   - ))
52   -
53 33 return prepared_data
54 34  
55 35 def prepare_description(self, obj):
... ... @@ -63,17 +43,5 @@ class UserIndex(indexes.SearchIndex, indexes.Indexable):
63 43 def prepare_type(self, obj):
64 44 return u'user'
65 45  
66   - def prepare_message_count(self, obj):
67   - return self.badge_counters[obj.username]['messages']
68   -
69   - # def prepare_changeset_count(self, obj):
70   - # return self.badge_counters[obj.username]['revisions']
71   -
72   - # def prepare_ticket_count(self, obj):
73   - # return self.badge_counters[obj.username]['tickets']
74   -
75   - # def prepare_wiki_count(self, obj):
76   - # return self.badge_counters[obj.username]['wikis']
77   -
78 46 def index_queryset(self, using=None):
79 47 return self.get_model().objects.filter(is_active=True)
... ...
colab/accounts/templates/accounts/user_update_form.html
... ... @@ -178,40 +178,19 @@ $(function() {
178 178 </div>
179 179 </div>
180 180 </div>
181   - {% if not BROWSERID_ENABLED %}
182   - <div class="col-lg-4 col-md-5 col-sm-12 col-xm-12">
183   - <div class="panel panel-default">
184   - <div class="panel-heading">
185   - <h3 class="panel-title">
186   - {% trans 'Change Password' %}
187   - </h3>
188   - </div>
189   - <div class="panel-body">
190   - <a href="{% url 'password_change' %}" class="btn btn-default btn-primary pull-right btn-block">{% trans "Change Password" %}</a>
191   - </div>
  181 + <div class="col-lg-4 col-md-5 col-sm-12 col-xm-12">
  182 + <div class="panel panel-default">
  183 + <div class="panel-heading">
  184 + <h3 class="panel-title">
  185 + {% trans 'Change Password' %}
  186 + </h3>
192 187 </div>
193   - </div>
194   - {% endif %}
195   - </div>
196   - {% if CONVERSEJS_ENABLED %}
197   - <div class="row">
198   - <div class="col-lg-12">
199   - <div class="panel panel-default">
200   - <div class="panel-heading">
201   - <h3 class="panel-title">
202   - {% trans 'Change Password' %}
203   - </h3>
204   - </div>
205   - <div class="panel-body">
206   - <div class="form-group">
207   - {% trans "This feature is available only for those who need to change the password for some reason as having an old user with the same username, forgot your password to commit, usage of other XMPP Client for connection. Usually, you won't need to change this password. Only change it if you are sure about what you are doing." %}
  188 + <div class="panel-body">
  189 + <a href="{% url 'password_change' %}" class="btn btn-default btn-primary pull-right btn-block">{% trans "Change Password" %}</a>
208 190 </div>
209   - <a href="{% url 'change_password' %}" class="btn btn-default pull-right"><span class="icon-warning-sign"></span> {% trans "Change Password" %}</a>
210 191 </div>
211 192 </div>
212   - </div>
213 193 </div>
214   - {% endif %}
215 194 <div class="row">
216 195 <div class="submit">
217 196 <button type="submit" class="btn btn-primary btn-lg btn-block">{% trans "Update" %}</button>
... ...
colab/accounts/tests/test_view_signup.py
... ... @@ -21,13 +21,6 @@ class TestSignUpView(TestCase):
21 21 "usertest@colab.com.br", "123colab4")
22 22 return user
23 23  
24   - def test_user_not_authenticated(self):
25   - with self.settings(BROWSERID_ENABLED=True):
26   - response = self.client.get("/account/register")
27   - self.assertEquals(302, response.status_code)
28   - url = "http://testserver/account/login"
29   - self.assertEquals(url, response.url)
30   -
31 24 def test_user_authenticated_and_unregistered(self):
32 25 self.client.login(username="usertestcolab", password="123colab4")
33 26 response = self.client.get("/account/register/")
... ...
colab/accounts/urls.py
... ... @@ -2,56 +2,44 @@
2 2 from django.conf import settings
3 3 from django.conf.urls import patterns, url
4 4  
5   -from .views import (UserProfileDetailView, UserProfileUpdateView, LoginView,
6   - ManageUserSubscriptionsView, ChangeXMPPPasswordView)
  5 +from .views import (UserProfileDetailView, UserProfileUpdateView,
  6 + ManageUserSubscriptionsView)
7 7  
8 8 from colab.accounts import views
9 9 from django.contrib.auth import views as auth_views
10 10  
11 11  
12   -BROWSERID_ENABLED = getattr(settings, 'BROWSERID_ENABLED', False)
  12 +urlpatterns = patterns('',
  13 + url(r'^login/?$', 'django.contrib.auth.views.login', name='login'),
13 14  
  15 + url(r'^logout/?$', 'django.contrib.auth.views.logout',
  16 + {'next_page':'home'}, name='logout'),
14 17  
15   -if not BROWSERID_ENABLED:
16   - urlpatterns = patterns('',
17   - url(r'^login/?$', 'django.contrib.auth.views.login', name='login'),
  18 + url(r'^password-reset-done/?$', 'colab.accounts.views.password_reset_done_custom',
  19 + name="password_reset_done"),
  20 + url(r'^password-reset-complete/$', 'colab.accounts.views.password_reset_complete_custom',
  21 + name="password_reset_complete"),
18 22  
19   - url(r'^logout/?$', 'django.contrib.auth.views.logout',
20   - {'next_page':'home'}, name='logout'),
  23 + url(r'^password-reset-confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
  24 + auth_views.password_reset_confirm,
  25 + {'template_name':'registration/password_reset_confirm_custom.html'},
  26 + name="password_reset_confirm"),
21 27  
22   - url(r'^password-reset-done/?$', 'colab.accounts.views.password_reset_done_custom',
23   - name="password_reset_done"),
24   - url(r'^password-reset-complete/$', 'colab.accounts.views.password_reset_complete_custom',
25   - name="password_reset_complete"),
  28 + url(r'^password-reset/?$', auth_views.password_reset,
  29 + {'template_name':'registration/password_reset_form_custom.html'},
  30 + name="password_reset"),
26 31  
27   - url(r'^password-reset-confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
28   - auth_views.password_reset_confirm,
29   - {'template_name':'registration/password_reset_confirm_custom.html'},
30   - name="password_reset_confirm"),
  32 + url(r'^change-password/?$',auth_views.password_change,
  33 + {'template_name':'registration/password_change_form_custom.html'},
  34 + name='password_change'),
31 35  
32   - url(r'^password-reset/?$', auth_views.password_reset,
33   - {'template_name':'registration/password_reset_form_custom.html'},
34   - name="password_reset"),
35   -
36   - url(r'^change-password/?$',auth_views.password_change,
37   - {'template_name':'registration/password_change_form_custom.html'},
38   - name='password_change'),
39   -
40   - url(r'^change-password-done/?$',
41   - 'colab.accounts.views.password_changed', name='password_change_done'),
42   - )
43   -else:
44   - urlpatterns = patterns('',
45   - url(r'^login/?$', LoginView.as_view(), name='login'),
46   - )
  36 + url(r'^change-password-done/?$',
  37 + 'colab.accounts.views.password_changed', name='password_change_done'),
  38 +)
47 39  
48 40 urlpatterns += patterns('',
49 41 url(r'^register/?$', 'colab.accounts.views.signup', name='signup'),
50 42  
51   -#FIXME Configure for XMPP
52   -# url(r'^change-password/$',
53   -# ChangeXMPPPasswordView.as_view(), name='change_password'),
54   -
55 43 url(r'^(?P<username>[\w@+.-]+)/?$',
56 44 UserProfileDetailView.as_view(), name='user_profile'),
57 45  
... ...
colab/accounts/views.py
... ... @@ -13,23 +13,16 @@ from django.core.exceptions import PermissionDenied
13 13 from django.views.generic import DetailView, UpdateView, TemplateView
14 14 from django.http import Http404
15 15  
16   -from conversejs import xmpp
17   -from conversejs.models import XMPPAccount
18   -
19 16 from colab.super_archives.models import (EmailAddress,
20 17 EmailAddressValidation)
21 18 from colab.search.utils import get_collaboration_data, get_visible_threads
22 19 from colab.accounts.models import User
23 20  
24 21 from .forms import (UserCreationForm, UserForm, ListsForm,
25   - UserUpdateForm, ChangeXMPPPasswordForm)
  22 + UserUpdateForm)
26 23 from .utils import mailman
27 24  
28 25  
29   -class LoginView(TemplateView):
30   - template_name = "accounts/login.html"
31   -
32   -
33 26 class UserProfileBaseMixin(object):
34 27 model = get_user_model()
35 28 slug_field = 'username'
... ... @@ -52,11 +45,6 @@ class UserProfileUpdateView(UserProfileBaseMixin, UpdateView):
52 45  
53 46 return obj
54 47  
55   - def get_context_data(self, **kwargs):
56   - context = super(UserProfileUpdateView, self).get_context_data(**kwargs)
57   - context['CONVERSEJS_ENABLED'] = getattr(settings, 'CONVERSEJS_ENABLED')
58   - return context
59   -
60 48  
61 49 class UserProfileDetailView(UserProfileBaseMixin, DetailView):
62 50 template_name = 'accounts/user_detail.html'
... ... @@ -94,37 +82,19 @@ class UserProfileDetailView(UserProfileBaseMixin, DetailView):
94 82  
95 83  
96 84 def signup(request):
97   - BROWSERID_ENABLED = getattr(settings, 'BROWSERID_ENABLED', False)
98   -
99   - if BROWSERID_ENABLED:
100   - # If the user is not authenticated, redirect to login
101   - if not request.user.is_authenticated():
102   - return redirect('login')
103 85  
104 86 if request.user.is_authenticated():
105   - # If the user doesn't need to update its main data,
106   - # redirect to its profile
107   - # It happens when user is created by browserid
108   - # and didn't set his/her main data
109 87 if not request.user.needs_update:
110 88 return redirect('user_profile', username=request.user.username)
111 89  
112   - # If the user is authenticated in Persona, but not in the Colab then he
113   - # will be redirected to the register form.
114 90 if request.method == 'GET':
115   - if BROWSERID_ENABLED:
116   - user_form = UserForm()
117   - else:
118   - user_form = UserCreationForm()
  91 + user_form = UserCreationForm()
119 92 lists_form = ListsForm()
120 93  
121 94 return render(request, 'accounts/user_create_form.html',
122 95 {'user_form': user_form, 'lists_form': lists_form})
123 96  
124   - if BROWSERID_ENABLED:
125   - user_form = UserForm(request.POST, instance=request.user)
126   - else:
127   - user_form = UserCreationForm(request.POST)
  97 + user_form = UserCreationForm(request.POST)
128 98 lists_form = ListsForm(request.POST)
129 99  
130 100 if not user_form.is_valid() or not lists_form.is_valid():
... ... @@ -134,12 +104,9 @@ def signup(request):
134 104 user = user_form.save(commit=False)
135 105 user.needs_update = False
136 106  
137   - if not BROWSERID_ENABLED:
138   - user.is_active = False
139   - user.save()
140   - EmailAddressValidation.create(user.email, user)
141   - else:
142   - user.save()
  107 + user.is_active = False
  108 + user.save()
  109 + EmailAddressValidation.create(user.email, user)
143 110  
144 111 # Check if the user's email have been used previously
145 112 # in the mainling lists to link the user to old messages
... ... @@ -208,50 +175,6 @@ class ManageUserSubscriptionsView(UserProfileBaseMixin, DetailView):
208 175 self).get_context_data(**context)
209 176  
210 177  
211   -class ChangeXMPPPasswordView(UpdateView):
212   - model = XMPPAccount
213   - form_class = ChangeXMPPPasswordForm
214   - fields = ['password', ]
215   - template_name = 'accounts/change_password.html'
216   -
217   - def get_success_url(self):
218   - return reverse('user_profile', kwargs={
219   - 'username': self.request.user.username
220   - })
221   -
222   - def get_object(self, queryset=None):
223   - obj = get_object_or_404(XMPPAccount, user=self.request.user.pk)
224   - self.old_password = obj.password
225   - return obj
226   -
227   - def form_valid(self, form):
228   - transaction.set_autocommit(False)
229   -
230   - response = super(ChangeXMPPPasswordView, self).form_valid(form)
231   -
232   - changed = xmpp.change_password(
233   - self.object.jid,
234   - self.old_password,
235   - form.cleaned_data['password1']
236   - )
237   -
238   - if not changed:
239   - messages.error(
240   - self.request,
241   - _(u'Could not change your password. Please, try again later.')
242   - )
243   - transaction.rollback()
244   - return response
245   - else:
246   - transaction.commit()
247   -
248   - messages.success(
249   - self.request,
250   - _("You've changed your password successfully!")
251   - )
252   - return response
253   -
254   -
255 178 def password_changed(request):
256 179 messages.success(request, _('Your password was changed.'))
257 180  
... ...
colab/home/context_processors.py
... ... @@ -26,6 +26,3 @@ def ribbon(request):
26 26 }
27 27 }
28 28  
29   -
30   -def browserid_enabled(request):
31   - return {'BROWSERID_ENABLED': getattr(settings, 'BROWSERID_ENABLED', False)}
... ...
colab/locale/en/LC_MESSAGES/django.po
... ... @@ -126,12 +126,11 @@ msgstr &quot;&quot;
126 126 msgid "Register"
127 127 msgstr ""
128 128  
129   -#: accounts/templates/accounts/user_detail.html:8 badger/models.py:21
  129 +#: accounts/templates/accounts/user_detail.html:8
130 130 msgid "Messages"
131 131 msgstr ""
132 132  
133   -#: accounts/templates/accounts/user_detail.html:9 badger/models.py:22
134   -#: templates/home.html:7
  133 +#: accounts/templates/accounts/user_detail.html:9
135 134 msgid "Contributions"
136 135 msgstr ""
137 136  
... ... @@ -175,7 +174,7 @@ msgstr &quot;&quot;
175 174 msgid "Participation by Group"
176 175 msgstr ""
177 176  
178   -#: accounts/templates/accounts/user_detail.html:132 badger/models.py:69
  177 +#: accounts/templates/accounts/user_detail.html:132
179 178 msgid "Badges"
180 179 msgstr ""
181 180  
... ... @@ -291,87 +290,18 @@ msgstr &quot;&quot;
291 290 msgid "You've changed your password successfully!"
292 291 msgstr ""
293 292  
294   -#: badger/forms.py:19 badger/models.py:39 settings.py:160
  293 +#: settings.py:160
295 294 msgid "Image"
296 295 msgstr ""
297 296  
298   -#: badger/forms.py:30
299   -msgid "You must add an Image"
300   -msgstr ""
301   -
302   -#: badger/models.py:11
303   -msgid "Greater than or equal"
304   -msgstr ""
305   -
306   -#: badger/models.py:12
307   -msgid "less than or equal"
308   -msgstr ""
309   -
310   -#: badger/models.py:13
311   -msgid "Equal"
312   -msgstr ""
313   -
314   -#: badger/models.py:14
315   -msgid "Biggest"
316   -msgstr ""
317   -
318   -#: badger/models.py:17
319   -msgid "Automatically"
320   -msgstr ""
321   -
322   -#: badger/models.py:18
323   -msgid "Manual"
324   -msgstr ""
325   -
326   -#: badger/models.py:23
327   -msgid "Wikis"
328   -msgstr ""
329   -
330   -#: badger/models.py:24
331   -msgid "Revisions"
332   -msgstr ""
333   -
334   -#: badger/models.py:25
335 297 #: search/templates/search/includes/search_filters.html:122
336 298 msgid "Ticket"
337 299 msgstr ""
338 300  
339   -#: badger/models.py:35
340   -msgid "Title"
341   -msgstr ""
342   -
343   -#: badger/models.py:37
344   -msgid "Description"
345   -msgstr ""
346   -
347   -#: badger/models.py:40 search/forms.py:18
  301 +#: search/forms.py:18
348 302 msgid "Type"
349 303 msgstr ""
350 304  
351   -#: badger/models.py:42
352   -msgid "User attribute"
353   -msgstr ""
354   -
355   -#: badger/models.py:48
356   -msgid "Comparison"
357   -msgstr ""
358   -
359   -#: badger/models.py:55
360   -msgid "Value"
361   -msgstr ""
362   -
363   -#: badger/models.py:61
364   -msgid "Awardees"
365   -msgstr ""
366   -
367   -#: badger/models.py:65
368   -msgid "Order"
369   -msgstr ""
370   -
371   -#: badger/models.py:68
372   -msgid "Badge"
373   -msgstr ""
374   -
375 305 #: home/context_processors.py:15
376 306 msgid "Fork me!"
377 307 msgstr ""
... ...
colab/locale/pt_BR/LC_MESSAGES/django.po
... ... @@ -149,12 +149,11 @@ msgid &quot;Register&quot;
149 149 msgstr "Cadastre-se"
150 150  
151 151 #: colab/accounts/templates/accounts/user_detail.html:8
152   -#: colab/badger/models.py:21
153 152 msgid "Messages"
154 153 msgstr "Mensagens"
155 154  
156 155 #: colab/accounts/templates/accounts/user_detail.html:9
157   -#: colab/badger/models.py:22 colab/templates/home.html:7
  156 +#: colab/templates/home.html:7
158 157 msgid "Contributions"
159 158 msgstr "Contribuições"
160 159  
... ... @@ -199,7 +198,6 @@ msgid &quot;Participation by Group&quot;
199 198 msgstr "Participação por grupo"
200 199  
201 200 #: colab/accounts/templates/accounts/user_detail.html:132
202   -#: colab/badger/models.py:69
203 201 msgid "Badges"
204 202 msgstr "Medalhas"
205 203  
... ... @@ -365,87 +363,18 @@ msgstr &quot;Nos enviamos o email com as intruções para mudança de senha. Em breve
365 363 msgid "Your password has been set. You may go ahead and log in now."
366 364 msgstr "Sua senha foi redefinida. Você pode prosseguir e autenticar agora."
367 365  
368   -#: colab/badger/forms.py:19 colab/badger/models.py:39 colab/settings.py:160
  366 +#: colab/settings.py:160
369 367 msgid "Image"
370 368 msgstr "Imagem"
371 369  
372   -#: colab/badger/forms.py:30
373   -msgid "You must add an Image"
374   -msgstr "Você deve adicionar uma imagem"
375   -
376   -#: colab/badger/models.py:11
377   -msgid "Greater than or equal"
378   -msgstr "Maior que ou igual"
379   -
380   -#: colab/badger/models.py:12
381   -msgid "less than or equal"
382   -msgstr "menor que ou igual"
383   -
384   -#: colab/badger/models.py:13
385   -msgid "Equal"
386   -msgstr "Igual"
387   -
388   -#: colab/badger/models.py:14
389   -msgid "Biggest"
390   -msgstr "Maior"
391   -
392   -#: colab/badger/models.py:17
393   -msgid "Automatically"
394   -msgstr "Automaticamente"
395   -
396   -#: colab/badger/models.py:18
397   -msgid "Manual"
398   -msgstr "Manual"
399   -
400   -#: colab/badger/models.py:23
401   -msgid "Wikis"
402   -msgstr "Wikis"
403   -
404   -#: colab/badger/models.py:24
405   -msgid "Revisions"
406   -msgstr "Conjunto de mudanças"
407   -
408   -#: colab/badger/models.py:25
409 370 #: colab/search/templates/search/includes/search_filters.html:122
410 371 msgid "Ticket"
411 372 msgstr "Tíquetes"
412 373  
413   -#: colab/badger/models.py:35
414   -msgid "Title"
415   -msgstr "Título"
416   -
417   -#: colab/badger/models.py:37
418   -msgid "Description"
419   -msgstr "Descrição"
420   -
421   -#: colab/badger/models.py:40 colab/search/forms.py:18
  374 +#: colab/search/forms.py:18
422 375 msgid "Type"
423 376 msgstr "Tipo"
424 377  
425   -#: colab/badger/models.py:42
426   -msgid "User attribute"
427   -msgstr "Atributo do usuário"
428   -
429   -#: colab/badger/models.py:48
430   -msgid "Comparison"
431   -msgstr "Comparação"
432   -
433   -#: colab/badger/models.py:55
434   -msgid "Value"
435   -msgstr "Valor"
436   -
437   -#: colab/badger/models.py:61
438   -msgid "Awardees"
439   -msgstr "Premiados"
440   -
441   -#: colab/badger/models.py:65
442   -msgid "Order"
443   -msgstr "Ordem"
444   -
445   -#: colab/badger/models.py:68
446   -msgid "Badge"
447   -msgstr "Medalha"
448   -
449 378 #: colab/home/context_processors.py:20
450 379 msgid "Fork me!"
451 380 msgstr "Fork me!"
... ...
colab/management/initconfig.py
... ... @@ -21,15 +21,6 @@ EMAIL_SUBJECT_PREFIX = &#39;[colab]&#39;
21 21  
22 22 SECRET_KEY = '{secret_key}'
23 23  
24   -# Must use it without trailing slash
25   -SITE_URL = 'http://localhost:8000'
26   -BROWSERID_AUDIENCES = [
27   - 'http://localhost:8000',
28   -# 'http://example.com',
29   -# 'https://example.org',
30   -# 'http://example.net',
31   -]
32   -
33 24 ALLOWED_HOSTS = [
34 25 'localhost',
35 26 # 'example.com',
... ... @@ -37,18 +28,9 @@ ALLOWED_HOSTS = [
37 28 # 'example.net',
38 29 ]
39 30  
40   -### Uncomment to enable Broswer ID protocol for authentication
41   -# BROWSERID_ENABLED = True
42   -
43 31 ### Uncomment to enable social networks fields profile
44 32 # SOCIAL_NETWORK_ENABLED = True
45 33  
46   -### Uncomment to enable Converse.js
47   -# CONVERSEJS_ENABLED = True
48   -
49   -### Uncomment to enable auto-registration
50   -# CONVERSEJS_AUTO_REGISTER = 'xmpp.example.com'
51   -
52 34 ## Database settings
53 35 DATABASES = {{
54 36 'default': {{
... ...
colab/settings.py
... ... @@ -44,8 +44,6 @@ INSTALLED_APPS = (
44 44 # Not standard apps
45 45 'cliauth',
46 46 'django_mobile',
47   - 'django_browserid',
48   - 'conversejs',
49 47 'haystack',
50 48 'hitcounter',
51 49 'i18n_model',
... ... @@ -58,7 +56,6 @@ INSTALLED_APPS = (
58 56 'colab.api',
59 57 'colab.rss',
60 58 'colab.search',
61   - 'colab.badger',
62 59 'colab.tz',
63 60 )
64 61  
... ... @@ -198,7 +195,6 @@ TEMPLATE_CONTEXT_PROCESSORS = (
198 195 'colab.home.context_processors.robots',
199 196 'colab.home.context_processors.ribbon',
200 197 'colab.home.context_processors.google_analytics',
201   - 'colab.home.context_processors.browserid_enabled',
202 198 )
203 199  
204 200 MIDDLEWARE_CLASSES = (
... ... @@ -213,13 +209,10 @@ MIDDLEWARE_CLASSES = (
213 209 'django_mobile.middleware.MobileDetectionMiddleware',
214 210 'django_mobile.middleware.SetFlavourMiddleware',
215 211 'colab.tz.middleware.TimezoneMiddleware',
216   - 'colab.accounts.middleware.UserRegisterMiddleware',
217 212 )
218 213  
219   -# Add the django_browserid authentication backend.
220 214 AUTHENTICATION_BACKENDS = (
221 215 'django.contrib.auth.backends.ModelBackend',
222   - 'colab.accounts.auth.ColabBrowserIDBackend',
223 216 )
224 217  
225 218 LOCALE_PATHS = (
... ... @@ -247,27 +240,13 @@ SUPER_ARCHIVES_LOCK_FILE = &#39;/var/lock/colab/import_emails.lock&#39;
247 240 # Mailman API settings
248 241 MAILMAN_API_URL = 'http://localhost:8124'
249 242  
250   -# BrowserID / Persona
251   -SITE_URL = 'http://localhost:8000'
252   -BROWSERID_AUDIENCES = [SITE_URL, SITE_URL.replace('https', 'http')]
253   -
254   -
255 243 LOGIN_URL = '/user/login'
256 244 LOGIN_REDIRECT_URL = '/'
257 245 LOGIN_REDIRECT_URL_FAILURE = '/?bid_login_failed=true'
258 246 LOGOUT_REDIRECT_URL = '/'
259   -BROWSERID_CREATE_USER = True
260 247  
261 248 REVPROXY_ADD_REMOTE_USER = True
262 249  
263   -# Converse.js settings
264   -# This URL must use SSL in order to keep chat sessions secure
265   -CONVERSEJS_ENABLED = False
266   -CONVERSEJS_BOSH_SERVICE_URL = SITE_URL + '/http-bind'
267   -
268   -CONVERSEJS_ALLOW_CONTACT_REQUESTS = False
269   -CONVERSEJS_SHOW_ONLY_ONLINE_USERS = True
270   -
271 250 # Tastypie settings
272 251 TASTYPIE_DEFAULT_FORMATS = ['json', ]
273 252  
... ... @@ -279,7 +258,6 @@ if locals().get(&#39;RAVEN_DSN&#39;, False):
279 258 }
280 259 INSTALLED_APPS += ('raven.contrib.django.raven_compat',)
281 260  
282   -BROWSERID_ENABLED = locals().get('BROWSERID_ENABLED') or False
283 261 SOCIAL_NETWORK_ENABLED = locals().get('SOCIAL_NETWORK_ENABLED') or False
284 262  
285 263 locals().update(load_colab_apps())
... ...
colab/templates/base.html
1 1 <!DOCTYPE html>
2   -{% load i18n browserid conversejs gravatar %}
  2 +{% load i18n gravatar plugins %}
3 3 {% load static from staticfiles %}
4 4  
5 5 <html>
... ... @@ -43,10 +43,6 @@
43 43 {% block head_js %}{% endblock %}
44 44 {% block head_css %}{% endblock %}
45 45  
46   - {% if not is_mobile %}
47   - {% conversejs_static %}
48   - {% endif %}
49   -
50 46 <link rel="stylesheet" href="{% static 'css/screen.css' %}"
51 47 type="text/css" media="screen" />
52 48  
... ... @@ -54,10 +50,7 @@
54 50 </head>
55 51  
56 52 <!-- data-no-turbolink will disable Rails TurboLinks for all pages under Colab -->
57   - <body data-no-turbolink>
58   - {% if BROWSERID_ENABLED %}
59   - {% browserid_info %}
60   - {% endif %}
  53 + <body class="container" data-no-turbolink>
61 54  
62 55 {% block ribbon %}
63 56 {% if ribbon %}
... ... @@ -70,8 +63,82 @@
70 63 {% endblock %}
71 64  
72 65 {% block navbar %}
73   -
74   - {% include "header.html" %}
  66 + <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
  67 + <div class="container">
  68 + <div class="navbar-header">
  69 +
  70 + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main">
  71 + <span class="sr-only">Toggle navigation</span>
  72 + <span class="icon-bar"></span>
  73 + <span class="icon-bar"></span>
  74 + <span class="icon-bar"></span>
  75 + <span class="icon-bar"></span>
  76 + </button>
  77 + <a class="navbar-brand" href="/"><img alt="Colab" src="{% static 'img/logo.svg' %}"></a>
  78 + </div>
  79 + <div class="collapse navbar-collapse navbar-main">
  80 + <ul class="nav navbar-nav">
  81 +
  82 + <li>
  83 + <a href="{% url 'thread_list' %}">{% trans "Groups" %}</a>
  84 + </li>
  85 +
  86 + {% plugins_menu %}
  87 +
  88 + <li class="hidden-lg hidden-md">
  89 + <a href="{% url 'haystack_search' %}?q=">{% trans "Search" %}</a>
  90 + </li>
  91 + </ul>
  92 +
  93 + <ul class="nav navbar-nav navbar-right">
  94 + {% if not user.is_authenticated %}
  95 +
  96 + <li class="dropdown hidden-xs hidden-lg">
  97 + <a href="#" class="dropdown-toggle" data-toggle="dropdown">Acesso <b class="caret"></b></a>
  98 + <ul class="dropdown-menu">
  99 + {% trans 'Login' as login_text %}
  100 + <li><a href="{% url 'signup' %}">{% trans "Register" %}</a></li>
  101 + <li><a href="{% url 'login' %}">{% trans "Login" %}</a></li>
  102 + </ul>
  103 + </li>
  104 + {% trans 'Login' as login_text %}
  105 + <li class="visible-xs hidden-sm hidden-md"><a href="{% url 'signup' %}">{% trans "Register" %}</a></li>
  106 + <li class="visible-xs hidden-sm hidden-md"><a href="{% url 'login' %}">{% trans "Login" %}</a></li>
  107 + {% else %}
  108 + <li id="user-menu" class="dropdown">
  109 + <a href="#" class="dropdown-toggle user" data-toggle="dropdown">{% gravatar user.email 40 %} <b class="caret"></b>&nbsp;&nbsp;</a>
  110 + <ul class="dropdown-menu" role="menu">
  111 + <li>
  112 + <div class="wrapper">
  113 + <div class="thumbnail">{% gravatar user.email 100 %}</div>
  114 + <div class="user-info">
  115 + <span><b>{{ user.get_full_name }}</b></span>
  116 + <span class="quiet">{{ user.email }}</span>
  117 + </div>
  118 + <div>
  119 + <a class="btn btn-info pull-left" href="{% url 'user_profile' user.username %}">{% trans "My Profile" %}</a>
  120 + {% trans 'Logout' as logout_text %}
  121 + <a class="btn btn-default pull-right" href="{% url 'logout' %}"> {% trans "Logout" %}</a>
  122 + </div>
  123 + </div>
  124 + </li>
  125 + </ul>
  126 + </li>
  127 + {% endif %}
  128 + </ul>
  129 +
  130 + <form action="{% url 'haystack_search' %}" method="GET" id="search-form" class="navbar-form navbar-right hidden-xs hidden-sm" role="search">
  131 + <div class="form-group">
  132 + <label class="sr-only" for="header-searchbox">{% trans 'Search here...' %}</label>
  133 + <input name="q" id="header-searchbox"
  134 + class="form-control" value="{{ request.GET.q }}"
  135 + type="search" placeholder="{% trans 'Search here...' %}" />
  136 + </div>
  137 + <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button>
  138 + </form>
  139 + </div>
  140 + </div>
  141 + </nav>
75 142  
76 143 {% endblock %}
77 144  
... ... @@ -107,19 +174,8 @@
107 174  
108 175 {% endblock %}
109 176  
110   - {% if not is_mobile %}
111   - {% conversejs_chatpanel %}
112   - {% conversejs_initialize %}
113   - {% endif %}
114   -
115 177 {% include "tz/set_utc_offset.html" %}
116 178  
117   - {% if BROWSERID_ENABLED %}
118   - <script src="https://login.persona.org/include.js"></script>
119   - <script src="{% static 'browserid/api.js' %}"></script>
120   - <script src="{% static 'browserid/browserid.js' %}"></script>
121   - {% endif %}
122   -
123 179 {% block footer_js %}{% endblock %}
124 180 </body>
125 181 </html>
... ...
colab/templates/footer.html
1   -{% load i18n browserid conversejs gravatar %}
  1 +{% load i18n gravatar plugins %}
2 2 {% load static from staticfiles %}
3 3  
4 4 <div class="footer row">
... ...
colab/templates/header.html
1   -{% load i18n browserid conversejs gravatar plugins %}
  1 +{% load i18n gravatar plugins %}
2 2 {% load static from staticfiles %}
3 3  
4 4 <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
... ... @@ -21,12 +21,6 @@
21 21 <a href="{% url 'thread_list' %}">{% trans "Groups" %}</a>
22 22 </li>
23 23  
24   - {% if feedzilla %}
25   - <li>
26   - <a href="{% url "feedzilla_index" %}">{% trans "Blogs" %}</a>
27   - </li>
28   - {% endif %}
29   -
30 24 {% plugins_menu %}
31 25  
32 26 <li><a href="/paste">{% trans "Paste" %}</a></li>
... ...
colab/urls.py
... ... @@ -30,16 +30,12 @@ urlpatterns = patterns(&#39;&#39;,
30 30 url(r'^myaccount/(?P<route>.*)$',
31 31 'colab.accounts.views.myaccount_redirect', name='myaccount'),
32 32  
33   - url(r'', include('django_browserid.urls')),
34   -
35 33 # Uncomment the next line to enable the admin:
36 34 url(r'^colab/admin/', include(admin.site.urls)),
37 35  
38   - url(r'^trac/', include('colab.plugins.trac.urls')),
39 36 url(r'^gitlab/', include('colab.plugins.gitlab.urls')),
40 37 url(r'^mezuro/', include('colab.plugins.mezuro.urls')),
41 38 url(r'^social/', include('colab.plugins.noosfero.urls')),
42   - url(r'^ci/', include('colab.plugins.jenkins.urls')),
43 39  
44 40 url(r'', include('colab.plugins.urls')),
45 41 )
... ...
docs/source/user.rst
... ... @@ -139,31 +139,6 @@ Social Networks
139 139 When this variable is True, the social networks fields, like Facebook and
140 140 Twitter, are added in user profile. By default, this fields are disabled.
141 141  
142   -Auth
143   -++++
144   -.. attribute:: BROWSERID_ENABLED
145   -
146   - :default: False
147   -
148   - When this variable is True, Colab use BrowserID authentication. By default,
149   - django authentication system is used.
150   -
151   -.. attribute:: BROWSERID_AUDIENCES
152   -
153   - :default: No default
154   -
155   - List of audiences that your site accepts. An audience is the protocol,
156   - domain name, and (optionally) port that users access your site from. This
157   - list is used to determine the audience a user is part of (how they are
158   - accessing your site), which is used during verification to ensure that the
159   - assertion given to you by the user was intended for your site.
160   -
161   - Without this, other sites that the user has authenticated with via Persona
162   - could use their assertions to impersonate the user on your site.
163   -
164   - Note that this does not have to be a publicly accessible URL, so local URLs
165   - like ``http://localhost:8000`` or ``http://127.0.0.1`` are acceptable as
166   - long as they match what you are using to access your site.
167 142  
168 143 Customization
169 144 -------------
... ...
setup.py
... ... @@ -29,20 +29,8 @@ REQUIREMENTS = [
29 29 'raven==3.5.2',
30 30 'tornado==3.1.1',
31 31  
32   - # Deps for Single SignOn (SSO) - Replaced with django-browserid==0.9
33   - 'django-browserid==0.11',
34 32 'django-revproxy==0.9.0',
35 33  
36   - # Converse.js (XMPP client)
37   - 'django-conversejs==0.3.4',
38   -
39   - # Feedzilla (planet) and deps
40   - 'django-common==0.1.51',
41   - 'feedparser==5.1.3',
42   - 'lxml==3.2.4',
43   - 'grab==0.4.13',
44   - 'transliterate==1.5',
45   -
46 34 # Diazo
47 35 'diazo==1.0.5',
48 36  
... ...
    9fe63c7bd60deeb55e409a1d7dd173f5?s=40&d=identicon
    Sergio Oliveira started a discussion on the outdated diff
    last updated by Gustavo Jaruga Cruz
    setup.py
    29 29 'raven==3.5.2',
    30 30 'tornado==3.1.1',
    31 31  
    32   - # Deps for Single SignOn (SSO) - Replaced with django-browserid==0.9
    33   - 'django-browserid==0.11',
    34 32 'django-revproxy==0.9.0',
    35 33  
    36   - # Converse.js (XMPP client)
    37   - 'django-conversejs==0.3.4',
    38   -
    39 34 # Feedzilla (planet) and deps
    2
  • C6b14af78e51fba6beb90142971240cc?s=40&d=identicon
    Gustavo Jaruga Cruz @darksshades

    Added 1 new commit:

    • e2e2afd0 - Remove feedzilla residual code
    Choose File ...   File name...
    Cancel