Commit: d2fcde92a5421b1c0d4f04cebf4e98d15e2589f7 Author: Sobak <msobaczew...@gmail.com> Sat, 21 Mar 2015 06:45:54 +0100 Parents: b5372bb6306ec741dc49b25aae3b5fb038c803c1 Branches: master
Link: http://git.php.net/?p=web/qa.git;a=commitdiff;h=d2fcde92a5421b1c0d4f04cebf4e98d15e2589f7 Log: Quick improvements for pulls interface - changed layout of single PR to save some space - fixed GitHub user profile URL - used HTML data-* instead of non-existing attributes Changed paths: M pulls/index.php M pulls/pullrequests.js Diff: diff --git a/pulls/index.php b/pulls/index.php index 03b9a97..4c59bc3 100644 --- a/pulls/index.php +++ b/pulls/index.php @@ -32,16 +32,9 @@ common_header(); vertical-align: middle; } - .ghuser { - border: 1px solid #ffcc66; - float: right; - margin-left: 5px; - margin-bottom: 5px; - } - - .ghuser a { - color: #ffcc66; - text-decoration: none; + .pr-meta { + font-size: 0.9em; + margin-bottom: 20px; } #loginstatus { @@ -68,7 +61,7 @@ common_header(); } </style> <script id="repoListItemTemplate" type="text/x-jquery-tmpl"> - <li repo="{{=name}}"><b><a href="#">{{=name}}:</a></b> {{=description}} ({{=open_issues}})</li> + <li data-repo="{{=name}}"><b><a href="#">{{=name}}:</a></b> {{=description}} ({{=open_issues}})</li> </script> <script id="repoOverviewTemplate" type="text/x-jquery-tmpl"> <h2>{{=repoName}}</h2> @@ -79,13 +72,12 @@ common_header(); <script id="pullRequestListItem" type="text/x-jquery-tmpl"> <h3><a href='#'>{{=number}}: {{=title}} ({{=state}})</a></h3> <div class="pullrequest"> - <div class="ghuser"><a href="{{=user.url}}"><img src="{{=user.avatar_url}}"><br>{{=user.login}}</a></div> - <div>Created: {{=created_at}}, LastUpdated: {{=updated_at}}</div> + <div class="pr-meta">Created by <a href="{{=user.html_url}}">{{=user.login}}</a> on {{=created_at}} (last updated {{=updated_at}})</div> <div>{{=body!}}</div> <div><a href="{{=html_url}}"><img src="../gfx/github.ico"> On GitHub</a> | <a href="{{=diff_url}}">Diff</a> | - <a href="#" number="{{=number}}" state="{{=state}}" title="{{=title}}" class="pullinstructions">Show Pull Instructions</a> | - <a href="#" number="{{=number}}" state="{{=state}}" title="{{=title}}" class="updatepullrequest">Update</a> + <a href="#" data-number="{{=number}}" data-state="{{=state}}" data-title="{{=title}}" class="pullinstructions">Show Pull Instructions</a> | + <a href="#" data-number="{{=number}}" data-state="{{=state}}" data-title="{{=title}}" class="updatepullrequest">Update</a> </div> </div> </script> diff --git a/pulls/pullrequests.js b/pulls/pullrequests.js index 652060d..59baea0 100644 --- a/pulls/pullrequests.js +++ b/pulls/pullrequests.js @@ -21,7 +21,7 @@ repoList.prototype.hideList = function() { repoList.prototype.refreshView = function() { $("#repolist").html($("#repoListItemTemplate").render(this.data.data)); - $("li", $("#repolist")).click(function(ev) { var reponame = loadRepo($(this).attr("repo")); $.bbq.pushState({ repo: reponame }); ev.preventDefault(); }); + $("li", $("#repolist")).click(function(ev) { var reponame = loadRepo($(this).data("repo")); $.bbq.pushState({ repo: reponame }); ev.preventDefault(); }); } repoList.prototype.update = function() { var t = this; @@ -142,14 +142,14 @@ function loadRepo(repo, url) { $("#repoContent").html( $("#repoOverviewTemplate").render([{repoName: repo, pullList: $("#pullRequestListItem").render(data.data)}])); $("#repoContent code").parent('p').css('overflow', 'auto'); $(".pullinstructions").click(function(ev) { - $('<div></div>').html($("#pullInstructionTemplate").render({ repo: repo, number: $(this).attr("number")})) - .dialog({title: $(this).attr("number")+': '+$(this).attr("title")+' ('+$(this).attr("state")+')', width: 800 }); + $('<div></div>').html($("#pullInstructionTemplate").render({ repo: repo, number: $(this).data("number")})) + .dialog({title: $(this).data("number")+': '+$(this).data("title")+' ('+$(this).data("state")+')', width: 800 }); ev.preventDefault(); }); $(".updatepullrequest").click(function(ev) { var dia = $('<div></div>').html($("#updatePullRequestTemplate").render({})) - .dialog({title: $(this).attr("number")+': '+$(this).attr("title")+' ('+$(this).attr("state")+')' }); - $("button", dia).click(function(r, n, dia) { return function(ev) { updateRepo(r, n, dia); ev.preventDefault();}}(repo, $(this).attr("number"), dia) ); + .dialog({title: $(this).data("number")+': '+$(this).data("title")+' ('+$(this).data("state")+')' }); + $("button", dia).click(function(r, n, dia) { return function(ev) { updateRepo(r, n, dia); ev.preventDefault();}}(repo, $(this).data("number"), dia) ); ev.preventDefault(); }); $("#repoPullList").accordion({ autoHeight: false }); -- PHP Quality Assurance Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php