allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [02/40] git commit: Remove fork listing from changehistory page
Date Mon, 01 Apr 2013 14:27:21 GMT
Remove fork listing from changehistory page


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/a09148cf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a09148cf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a09148cf

Branch: refs/heads/cj/5963
Commit: a09148cfcb1bdda431d935c5498ea33f892352e1
Parents: d2678d1
Author: Wayne Witzel III <wwitzel@geek.net>
Authored: Mon Mar 18 21:40:03 2013 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Tue Mar 26 18:15:12 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py |   15 +++++++++++++++
 Allura/allura/lib/repository.py         |   12 ++++--------
 Allura/allura/templates/repo/forks.html |   13 +++++++++++++
 3 files changed, 32 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a09148cf/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index d0c5a26..e110e10 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -34,6 +34,7 @@ from allura.lib.widgets import form_fields as ffw
 from allura.controllers.base import DispatchIndex
 from allura.lib.diff import HtmlSideBySideDiff
 from paste.deploy.converters import asbool
+from allura.app import SitemapEntry
 from .base import BaseController
 
 log = logging.getLogger(__name__)
@@ -58,6 +59,20 @@ class RepoRootController(BaseController):
         redirect(url(quote('%s%s/' % (
                         branch, c.app.END_OF_REF_ESCAPE))))
 
+    @with_trailing_slash
+    @expose('jinja:allura:templates/repo/forks.html')
+    def forks(self):
+
+        links = []
+        if c.app.repo.forks:
+            for f in c.app.repo.forks:
+                repo_path_parts = f.url().strip('/').split('/')
+                links.append(dict(
+                    repo_url=f.url(),
+                    repo = '%s / %s' % (repo_path_parts[1], repo_path_parts[-1]),
+                ))
+        return dict(links=links)
+
     @expose()
     def refresh(self):
         allura.tasks.repo_tasks.refresh.post()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a09148cf/Allura/allura/lib/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index 383ef30..7fbb0bb 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -96,6 +96,10 @@ class RepositoryApp(Application):
                 SitemapEntry(
                     'Merge Requests', c.app.url + 'merge-requests/',
                     small=merge_request_count) ]
+        if self.repo.forks:
+            links += [
+                SitemapEntry('Forks', c.app.url + 'forks/', small=len(self.repo.forks))
+            ]
         if self.repo.upstream_repo.name:
             repo_path_parts = self.repo.upstream_repo.name.strip('/').split('/')
             links += [
@@ -135,14 +139,6 @@ class RepositoryApp(Application):
                             default_branch_url+'tags/',
                             ))
                     break
-        if self.repo.forks:
-            links.append(SitemapEntry('Forks'))
-            for f in self.repo.forks:
-                repo_path_parts = f.url().strip('/').split('/')
-                links.append(SitemapEntry(
-                    '%s / %s' %
-                    (repo_path_parts[1], repo_path_parts[-1]),
-                    f.url()))
         return links
 
     def install(self, project):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a09148cf/Allura/allura/templates/repo/forks.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/forks.html b/Allura/allura/templates/repo/forks.html
new file mode 100644
index 0000000..a8cb7b8
--- /dev/null
+++ b/Allura/allura/templates/repo/forks.html
@@ -0,0 +1,13 @@
+{% extends 'allura:templates/repo/repo_master.html' %}
+
+{% block title %}{{c.project.name}} / {{c.app.config.options.mount_label}} / Forks{% endblock
%}
+
+{% block header %}Forks{% endblock %}
+
+{% block content %}
+<ul>
+{% for link in links %}
+<li><a href="{{link.repo_url}}">{{link.repo}}</a></li>
+{% endfor %}
+</ul>
+{% endblock %}


Mime
View raw message