community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1729123 - in /comdev/helpwanted.apache.org/site: js/hw.js listitems.lua
Date Mon, 08 Feb 2016 10:05:40 GMT
Author: humbedooh
Date: Mon Feb  8 10:05:40 2016
New Revision: 1729123

URL: http://svn.apache.org/viewvc?rev=1729123&view=rev
Log:
shorten IDs for emails, add mailto link

Modified:
    comdev/helpwanted.apache.org/site/js/hw.js
    comdev/helpwanted.apache.org/site/listitems.lua

Modified: comdev/helpwanted.apache.org/site/js/hw.js
URL: http://svn.apache.org/viewvc/comdev/helpwanted.apache.org/site/js/hw.js?rev=1729123&r1=1729122&r2=1729123&view=diff
==============================================================================
--- comdev/helpwanted.apache.org/site/js/hw.js (original)
+++ comdev/helpwanted.apache.org/site/js/hw.js Mon Feb  8 10:05:40 2016
@@ -342,7 +342,9 @@ function fetchItemsAdmin() {
 function renderItem(json, state) {
     var obj = document.getElementById('item')
     var cdate = new Date(json.created*1000).toDateString()
+    var rid = json.request_id.substring(0,8)
     obj.innerHTML = "<h2>Task #" + state + ":<br/><span style='color: #369;'>"
+ json.title + "</span></h2>"
+    var mlink = "mailto:dev@" + json.project + ".apache.org?subject=" + escape("Help with
task: " + json.title) + "&body=" + escape("I would like to help out with the task listed
at https://helpwanted.apache.org/task.html?" + rid + "\n\n")
     obj.innerHTML += "<p style='text-align: left;'><b>Project: </b> " +
json.project + "<br/>" +
         "<b>Created by:</b> " + json.author + "@apache.org<br/>" +
         "<b>Task added: </b>" + cdate + "<br/>" +
@@ -355,7 +357,7 @@ function renderItem(json, state) {
         "<br/></p>" +
         "<h3 style='text-align: left;'>How to help:</h3><p style='text-align:
left;'>" +
         (json.curl && json.curl.length > 10 ? "<b>Contributor's guide for
this project: </b><a href='" + json.curl + "'>" + json.curl + "</a><br/>"
:"") +
-        "If you want to help with this task, please get in touch with the project at: dev@"
+ json.project + ".apache.org!" +
+        "If you want to help with this task, please get in touch with the project at: <a
href=\""+mlink+"\">dev@" + json.project + ".apache.org</a>!" +
         "<br/>You should also check out the additional information URL (if such is
provided above) for more information."
         "<br/>&nbsp;<br/>&nbsp;<br/></p>"
 }

Modified: comdev/helpwanted.apache.org/site/listitems.lua
URL: http://svn.apache.org/viewvc/comdev/helpwanted.apache.org/site/listitems.lua?rev=1729123&r1=1729122&r2=1729123&view=diff
==============================================================================
--- comdev/helpwanted.apache.org/site/listitems.lua (original)
+++ comdev/helpwanted.apache.org/site/listitems.lua Mon Feb  8 10:05:40 2016
@@ -35,7 +35,15 @@ function handle(r)
     local listdata = {}
 
     if get.id then
-        local doc = elastic.get('item', get.id)
+        local doc = nil
+        if #get.id == 8 and get.id:match("^([a-f0-9]+)$") then
+            docs = elastic.find('_id:' .. get.id .. "*", 1, 'item', 'created')
+            if docs and #docs == 1 then
+                doc = docs[1]
+            end
+        else 
+            doc = elastic.get('item', get.id)
+        end
         if doc then
             r:puts(JSON.encode(doc))
             return apache2.OK



Mime
View raw message