# HG changeset patch # User Marcin Kuzminski # Date 2012-06-14 09:48:51 # Node ID 51b203e442024aa5e2c5219dd808b107fe636594 # Parent f71d4038076876212452995c44660e314b817934 Add authors into file view diff --git a/rhodecode/controllers/files.py b/rhodecode/controllers/files.py --- a/rhodecode/controllers/files.py +++ b/rhodecode/controllers/files.py @@ -154,9 +154,14 @@ class FilesController(BaseRepoController c.file = c.changeset.get_node(f_path) if c.file.is_file(): - c.file_history = self._get_node_history(c.changeset, f_path) + _hist = c.changeset.get_file_history(f_path) + c.file_history = self._get_node_history(c.changeset, f_path, + _hist) + c.authors = [] + for a in set([x.author for x in _hist]): + c.authors.append((h.email(a), h.person(a))) else: - c.file_history = [] + c.authors = c.file_history = [] except RepositoryError, e: h.flash(str(e), category='warning') redirect(h.url('files_home', repo_name=repo_name, @@ -454,8 +459,9 @@ class FilesController(BaseRepoController return render('files/file_diff.html') - def _get_node_history(self, cs, f_path): - changesets = cs.get_file_history(f_path) + def _get_node_history(self, cs, f_path, changesets=None): + if changesets is None: + changesets = cs.get_file_history(f_path) hist_l = [] changesets_group = ([], _("Changesets")) diff --git a/rhodecode/public/css/style.css b/rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css +++ b/rhodecode/public/css/style.css @@ -2252,6 +2252,20 @@ h3.files_location { padding: 5px !important; } +.file_history{ + padding-top:10px; + font-size:16px; +} +.file_author{ + float: left; +} + +.file_author .item{ + float:left; + padding:5px; + color: #888; +} + .tablerow0 { background-color: #F8F8F8; } diff --git a/rhodecode/templates/files/files_source.html b/rhodecode/templates/files/files_source.html --- a/rhodecode/templates/files/files_source.html +++ b/rhodecode/templates/files/files_source.html @@ -1,15 +1,27 @@
-
${_('History')}
+
${_('History')}
-
- ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')} - ${h.hidden('diff2',c.file.changeset.raw_id)} - ${h.select('diff1',c.file.changeset.raw_id,c.file_history)} - ${h.submit('diff',_('diff to revision'),class_="ui-btn")} - ${h.submit('show_rev',_('show at revision'),class_="ui-btn")} - ${h.end_form()} -
+
+
+ ${h.form(h.url('files_diff_home',repo_name=c.repo_name,f_path=c.f_path),method='get')} + ${h.hidden('diff2',c.file.changeset.raw_id)} + ${h.select('diff1',c.file.changeset.raw_id,c.file_history)} + ${h.submit('diff',_('diff to revision'),class_="ui-btn")} + ${h.submit('show_rev',_('show at revision'),class_="ui-btn")} + ${h.end_form()} +
+
+
${h.literal(ungettext(u'%s author',u'%s authors',len(c.authors)) % ('%s' % len(c.authors))) }
+ %for email, user in c.authors: +
+
gravatar
+
+ %endfor +
+
+
+