allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [02/12] allura git commit: Added refresh commits button. Changed template to show buttons in merge request buttons one row
Date Tue, 12 Jul 2016 14:04:27 GMT
Added refresh commits button. Changed template to show buttons in merge request buttons one
row


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

Branch: refs/heads/db/3593
Commit: f71b1f23d679d92c04f345509aa92b5228c78a58
Parents: 11886e8
Author: Rohan Verma <rohanverma2004@gmail.com>
Authored: Fri Jun 24 18:48:25 2016 +0530
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Mon Jul 11 11:05:39 2016 -0400

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py         |  9 +++++
 Allura/allura/templates/repo/merge_request.html | 39 ++++++++++++--------
 .../templates/repo/merge_request_edit.html      |  4 +-
 3 files changed, 35 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/f71b1f23/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 39e3516..4d8abd5 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -468,6 +468,15 @@ class MergeRequestController(object):
 
     @expose()
     @require_post()
+    @validate(mr_dispose_form)
+    def refresh(self, **kw):
+        require_access(self.req, 'write')
+        with self.req.push_downstream_context():
+            self.req.downstream['commit_id'] = c.app.repo.commit(self.req.source_branch)._id
+        redirect(self.req.url())
+
+    @expose()
+    @require_post()
     def merge(self):
         if not self.req.merge_allowed(c.user) or not self.req.can_merge():
             raise exc.HTTPNotFound

http://git-wip-us.apache.org/repos/asf/allura/blob/f71b1f23/Allura/allura/templates/repo/merge_request.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/merge_request.html b/Allura/allura/templates/repo/merge_request.html
index cccd92f..d3b3081 100644
--- a/Allura/allura/templates/repo/merge_request.html
+++ b/Allura/allura/templates/repo/merge_request.html
@@ -73,34 +73,43 @@ Merge Request #{{req.request_number}}: {{req.summary}} ({{req.status}})
     {% endif %}
 
     {% if req.merge_allowed(c.user) %}
-      <div class="grid-19">
-        <form action="merge" method="POST">
-          {{ lib.csrf_token() }}
-          <input id="merge-btn" type="submit" value="Merge"{% if not can_merge or merge_status
in ('ready', 'busy') %}disabled="disabled"{% endif %}>
-          <div class="merge-help-text can-merge-in-progress" {% if can_merge == None %}style="display:
block;"{% endif %}>
+    <div class='grid-19 merge-help'>
+        <div class="merge-help-text can-merge-in-progress" {% if can_merge == None %}style="display:
block;"{% endif %}>
             Checking if merge is possible...
-          </div>
-          <div class="merge-help-text merge-ok" {% if can_merge == True %}style="display:
block;"{% endif %}>
+        </div>
+        <div class="merge-help-text merge-ok" {% if can_merge == True %}style="display:
block;"{% endif %}>
             Merge request has no conflicts. You can merge automatically.
-          </div>
-          <div class="merge-help-text merge-conflicts" {% if can_merge == False %}style="display:
block;"{% endif %}>
+        </div>
+        <div class="merge-help-text merge-conflicts" {% if can_merge == False %}style="display:
block;"{% endif %}>
             Merge request has conflicts. Follow manual instructions below to merge.
-          </div>
+        </div>
+    </div>
+    {% endif %}
+
+    <div class="grid-19 merge-toolbar">
+    {% if req.merge_allowed(c.user) %}
+        <form action="merge" method="POST">
+          {{ lib.csrf_token() }}
+          <input id="merge-btn" type="submit" value="Merge"{% if not can_merge or merge_status
in ('ready', 'busy') %}disabled="disabled"{% endif %}>
         </form>
-      </div>
     {% endif %}
 
     {% if req.creator == c.user and req.status == "open" %}
-    <div class="grid-19">
         <form action="save" method="POST">
             {{ lib.csrf_token() }}
-            <input type="hidden" value="rejected" name="status"></input>
+            <input type="hidden" value="rejected" name="status">
             <input id="reject-btn" type="submit" value="Reject">
-            <p style="color:red;">Click to reject the merge request.</p>
         </form>
-    </div>
+
+        <form action="refresh" method="POST">
+            {{ lib.csrf_token() }}
+            <input id="refresh-btn" type="submit" value="Refresh Commits">
+            <input type="hidden" value="{{req.source_branch}}" name="source_branch">
+        </form>
     {% endif %}
 
+    </div>
+
     {{ c.log_widget.display(value=commits, app=downstream_app) }}
 
     <div class="grid-19"><a href="#discussion_holder">Discuss</a></div>

http://git-wip-us.apache.org/repos/asf/allura/blob/f71b1f23/Allura/allura/templates/repo/merge_request_edit.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/merge_request_edit.html b/Allura/allura/templates/repo/merge_request_edit.html
index 28346d9..57ad083 100644
--- a/Allura/allura/templates/repo/merge_request_edit.html
+++ b/Allura/allura/templates/repo/merge_request_edit.html
@@ -19,10 +19,10 @@
 {% extends 'allura:templates/repo/repo_master.html' %}
 
 {% block title %}
-  {{c.project.name}} / {{c.app.config.options.mount_label}} / Request merge
+  {{c.project.name}} / {{c.app.config.options.mount_label}} / Request Merge
 {% endblock %}
 
-{% block header %}Update merge request{% endblock %}
+{% block header %}Update Merge Request{% endblock %}
 
 {% block content %}
   {{ c.form.display(action='do_request_merge_edit', value=dict(source_branch=source_branch,
target_branch=target_branch, description=description, summary=summary))}}


Mime
View raw message