You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/05/08 00:31:00 UTC

[18/50] [abbrv] git commit: [#5773] ticket:314 added full commit message, full date, download link in History view

[#5773] ticket:314 added full commit message, full date, download link in History view


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

Branch: refs/heads/tv/3876
Commit: e14b56ee7bcdc4a1abca954351caa5ef1135cfc2
Parents: a9b5b11
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Fri Apr 19 11:38:44 2013 +0400
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu May 2 20:37:02 2013 +0000

----------------------------------------------------------------------
 Allura/allura/templates/widgets/repo/log.html      |   59 ++++++++++----
 .../forgegit/tests/functional/test_controllers.py  |   12 ++-
 .../forgesvn/tests/functional/test_controllers.py  |    4 +-
 3 files changed, 53 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e14b56ee/Allura/allura/templates/widgets/repo/log.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/repo/log.html b/Allura/allura/templates/widgets/repo/log.html
index d7307a5..11fa918 100644
--- a/Allura/allura/templates/widgets/repo/log.html
+++ b/Allura/allura/templates/widgets/repo/log.html
@@ -33,30 +33,55 @@
       {% for commit in value %}
         <tr class="rev">
           <td>
-            {%if is_file%}
+            <div class="grid-14">
+                {%if is_file%}
                 <div class="grid-1"><input type="checkbox" class="revision" revision="{{commit._id.split(':')[-1]}}" url_commit="{{commit.url()}}"></div>
-            {%endif%}
-            {{commit.summary}}
-            <br/>
-            {% if commit.committed.email != commit.authored.email %}
-              {% if commit.committer_url %}
+                {%endif%}
+                {%for tag in c.app.repo.symbolics_for_commit(commit)[1]%}
+                        <a href="{{c.app.repo.url()}}ci/{{tag}}/tree{{request.params.get('path')}}">{{tag}}</a>
+                {%endfor%}
+                {% if commit.committed.email != commit.authored.email %}
+                {% if commit.committer_url %}
                 <a href="{{commit.committer_url}}">{{email_gravatar(commit.committed.email, title=commit.committed.name, size=16)}}
-                {{commit.committed.name}}</a>
+                    {{commit.committed.name}}</a>
                 pushed
-              {% else %}
+                {% else %}
                 {{email_gravatar(commit.committed.email, title=commit.committed.name, size=16)}} {{commit.committed.name}}
                 pushed
-              {% endif %}
-            {% endif %}
-             <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a>
-            by
-              {{email_gravatar(commit.authored.email, title=commit.authored.name, size=16)}} {{commit.authored.name}}
+                {% endif %}
+                {% endif %}
+                <a href="{{commit.url()}}">{{commit.shorthand_id()}}</a>
+                by
+                {{email_gravatar(commit.authored.email, title=commit.authored.name, size=16)}} {{commit.authored.name}}
+                {%if is_file%}
+                    {%if request.params.get('path')[:1]=='/'%}
+                        {%set path = request.params.get('path')[1:]%}
+                    {%else%}
+                        {%set path = request.params.get('path')%}
+                    {%endif%}
+
+                    {{commit.tree.get_blob(path).size}} Bytes
+                {%endif%}
+            </div>
+            <div>
+              {{g.markdown.convert(commit.message)}}
+            </div>
           </td>
-          <td>
-            {% if commit.committed.date %}{{abbr_date(commit.committed.date)}}{% endif %}
+          <td style="vertical-align: text-top">
+            {% if commit.committed.date %}{{commit.committed.date}}{% endif %}
           </td>
-          <td style="text-align: right">
-            <a href="{{commit.url()}}tree/">Tree</a>
+          <td style="text-align: left; vertical-align: text-top">
+            <a href="{{commit.url()}}tree{{request.params.get('path')}}">
+            {%if is_file%}
+                View
+            {% else %}
+                Tree
+            {%endif%}
+            </a>
+              {%if is_file%}
+              <br/>
+              <a href="{{commit.url()}}tree{{request.params.get('path')}}?format=raw ">Download</a>
+              {%endif%}
           </td>
         </tr>
       {% endfor %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e14b56ee/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 186b46a..78ff5a9 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -110,10 +110,16 @@ class TestRootController(_TestCase):
     def test_log(self):
         resp = self.app.get('/src-git/ci/1e146e67985dcd71c74de79613719bef7bddca4a/log/')
         assert 'Initial commit' in resp
-        assert 'Change README' in resp
+        assert '<div class="markdown_content"><p>Change README</p></div>' in resp
+        assert 'tree/README?format=raw ">Download</a>' not in resp
+        assert'28 Bytes' not in resp.html.find('td').contents[1].text
+        assert 'Tree' in resp.html.findAll('td')[2].text, resp.html.findAll('td')[2].text
         resp = self.app.get('/src-git/ci/1e146e67985dcd71c74de79613719bef7bddca4a/log/?path=/README')
-        assert 'Change README ' in resp
-        assert 'Add README ' in resp
+        assert'28 Bytes' in resp.html.find('td').contents[1].text
+        assert 'View' in resp.html.findAll('td')[2].text
+        assert 'Change README' in resp
+        assert 'tree/README?format=raw ">Download</a>' in resp
+        assert 'Add README' in resp
         assert "Initial commit " not in resp
         resp = self.app.get('/src-git/ci/1e146e67985dcd71c74de79613719bef7bddca4a/log/?path=/a/b/c/')
         assert 'Remove file' in resp

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e14b56ee/ForgeSVN/forgesvn/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/functional/test_controllers.py b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
index 90af545..9ab3b57 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -138,10 +138,10 @@ class TestRootController(SVNTestController):
         assert 'Create readme' in r
         r = self.app.get('/src/2/log/?path=')
         assert "Create readme" in r
-        assert "Add path " in r
+        assert "Add path" in r
         r = self.app.get('/src/2/log/?path=README')
         assert "Modify readme" not in r
-        assert "Create readme " in r
+        assert "Create readme" in r
         r = self.app.get('/src/2/log/?path=/a/b/c/')
         assert 'Add path' in r
         assert 'Remove hello.txt' not in r