Commit 1ba623cd337ac9aae91d3236f3d437faae5bbcb3

Authored by Sergio Oliveira
2 parents 692253bb a70fae9a

Merge branch 'master' of portal.softwarepublico.gov.br:softwarepublico/colab

@@ -2,6 +2,7 @@ include README.rst @@ -2,6 +2,7 @@ include README.rst
2 include MANIFEST.in 2 include MANIFEST.in
3 recursive-include colab/static * 3 recursive-include colab/static *
4 recursive-include colab/locale * 4 recursive-include colab/locale *
  5 +recursive-include colab/super_archives/locale *
5 recursive-include colab/proxy/noosfero/static * 6 recursive-include colab/proxy/noosfero/static *
6 recursive-include colab *.html *.txt *.xml 7 recursive-include colab *.html *.txt *.xml
7 recursive-include misc * 8 recursive-include misc *
colab/plugins/gitlab/migrations/0004_auto_20150630_1149.py 0 → 100644
@@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
  1 +# -*- coding: utf-8 -*-
  2 +from __future__ import unicode_literals
  3 +
  4 +from django.db import models, migrations
  5 +
  6 +
  7 +class Migration(migrations.Migration):
  8 +
  9 + dependencies = [
  10 + ('gitlab', '0003_auto_20150211_1203'),
  11 + ]
  12 +
  13 + operations = [
  14 + migrations.AddField(
  15 + model_name='gitlabcomment',
  16 + name='iid',
  17 + field=models.IntegerField(null=True),
  18 + preserve_default=True,
  19 + ),
  20 + migrations.AddField(
  21 + model_name='gitlabmergerequest',
  22 + name='iid',
  23 + field=models.IntegerField(null=True),
  24 + preserve_default=True,
  25 + ),
  26 + ]
colab/plugins/gitlab/models.py
@@ -27,6 +27,7 @@ class GitlabProject(models.Model, HitCounterModelMixin): @@ -27,6 +27,7 @@ class GitlabProject(models.Model, HitCounterModelMixin):
27 class GitlabMergeRequest(Collaboration): 27 class GitlabMergeRequest(Collaboration):
28 28
29 id = models.IntegerField(primary_key=True) 29 id = models.IntegerField(primary_key=True)
  30 + iid = models.IntegerField(null=True)
30 target_branch = models.TextField() 31 target_branch = models.TextField()
31 source_branch = models.TextField() 32 source_branch = models.TextField()
32 project = models.ForeignKey(GitlabProject, null=True, 33 project = models.ForeignKey(GitlabProject, null=True,
@@ -50,7 +51,7 @@ class GitlabMergeRequest(Collaboration): @@ -50,7 +51,7 @@ class GitlabMergeRequest(Collaboration):
50 @property 51 @property
51 def url(self): 52 def url(self):
52 return u'/gitlab/{}/merge_requests/{}'.format( 53 return u'/gitlab/{}/merge_requests/{}'.format(
53 - self.project.path_with_namespace, self.id) 54 + self.project.path_with_namespace, self.iid)
54 55
55 def get_author(self): 56 def get_author(self):
56 return self.user 57 return self.user
@@ -91,6 +92,7 @@ class GitlabIssue(Collaboration): @@ -91,6 +92,7 @@ class GitlabIssue(Collaboration):
91 class GitlabComment(Collaboration): 92 class GitlabComment(Collaboration):
92 93
93 id = models.IntegerField(primary_key=True) 94 id = models.IntegerField(primary_key=True)
  95 + iid = models.IntegerField(null=True)
94 body = models.TextField() 96 body = models.TextField()
95 created_at = models.DateTimeField(blank=True, null=True) 97 created_at = models.DateTimeField(blank=True, null=True)
96 issue_comment = models.BooleanField(default=True) 98 issue_comment = models.BooleanField(default=True)
@@ -132,11 +134,12 @@ class GitlabComment(Collaboration): @@ -132,11 +134,12 @@ class GitlabComment(Collaboration):
132 @property 134 @property
133 def url(self): 135 def url(self):
134 if self.issue_comment: 136 if self.issue_comment:
135 - return u'/gitlab/{}/issues/{}#notes_{}'.format(  
136 - self.project.path_with_namespace, self.parent_id, self.id) 137 + url_str = u'/gitlab/{}/issues/{}#notes_{}'
137 else: 138 else:
138 - return u'/gitlab/{}/merge_requests/{}#notes_{}'.format(  
139 - self.project.path_with_namespace, self.parent_id, self.id) 139 + url_str = u'/gitlab/{}/merge_requests/{}#notes_{}'
  140 +
  141 + return url_str.format(self.project.path_with_namespace,
  142 + self.parent_id, self.iid)
140 143
141 class Meta: 144 class Meta:
142 verbose_name = _('Gitlab Comments') 145 verbose_name = _('Gitlab Comments')
colab/settings.py
@@ -211,6 +211,7 @@ AUTHENTICATION_BACKENDS = ( @@ -211,6 +211,7 @@ AUTHENTICATION_BACKENDS = (
211 211
212 LOCALE_PATHS = ( 212 LOCALE_PATHS = (
213 os.path.join(BASE_DIR, 'locale'), 213 os.path.join(BASE_DIR, 'locale'),
  214 + os.path.join(BASE_DIR, 'super_archives/locale'),
214 ) 215 )
215 216
216 AUTH_USER_MODEL = 'accounts.User' 217 AUTH_USER_MODEL = 'accounts.User'
colab/super_archives/locale/pt_BR/LC_MESSAGES/django.mo
No preview for this file type