Show More
@@ -52,23 +52,23 b' class FeedController(BaseRepoController)' | |||||
52 | self.feed_nr = 10 |
|
52 | self.feed_nr = 10 | |
53 |
|
53 | |||
54 | def __changes(self, cs): |
|
54 | def __changes(self, cs): | |
55 |
changes = |
|
55 | changes = [] | |
56 |
|
56 | |||
57 | a = [safe_unicode(n.path) for n in cs.added] |
|
57 | a = [safe_unicode(n.path) for n in cs.added] | |
58 | if a: |
|
58 | if a: | |
59 |
changes |
|
59 | changes.append('\nA ' + '\nA '.join(a)) | |
60 |
|
60 | |||
61 | m = [safe_unicode(n.path) for n in cs.changed] |
|
61 | m = [safe_unicode(n.path) for n in cs.changed] | |
62 | if m: |
|
62 | if m: | |
63 |
changes |
|
63 | changes.append('\nM ' + '\nM '.join(m)) | |
64 |
|
64 | |||
65 | d = [safe_unicode(n.path) for n in cs.removed] |
|
65 | d = [safe_unicode(n.path) for n in cs.removed] | |
66 | if d: |
|
66 | if d: | |
67 |
changes |
|
67 | changes.append('\nD ' + '\nD '.join(d)) | |
68 |
|
68 | |||
69 |
changes |
|
69 | changes.append('</pre>') | |
70 |
|
70 | |||
71 | return changes |
|
71 | return ''.join(changes) | |
72 |
|
72 | |||
73 | def atom(self, repo_name): |
|
73 | def atom(self, repo_name): | |
74 | """Produce an atom-1.0 feed via feedgenerator module""" |
|
74 | """Produce an atom-1.0 feed via feedgenerator module""" | |
@@ -78,16 +78,16 b' class FeedController(BaseRepoController)' | |||||
78 | description=self.description % repo_name, |
|
78 | description=self.description % repo_name, | |
79 | language=self.language, |
|
79 | language=self.language, | |
80 | ttl=self.ttl) |
|
80 | ttl=self.ttl) | |
81 |
|
81 | desc_msg = [] | ||
82 | for cs in reversed(list(c.rhodecode_repo[-self.feed_nr:])): |
|
82 | for cs in reversed(list(c.rhodecode_repo[-self.feed_nr:])): | |
83 |
desc |
|
83 | desc_msg.append('%s - %s<br/><pre>' % (cs.author, cs.date)) | |
84 |
desc |
|
84 | desc_msg.append(self.__changes(cs)) | |
85 |
|
85 | |||
86 | feed.add_item(title=cs.message, |
|
86 | feed.add_item(title=cs.message, | |
87 | link=url('changeset_home', repo_name=repo_name, |
|
87 | link=url('changeset_home', repo_name=repo_name, | |
88 | revision=cs.raw_id, qualified=True), |
|
88 | revision=cs.raw_id, qualified=True), | |
89 | author_name=cs.author, |
|
89 | author_name=cs.author, | |
90 | description=desc) |
|
90 | description=''.join(desc_msg)) | |
91 |
|
91 | |||
92 | response.content_type = feed.mime_type |
|
92 | response.content_type = feed.mime_type | |
93 | return feed.writeString('utf-8') |
|
93 | return feed.writeString('utf-8') | |
@@ -100,16 +100,16 b' class FeedController(BaseRepoController)' | |||||
100 | description=self.description % repo_name, |
|
100 | description=self.description % repo_name, | |
101 | language=self.language, |
|
101 | language=self.language, | |
102 | ttl=self.ttl) |
|
102 | ttl=self.ttl) | |
103 |
|
103 | desc_msg = [] | ||
104 | for cs in reversed(list(c.rhodecode_repo[-self.feed_nr:])): |
|
104 | for cs in reversed(list(c.rhodecode_repo[-self.feed_nr:])): | |
105 |
desc |
|
105 | desc_msg.append('%s - %s<br/><pre>' % (cs.author, cs.date)) | |
106 |
desc |
|
106 | desc_msg.append(self.__changes(cs)) | |
107 |
|
107 | |||
108 | feed.add_item(title=cs.message, |
|
108 | feed.add_item(title=cs.message, | |
109 | link=url('changeset_home', repo_name=repo_name, |
|
109 | link=url('changeset_home', repo_name=repo_name, | |
110 | revision=cs.raw_id, qualified=True), |
|
110 | revision=cs.raw_id, qualified=True), | |
111 | author_name=cs.author, |
|
111 | author_name=cs.author, | |
112 | description=desc, |
|
112 | description=''.join(desc_msg), | |
113 | ) |
|
113 | ) | |
114 |
|
114 | |||
115 | response.content_type = feed.mime_type |
|
115 | response.content_type = feed.mime_type |
@@ -376,12 +376,12 b' def action_parser(user_log, feed=False):' | |||||
376 | invalidation_list=[]) |
|
376 | invalidation_list=[]) | |
377 |
|
377 | |||
378 | message = lambda rev: get_changeset_safe(repo, rev).message |
|
378 | message = lambda rev: get_changeset_safe(repo, rev).message | |
379 |
|
379 | cs_links = [] | ||
380 |
cs_links |
|
380 | cs_links.append(" " + ', '.join ([link_to(rev, | |
381 | url('changeset_home', |
|
381 | url('changeset_home', | |
382 | repo_name=repo_name, |
|
382 | repo_name=repo_name, | |
383 | revision=rev), title=tooltip(message(rev)), |
|
383 | revision=rev), title=tooltip(message(rev)), | |
384 | class_='tooltip') for rev in revs[:revs_limit] ]) |
|
384 | class_='tooltip') for rev in revs[:revs_limit] ])) | |
385 |
|
385 | |||
386 | compare_view = (' <div class="compare_view tooltip" title="%s">' |
|
386 | compare_view = (' <div class="compare_view tooltip" title="%s">' | |
387 | '<a href="%s">%s</a> ' |
|
387 | '<a href="%s">%s</a> ' | |
@@ -399,23 +399,23 b' def action_parser(user_log, feed=False):' | |||||
399 | '<a class="show_more" id="_%s" href="#more">%s</a> ' |
|
399 | '<a class="show_more" id="_%s" href="#more">%s</a> ' | |
400 | '%s</span>') |
|
400 | '%s</span>') | |
401 | if not feed: |
|
401 | if not feed: | |
402 |
cs_links |
|
402 | cs_links.append(html_tmpl % (_('and'), uniq_id, _('%s more') \ | |
403 | % (len(revs) - revs_limit), |
|
403 | % (len(revs) - revs_limit), | |
404 | _('revisions')) |
|
404 | _('revisions'))) | |
405 |
|
405 | |||
406 | if not feed: |
|
406 | if not feed: | |
407 | html_tmpl = '<span id="%s" style="display:none"> %s </span>' |
|
407 | html_tmpl = '<span id="%s" style="display:none"> %s </span>' | |
408 | else: |
|
408 | else: | |
409 | html_tmpl = '<span id="%s"> %s </span>' |
|
409 | html_tmpl = '<span id="%s"> %s </span>' | |
410 |
|
410 | |||
411 |
cs_links |
|
411 | cs_links.append(html_tmpl % (uniq_id, ', '.join([link_to(rev, | |
412 | url('changeset_home', |
|
412 | url('changeset_home', | |
413 | repo_name=repo_name, revision=rev), |
|
413 | repo_name=repo_name, revision=rev), | |
414 | title=message(rev), class_='tooltip') |
|
414 | title=message(rev), class_='tooltip') | |
415 | for rev in revs[revs_limit:revs_top_limit]])) |
|
415 | for rev in revs[revs_limit:revs_top_limit]]))) | |
416 | if len(revs) > 1: |
|
416 | if len(revs) > 1: | |
417 |
cs_links |
|
417 | cs_links.append(compare_view) | |
418 | return cs_links |
|
418 | return ''.join(cs_links) | |
419 |
|
419 | |||
420 | def get_fork_name(): |
|
420 | def get_fork_name(): | |
421 | repo_name = action_params |
|
421 | repo_name = action_params |
General Comments 0
You need to be logged in to leave comments.
Login now