[bugzilla-gnome-org-extensions] Improve navigation



commit 9e40c5f901b1d258430821a04959dde0b36f2904
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sat Sep 12 19:19:21 2009 -0400

    Improve navigation
    
    - Show bug header on "choose attachment page"
    - Link from bug header on review page to "choose attachment page"
    - Add a link from "choose attachment page" to the original bug
      (new config.js setting configBugzillaUrl)

 js/splinter.js        |   37 +++++++++++++++++++++++--------------
 web/config.js.example |   12 ++++++++++--
 web/index.html        |    7 ++++---
 web/splinter.css      |   10 +++++++++-
 4 files changed, 46 insertions(+), 20 deletions(-)
---
diff --git a/js/splinter.js b/js/splinter.js
index 93120c9..418f3ab 100644
--- a/js/splinter.js
+++ b/js/splinter.js
@@ -396,11 +396,23 @@ function start(xml) {
     if (!theReview)
         theReview = new Review.Review(thePatch);
 
+    document.title = "Attachment " + theAttachment.id + " - " + theAttachment.description + " - Patch 
Review";
+
     $("#loading").hide();
-    $("#headers").show();
+    $("#attachmentInfo").show();
     $("#controls").show();
     $("#files").show();
 
+    $("#bugLink").attr('href', newPageUrl(theBug.id));
+
+    $("#attachmentId").text(theAttachment.id);
+    $("#attachmentDesc").text(theAttachment.description);
+    $("#attachmentDate").text(Utils.formatDate(theAttachment.date));
+    if (theAttachment.status != null)
+        $("#attachmentStatus").val(theAttachment.status);
+    else
+        $("#attachmentStatusSpan").hide();
+
     var i;
 
     for (i = 0; i < configAttachmentStatuses.length; i++) {
@@ -409,11 +421,6 @@ function start(xml) {
             .appendTo($("#attachmentStatus"));
     }
 
-    $("#bugId").text(theBug.id);
-    $("#bugShortDesc").text(theBug.shortDesc);
-    $("#bugReporter").text(theBug.getReporter());
-    $("#bugCreationDate").text(Utils.formatDate(theBug.creationDate));
-
     if (thePatch.intro)
         $("#patchIntro").text(thePatch.intro);
     else
@@ -423,14 +430,6 @@ function start(xml) {
         .val(theReview.intro)
         .keypress(queueSaveDraft);
 
-    $("#attachmentId").text(theAttachment.id);
-    $("#attachmentDesc").text(theAttachment.description);
-    $("#attachmentDate").text(Utils.formatDate(theAttachment.date));
-    if (theAttachment.status != null)
-        $("#attachmentStatus").val(theAttachment.status);
-    else
-        $("#attachmentStatusSpan").hide();
-
     for (i = 0; i < theBug.comments.length; i++) {
         var comment = theBug.comments[i];
         var m = REVIEW_RE.exec(comment.text);
@@ -462,6 +461,13 @@ function start(xml) {
 function gotBug(xml) {
     theBug = Bug.Bug.fromDOM(xml);
 
+    $("#headers").show();
+
+    $("#bugId").text(theBug.id);
+    $("#bugShortDesc").text(theBug.shortDesc);
+    $("#bugReporter").text(theBug.getReporter());
+    $("#bugCreationDate").text(Utils.formatDate(theBug.creationDate));
+
     if (attachmentId != null) {
         theAttachment = theBug.getAttachment(attachmentId);
         if (theAttachment == null)
@@ -545,6 +551,9 @@ function showEnterBug() {
 }
 
 function showChooseAttachment() {
+    document.title = "Bug " + theBug.id + " - " + theBug.shortDesc + " - Patch Review";
+    $("#originalBugLink").attr('href', configBugzillaUrl + "/show_bug.cgi?id=" + theBug.id);
+
     var drafts = {};
     var published = {};
     if (reviewStorage) {
diff --git a/web/config.js.example b/web/config.js.example
index b676ad5..a272ff0 100644
--- a/web/config.js.example
+++ b/web/config.js.example
@@ -1,6 +1,14 @@
+# Base URL for links to Bugzilla
+configBugzillaUrl = 'http://bugzilla.gnome.org';
+
+# These are the attachment statuses for bugzilla.gnome.org, which is
+# the only Bugzilla instance I'm aware that supports attachment statuses
 configAttachmentStatuses = [
     'none',
-    'reviewed',
+    'accepted-commit_now',
+    'needs-work',
+    'accepted-commit_after_freeze',
+    'committed',
     'rejected',
-    'committed'
+    'reviewed
 ];
diff --git a/web/index.html b/web/index.html
index eafcf0f..d475755 100644
--- a/web/index.html
+++ b/web/index.html
@@ -10,20 +10,20 @@
     </script>
   </head>
   <body>
-    <div id="loading">Loading....</div>
     <div id="headers" style="display: none;">
       <div id="bugInfo">
-       Bug <span id="bugId"></span> -
+       <a id="bugLink">Bug <span id="bugId"></span></a> -
        <span id="bugShortDesc"></span> -
        <span id="bugReporter"></span> -
        <span id="bugCreationDate"></span>
       </div>
-      <div id="attachmentInfo">
+      <div id="attachmentInfo" style="display: none;">
        Attachment <span id="attachmentId"></span> -
        <span id="attachmentDesc"></span> -
        <span id="attachmentDate"></span>
       </div>
     </div>
+    <div id="loading">Loading....</div>
     <div id="error" style="display: none;">
     </div>
     <div id="enterBug" style="display: none;">
@@ -44,6 +44,7 @@
        <tbody>
        </tbody>
       </table>
+      <a id="originalBugLink">Go to bug</a>
     </div>
     <div id="controls" style="display: none;">
       <div id="patchIntro">
diff --git a/web/splinter.css b/web/splinter.css
index 6e02ff5..44d6261 100644
--- a/web/splinter.css
+++ b/web/splinter.css
@@ -9,10 +9,14 @@ body {
 #headers {
     background: black;
     color: white;
-    font-size: 80%;
+    font-size: 90%;
     padding: 0.5em;
 }
 
+#headers a {
+    color: white;
+}
+
 #error {
     border: 1px solid black;
     margin: 0.5em;
@@ -36,6 +40,10 @@ body {
     padding: 0.5em;
 }
 
+#chooseAttachment table {
+    margin-bottom: 1em;
+}
+
 .attachment-draft .attachment-id, .attachment-draft .attachment-desc {
     font-weight: bold;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]