Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CFB4E117DD for ; Fri, 21 Feb 2014 17:37:13 +0000 (UTC) Received: (qmail 70443 invoked by uid 500); 21 Feb 2014 17:37:11 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 70390 invoked by uid 500); 21 Feb 2014 17:37:11 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 70355 invoked by uid 99); 21 Feb 2014 17:37:09 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Feb 2014 17:37:09 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E8A4382E90B; Fri, 21 Feb 2014 17:37:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tvansteenburgh@apache.org To: allura-commits@incubator.apache.org Date: Fri, 21 Feb 2014 17:37:09 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/4] git commit: [#6164] ticket:537 add test, fix controler for anonimus user, fix template and css [#6164] ticket:537 add test, fix controler for anonimus user, fix template and css Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/ee36ba2a Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ee36ba2a Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ee36ba2a Branch: refs/heads/master Commit: ee36ba2ac9d4b815675fb96c1aaf2efe3192e19f Parents: 108e2ef Author: tramzzz Authored: Tue Feb 18 14:42:28 2014 +0200 Committer: Tim Van Steenburgh Committed: Fri Feb 21 17:35:57 2014 +0000 ---------------------------------------------------------------------- Allura/allura/controllers/repository.py | 5 +++ Allura/allura/nf/allura/css/site_style.css | 6 ++-- .../tests/functional/test_controllers.py | 33 ++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ee36ba2a/Allura/allura/controllers/repository.py ---------------------------------------------------------------------- diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py index e359885..547af55 100644 --- a/Allura/allura/controllers/repository.py +++ b/Allura/allura/controllers/repository.py @@ -381,6 +381,8 @@ class MergeRequestController(object): @expose('jinja:allura:templates/repo/merge_request_edit.html') def edit(self, **kw): + security.require( + security.has_access(self.req, 'write'), 'Write access required') c.form = self.mr_widget_edit if self.req['source_branch'] in c.form.source_branches: source_branch = self.req['source_branch'] @@ -400,8 +402,11 @@ class MergeRequestController(object): @expose() @require_post() def do_request_merge_edit(self, **kw): + security.require( + security.has_access(self.req, 'write'), 'Write access required') kw = self.mr_widget_edit.to_python(kw) mr = M.MergeRequest.query.get(request_number=self.req['request_number']) + mr.summary = kw['summary'] mr.target_branch = kw['target_branch'] mr.source_branch = kw['source_branch'] mr.description = kw['description'] http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ee36ba2a/Allura/allura/nf/allura/css/site_style.css ---------------------------------------------------------------------- diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css index cd28a15..77009c4 100644 --- a/Allura/allura/nf/allura/css/site_style.css +++ b/Allura/allura/nf/allura/css/site_style.css @@ -3294,6 +3294,8 @@ ul.dropdown ul li a:hover { text-align: right; padding: 5px 10px 5px 0; } -.markdown_preview.btn.edit{ - margin-left: 10px; +.markdown_preview.btn.edit { + margin-left: 240px; + margin-top: -35px; + padding: 4px 13px 3px; } http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ee36ba2a/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 3badb92..798c77a 100644 --- a/ForgeGit/forgegit/tests/functional/test_controllers.py +++ b/ForgeGit/forgegit/tests/functional/test_controllers.py @@ -599,6 +599,39 @@ class TestFork(_TestCase): 'description': 'description'}).follow() assert '[5c4724]' in r + def test_merge_request_edit(self): + r = self.app.post('/p/test2/code/do_request_merge', + params={ + 'source_branch': 'zz', + 'target_branch': 'master', + 'summary': 'summary', + 'description': 'description'}).follow() + assert 'href="edit">Edit' in r + r = self.app.get('/p/test/src-git/merge-requests/1/edit') + assert 'value="summary"' in r + assert 'name="description">description' in r + assert '' in r + + r = self.app.post('/p/test/src-git/merge-requests/1/do_request_merge_edit', + params={ + 'source_branch': 'zz', + 'target_branch': 'master', + 'summary': 'changed summary', + 'description': 'changed description'}, + extra_environ=dict(username='*anonymous'), status=302).follow() + assert 'Login' in r + + r = self.app.post('/p/test/src-git/merge-requests/1/do_request_merge_edit', + params={ + 'source_branch': 'zz', + 'target_branch': 'master', + 'summary': 'changed summary', + 'description': 'changed description'}).follow() + assert '

changed descriptionchanged summary' in r + class TestDiff(TestController):