use mocofoteamlist
This commit is contained in:
Родитель
4510f6c62d
Коммит
39a5f4b716
2
LICENSE
2
LICENSE
|
@ -359,4 +359,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
|
|||
|
||||
This Source Code Form is "Incompatible
|
||||
With Secondary Licenses", as defined by
|
||||
the Mozilla Public License, v. 2.0.
|
||||
the Mozilla Public License, v. 2.0.
|
||||
|
|
|
@ -31,7 +31,8 @@
|
|||
"express-persona": "~0.1.1",
|
||||
"express3-handlebars": "~0.5.0",
|
||||
"express-sslify": "0.0.1",
|
||||
"helmet": "~0.2.1"
|
||||
"helmet": "~0.2.1",
|
||||
"mocofoteamlist": "~0.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt-jsbeautifier": "~0.2.6",
|
||||
|
|
|
@ -1,20 +1,6 @@
|
|||
<h5>Team</h5>
|
||||
<select class="form-control" name="teamname" id="teamname" required>
|
||||
<option value="default">--Select</option>
|
||||
<optgroup label="MoFo">
|
||||
<option value="mofo-appmaker">Appmaker</option>
|
||||
<option value="mofo-openbadges">Badges</option>
|
||||
<option value="mofo-engagement">Engagement</option>
|
||||
<option value="mofo-hive">Hive</option>
|
||||
<option value="mofo-opennews">Open News</option>
|
||||
<option value="mofo-sciencelab">Science Lab</option>
|
||||
<option value="mofo-webmaker">Webmaker</option>
|
||||
</optgroup>
|
||||
<optgroup label="MoCo">
|
||||
<option value="moco-engagement">Engagement</option>
|
||||
<option value="moco-finance">Finance</option>
|
||||
<option value="moco-legal">Legal</option>
|
||||
<option value="moco-privacy">Privacy</option>
|
||||
<option value="moco-qa">QA</option>
|
||||
</optgroup>
|
||||
{{{ mocofoteamlist }}}
|
||||
{{! this list is now maintained here https://github.com/mozilla/team-list/ }}
|
||||
</select>
|
||||
|
|
32
web.js
32
web.js
|
@ -1,5 +1,5 @@
|
|||
if ( process.env.NEW_RELIC_ENABLED ) {
|
||||
require( "newrelic" );
|
||||
if (process.env.NEW_RELIC_ENABLED) {
|
||||
require("newrelic");
|
||||
}
|
||||
|
||||
var express = require("express");
|
||||
|
@ -11,6 +11,8 @@ var enforce = require('express-sslify');
|
|||
var helmet = require('helmet');
|
||||
var https = require('https');
|
||||
var fs = require('fs');
|
||||
var async = require('async');
|
||||
var mocofoteamlist = require('mocofoteamlist');
|
||||
|
||||
var app = express();
|
||||
|
||||
|
@ -146,11 +148,27 @@ function renderLoggingPage(req, res, viewName, extraTemplateValues) {
|
|||
templateValues.date = util.clean(decodeURI(req.query.date));
|
||||
}
|
||||
|
||||
data.recentlyLogged(email, function gotRecentlyLogged(err, results) {
|
||||
var recent = util.cleanRecentForPresentation(results);
|
||||
templateValues.recentlyLogged = recent;
|
||||
res.render(viewName, templateValues);
|
||||
});
|
||||
async.parallel([
|
||||
|
||||
function (callback) {
|
||||
// Show the user their recently logged contributors
|
||||
data.recentlyLogged(email, function gotRecentlyLogged(err, results) {
|
||||
var recent = util.cleanRecentForPresentation(results);
|
||||
templateValues.recentlyLogged = recent;
|
||||
callback(null);
|
||||
});
|
||||
},
|
||||
function (callback) {
|
||||
mocofoteamlist.getHTMLSelectOptionsForTeams(function gotHTML(err, list) {
|
||||
templateValues.mocofoteamlist = list;
|
||||
callback(null);
|
||||
});
|
||||
}
|
||||
],
|
||||
// once all parallel tasks are done
|
||||
function (err, results) {
|
||||
res.render(viewName, templateValues);
|
||||
});
|
||||
}
|
||||
|
||||
app.get('/log-em', restrict, function (req, res) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче