You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2023/03/20 15:21:40 UTC

svn commit: r1908576 - in /comdev/helpwanted.apache.org/site/js: coffee/hw.coffee hw.js

Author: sebb
Date: Mon Mar 20 15:21:39 2023
New Revision: 1908576

URL: http://svn.apache.org/viewvc?rev=1908576&view=rev
Log:
Add task type to details; wrap very long lines

Modified:
    comdev/helpwanted.apache.org/site/js/coffee/hw.coffee
    comdev/helpwanted.apache.org/site/js/hw.js

Modified: comdev/helpwanted.apache.org/site/js/coffee/hw.coffee
URL: http://svn.apache.org/viewvc/comdev/helpwanted.apache.org/site/js/coffee/hw.coffee?rev=1908576&r1=1908575&r2=1908576&view=diff
==============================================================================
--- comdev/helpwanted.apache.org/site/js/coffee/hw.coffee (original)
+++ comdev/helpwanted.apache.org/site/js/coffee/hw.coffee Mon Mar 20 15:21:39 2023
@@ -78,7 +78,8 @@ diff_explanation = [
     N.B. Do NOT edit the file js/hw.js. Instead edit js/coffee/hw.coffee and run combine.sh to regenerate hw.js
 ###
 # Languages (programming + spoken)
-langs = ['c', 'xml', 'c++', 'c-sharp', 'objective-c', 'java', 'javascript', 'css', 'html', 'perl', 'ruby', 'lua', 'python', 'go', 'rust', 'erlang', 'swift', 'groovy', 'haskell', 'scala', 'php', 'pig', 'bash', 'tcl', 'jsp', 'svg', 'maven', 'gradle']
+langs = ['c', 'xml', 'c++', 'c-sharp', 'objective-c', 'java', 'javascript', 'css', 'html', 'perl', 'ruby', 'lua', 'python',
+ 'go', 'rust', 'erlang', 'swift', 'groovy', 'haskell', 'scala', 'php', 'pig', 'bash', 'tcl', 'jsp', 'svg', 'maven', 'gradle']
 spoken_langs = ['english', 'french', 'german', 'spanish', 'russian', 'italian', 'japanese', 'chinese']
 website_langs = ['css','javascript','html']
 
@@ -150,7 +151,8 @@ wizard = (step, arg) ->
             p = pastels[i]
             b = brights[i]
             d = mk('div', {class: "option", onclick:"wizard(2, '" + type + "');", style: "background: rgba(" + p.r + "," + p.g + "," + p.b + ", 0.85);"})
-            btn = mk('img', { src: "images/" + type.replace(/\s+/g, "") + "_large.png", style: "width: 36px; heigh: 36px; vertical-align: middle; padding: 4px; padding-right: 12px;"})
+            btn = mk('img', { src: "images/" + type.replace(/\s+/g, "") + "_large.png",
+            style: "width: 36px; heigh: 36px; vertical-align: middle; padding: 4px; padding-right: 12px;"})
             app(d, btn)
             app(d, desc)
             app(wcobj, d)
@@ -403,12 +405,20 @@ displayItems = (json, state) ->
             add = " <td><a href='/admin/close.lua?id=" + item.request_id + "'>Mark as done</a></td>"
         
         description = item.description.replace(/\n/g, "<br/>").replace(hw_weburl, (a) => ("<a href='"+a+"'>"+a+"</a>"))
-        tbl += "<tr style='cursor: pointer;' onclick=\"sw('details_" + i + "');\"><td width='68'><div class='itemNumber-yellow'>" + z + "</div><img title='" + item.type + "' style='float: left; width: 24px; height: 24px;' src='/images/icon_" + ptype + ".png'/></td>" +
-        "<td>" + item.project + "</td>"+
+        tbl += "<tr style='cursor: pointer;' onclick=\"sw('details_" + i + "');\"><td width='68'><div class='itemNumber-yellow'>" + z + "</div>" +
+        "<img title='" + item.type + "' style='float: left; width: 24px; height: 24px;' src='/images/icon_" + ptype + ".png'/></td>" +
+        "<td>" + item.project + "</td>" +
         "<td style='text-align: left;'>" + item.title + "</td>" +
-        "<td>" + lingos + "</td><td title='" + diff_explanation[parseInt(item.difficulty)] + "' style='text-align: left;'><img style='width: 20px; height: 20px; vertical-align: middle;' src='/images/level_" + (parseInt(item.difficulty)+1) + ".png'/> " + diff[item.difficulty] + "</td><td>" + cdate + "</td>" + add + "</tr>"
-        
-        tbl += "<tr style='display:none;' id='details_" + i + "'><td colspan='6'><b>Project:</b> " + item.project + "<br/><b>Requested by:</b> " + item.author + "@apache.org<br/><b>Created:</b> " + cdate + "<br/><b>Description:</b> <blockquote>" + description + "</blockquote><b>Further information: </b> <a href='" + item.url + "'>" + item.url + "</a><br/><input type='button' onclick='location.href=\"/task.html?" + item.request_id + "\";' value='I am interested in this'/></td></tr>"
+        "<td>" + lingos + "</td>" +
+        "<td title='" + diff_explanation[parseInt(item.difficulty)] + "' style='text-align: left;'>" +
+        "<img style='width: 20px; height: 20px; vertical-align: middle;' src='/images/level_" + (parseInt(item.difficulty)+1) + ".png'/> " +
+        diff[item.difficulty] + "</td><td>" + cdate + "</td>" + add + "</tr>"
+        tbl += "<tr style='display:none;' id='details_" + i + "'><td colspan='6'><b>Project:</b> " + item.project + "<br/>" +
+        "<b>Task type:</b> " + types[json.type] + "<br/>" +
+        "<b>Requested by:</b> " + item.author + "@apache.org<br/>" +
+        "<b>Created:</b> " + cdate + "<br/>" +
+        "<b>Description:</b> <blockquote>" + description + "</blockquote><b>Further information: </b> <a href='" + item.url + "'>" + item.url + "</a><br/>" +
+        "<input type='button' onclick='location.href=\"/task.html?" + item.request_id + "\";' value='I am interested in this'/></td></tr>"
      
     tbl += "</table>"
     obj.innerHTML += tbl
@@ -451,12 +461,15 @@ renderItem = (json, state) ->
     
     description = json.description.replace(/\n/g, "<br/>").replace(hw_weburl, (a) => ("<a href='"+a+"'>"+a+"</a>"))
     obj.innerHTML = "<h2>Task #" + state.substring(0,8) + ": " + json.title + "</h2>"
-    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 /task.html?" + rid + "\n\n")
+    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 /task.html?" + rid + "\n\n")
     rgba = "rgba(" + p.r + "," + p.g + "," + p.b + ", 1)"
-    obj.innerHTML += "<div id='pickerparent' style='background: " + rgba + "; padding:12px;'><p style='text-align: left;'><b>Project: </b> " + json.project + "<br/>" +
+    obj.innerHTML += "<div id='pickerparent' style='background: " + rgba + "; padding:12px;'><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/>" +
-        "<b>Difficulty: </b> <img style='width: 16px; height: 16px; vertical-align: middle;' src='/images/level_" + (parseInt(json.difficulty)+1) + ".png'/> " + diff[json.difficulty] + " - " + diff_explanation[parseInt(json.difficulty)] + "<br/>" +
+        "<b>Difficulty: </b> <img style='width: 16px; height: 16px; vertical-align: middle;' src='/images/level_" + (parseInt(json.difficulty)+1) + ".png'/> " + 
+        diff[json.difficulty] + " - " + diff_explanation[parseInt(json.difficulty)] + "<br/>" +
         "<b>Task type:</b> " + types[json.type] + "<br/>" +
         (if json.url and json.url.length > 10 then ("<b>Additional information:</b> <a href='" + json.url + "'>" + json.url + "</a><br/>") else "")+
         (if json.estimate and json.estimate.length > 0 then ("<b>Estimated time to complete:</b> " + json.estimate) else "") +

Modified: comdev/helpwanted.apache.org/site/js/hw.js
URL: http://svn.apache.org/viewvc/comdev/helpwanted.apache.org/site/js/hw.js?rev=1908576&r1=1908575&r2=1908576&view=diff
==============================================================================
--- comdev/helpwanted.apache.org/site/js/hw.js (original)
+++ comdev/helpwanted.apache.org/site/js/hw.js Mon Mar 20 15:21:39 2023
@@ -633,8 +633,8 @@ displayItems = function(json, state) {
     description = item.description.replace(/\n/g, "<br/>").replace(hw_weburl, (a) => {
       return "<a href='" + a + "'>" + a + "</a>";
     });
-    tbl += "<tr style='cursor: pointer;' onclick=\"sw('details_" + i + "');\"><td width='68'><div class='itemNumber-yellow'>" + z + "</div><img title='" + item.type + "' style='float: left; width: 24px; height: 24px;' src='/images/icon_" + ptype + ".png'/></td>" + "<td>" + item.project + "</td>" + "<td style='text-align: left;'>" + item.title + "</td>" + "<td>" + lingos + "</td><td title='" + diff_explanation[parseInt(item.difficulty)] + "' style='text-align: left;'><img style='width: 20px; height: 20px; vertical-align: middle;' src='/images/level_" + (parseInt(item.difficulty) + 1) + ".png'/> " + diff[item.difficulty] + "</td><td>" + cdate + "</td>" + add + "</tr>";
-    tbl += "<tr style='display:none;' id='details_" + i + "'><td colspan='6'><b>Project:</b> " + item.project + "<br/><b>Requested by:</b> " + item.author + "@apache.org<br/><b>Created:</b> " + cdate + "<br/><b>Description:</b> <blockquote>" + description + "</blockquote><b>Further information: </b> <a href='" + item.url + "'>" + item.url + "</a><br/><input type='button' onclick='location.href=\"/task.html?" + item.request_id + "\";' value='I am interested in this'/></td></tr>";
+    tbl += "<tr style='cursor: pointer;' onclick=\"sw('details_" + i + "');\"><td width='68'><div class='itemNumber-yellow'>" + z + "</div>" + "<img title='" + item.type + "' style='float: left; width: 24px; height: 24px;' src='/images/icon_" + ptype + ".png'/></td>" + "<td>" + item.project + "</td>" + "<td style='text-align: left;'>" + item.title + "</td>" + "<td>" + lingos + "</td>" + "<td title='" + diff_explanation[parseInt(item.difficulty)] + "' style='text-align: left;'>" + "<img style='width: 20px; height: 20px; vertical-align: middle;' src='/images/level_" + (parseInt(item.difficulty) + 1) + ".png'/> " + diff[item.difficulty] + "</td><td>" + cdate + "</td>" + add + "</tr>";
+    tbl += "<tr style='display:none;' id='details_" + i + "'><td colspan='6'><b>Project:</b> " + item.project + "<br/>" + "<b>Task type:</b> " + types[json.type] + "<br/>" + "<b>Requested by:</b> " + item.author + "@apache.org<br/>" + "<b>Created:</b> " + cdate + "<br/>" + "<b>Description:</b> <blockquote>" + description + "</blockquote><b>Further information: </b> <a href='" + item.url + "'>" + item.url + "</a><br/>" + "<input type='button' onclick='location.href=\"/task.html?" + item.request_id + "\";' value='I am interested in this'/></td></tr>";
   }
   tbl += "</table>";
   obj.innerHTML += tbl;
@@ -687,7 +687,7 @@ renderItem = function(json, state) {
   obj.innerHTML = "<h2>Task #" + state.substring(0, 8) + ": " + json.title + "</h2>";
   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 /task.html?" + rid + "\n\n");
   rgba = "rgba(" + p.r + "," + p.g + "," + p.b + ", 1)";
-  obj.innerHTML += "<div id='pickerparent' style='background: " + rgba + "; padding:12px;'><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/>" + "<b>Difficulty: </b> <img style='width: 16px; height: 16px; vertical-align: middle;' src='/images/level_" + (parseInt(json.difficulty) + 1) + ".png'/> " + diff[json.difficulty] + " - " + diff_explanation[parseInt(json.difficulty)] + "<br/>" + "<b>Task type:</b> " + types[json.type] + "<br/>" + (json.url && json.url.length > 10 ? "<b>Additional information:</b> <a href='" + json.url + "'>" + json.url + "</a><br/>" : "") + (json.estimate && json.estimate.length > 0 ? "<b>Estimated time to complete:</b> " + json.estimate : "") + (json.timeout && json.timeout > 0 ? "<b>Task expires:</b> " + new Date(json.timeout * 1000).toDateString() : "") + "<blockquote style='text-align: left;'><q>" + description + "</q></blockquote>" + "
 <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: <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.";
+  obj.innerHTML += "<div id='pickerparent' style='background: " + rgba + "; padding:12px;'><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/>" + "<b>Difficulty: </b> <img style='width: 16px; height: 16px; vertical-align: middle;' src='/images/level_" + (parseInt(json.difficulty) + 1) + ".png'/> " + diff[json.difficulty] + " - " + diff_explanation[parseInt(json.difficulty)] + "<br/>" + "<b>Task type:</b> " + types[json.type] + "<br/>" + (json.url && json.url.length > 10 ? "<b>Additional information:</b> <a href='" + json.url + "'>" + json.url + "</a><br/>" : "") + (json.estimate && json.estimate.length > 0 ? "<b>Estimated time to complete:</b> " + json.estimate : "") + (json.timeout && json.timeout > 0 ? "<b>Task expires:</b> " + new Date(json.timeout * 1000).toDateString() : "") + "<blockquote style='text-align: left;'><q>" + description + "</q></blockquote>
 " + "<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: <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.";
   return "<br/>&nbsp;<br/>&nbsp;<br/></p></div>";
 };