From 24d7ad310bc2402582095b21adb3acb82f6cb147 Mon Sep 17 00:00:00 2001
From: Douglas Gardner <douglas@chippy.ch>
Date: Sun, 21 Apr 2013 20:14:37 +0000
Subject: [PATCH] Add pull request notification

* Add message when there are pull requests with client side javascript
* Add string for OAOSIDL, for future usage
* Title cased credits
* Removed text transform from random quote
* Shoved commit count to left
* Added lines to top and bottom of ``h2``
* Removed redundant CSS
* Added JQuery
---
 modules/project/pages.js     |  3 ++-
 modules/project/strings.json |  6 ++++++
 public/project.css           | 41 ++++++++++++++++++++++++++++++++++++
 views/project/project.jade   | 23 +++++++++++---------
 4 files changed, 62 insertions(+), 11 deletions(-)

diff --git a/modules/project/pages.js b/modules/project/pages.js
index ed94690..5578d68 100644
--- a/modules/project/pages.js
+++ b/modules/project/pages.js
@@ -92,7 +92,8 @@ var pages = function(dbot) {
                 "languageeng": dbot.t("en"),
                 "languageprog": dbot.t("langhead-progress"),
                 "languagetrans": dbot.t("langhead-translations"),
-                "languagetranshead": dbot.t("translations")
+                "languagetranshead": dbot.t("translations"),
+                "pullreqs": dbot.t("outstanding-pullreq")
            });
         },
     };
diff --git a/modules/project/strings.json b/modules/project/strings.json
index 7e4d8b7..ed4d23e 100644
--- a/modules/project/strings.json
+++ b/modules/project/strings.json
@@ -190,5 +190,11 @@
     },
     "langhead-native": {
         "en": "Native"
+    },
+    "outstanding-pullreq": {
+        "en": "There are outstanding pull requests"
+    },
+    "oaosidl": {
+        "en": "The Official Aberystwyth Open Source International Development League"
     }
 }
diff --git a/public/project.css b/public/project.css
index 3e71250..95ff2d4 100644
--- a/public/project.css
+++ b/public/project.css
@@ -3,6 +3,10 @@ pre#gitdiff {
     width:80;
     margin:auto;
     text-transform:none;
+    clear:both;
+}
+ul#credits {
+    text-transform:capitalize;
 }
 div#main {
     font-size:18px;
@@ -19,6 +23,7 @@ p.intro {
     border:1px solid #ccc;
     padding:20px;
     border-radius:4px;
+    text-transform:none;
 }
 div.progress.open {
     background-color: #f4fff4;
@@ -63,3 +68,39 @@ li {
 #footer {
     font-size:80%;
 }
+h2 {
+    margin-top:40px;
+    margin-bottom:30px;
+}
+h3 {
+    margin-top:30px;
+    margin-bottom:20px;
+}
+#translations td {
+    text-transform:none;
+}
+p#pullreq {
+    float:right;
+    border-left:1px solid #ccc;
+    border-top:1px solid #ccc;
+    border-top-left-radius:5px;
+    padding:10px;
+    margin:5px;
+    display:none;
+}
+p#revnum {
+    float:left;
+    border-right:1px solid #ccc;
+    border-top:1px solid #ccc;
+    border-top-right-radius: 5px;
+    margin:5px;
+    padding:10px;
+    margin-bottom:0px;
+}
+h2 {
+    border-bottom: 1px solid #ccc;
+    border-top:1px solid #ccc;
+    margin-left:auto;
+    margin-right:auto;
+    width:40%;
+}
diff --git a/views/project/project.jade b/views/project/project.jade
index d447388..79aea22 100644
--- a/views/project/project.jade
+++ b/views/project/project.jade
@@ -8,12 +8,13 @@ html(lang='#{curr839}')
     link(rel='stylesheet', type='text/css', href='/styles.css')    
     link(rel="stylesheet", href="/project.css")
     title #{pagetitle}
-    - var mstone = "milestone"
-    style(type="text/css")
-       each milestone in milestones
-         - current = mstone+milestone.number
-         - wdth = ((milestone.open_issues/(milestone.open_issues + milestone.closed_issues))*100)
-         .current { width: wdth% }
+    script
+      $(document).ready(function() {
+          $.get("https://api.github.com/repos/#{repo}/pulls", function(data) {
+          if ($.parseJSON(data).length) { $("#pullreq").show();}
+        }); 
+      }); 
+
   body  
     div.container
       div#page
@@ -22,8 +23,10 @@ html(lang='#{curr839}')
           p.intro
             #{dquote}
           section#git
-            h3 #{development} 
-            p.center
+            h2 #{development} 
+            p#pullreq
+              a(href="https://github.com/"+repo+"/pulls") #{pullreqs}
+            p#revnum
               #{revnum}
             pre#gitdiff
               #{diff}
@@ -39,7 +42,7 @@ html(lang='#{curr839}')
                 - var wd = "width:"
                 - var pc = "%"
                 - var wdth = ((milestone.closed_issues/(milestone.open_issues + milestone.closed_issues))*100) 
-                tr(id=mstone+milestone.number)
+                tr(id="milestone"+milestone.number)
                   td
                     a(href=milestone.url)
                       #{milestone.title}
@@ -75,7 +78,7 @@ html(lang='#{curr839}')
                   td #{language.count} / #{translation.en.count}
             h4 #{credits}
             #{thanks}
-            ul
+            ul#credits
               each author in authors
                 li
                   #{author}