Skip to content

Commit

Permalink
#289: check if new sponsorings are allowed for event
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikglandorf authored and florianschmidt1994 committed Apr 4, 2018
1 parent f450357 commit 58f0ac9
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 149 deletions.
17 changes: 0 additions & 17 deletions src/client/js/sponsoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,6 @@ $(document).ready(() => {

});

$('#bo-add-challenge-model-btn').click((e) => {
alert('Eintragen von Sponsoren ist nach dem Event nicht mehr möglich');
e.stopImmediatePropagation();
});


$('#bo-add-sponsoring-model-btn').click((e) => {
alert('Eintragen von Challenges ist nach dem Event nicht mehr möglich');
e.stopImmediatePropagation();
});

$('#bo-add-offline-sponsoring-model-btn').click((e) => {
alert('Eintragen von Sponsoren ist nach dem Event nicht mehr möglich');
e.stopImmediatePropagation();
});


$('#editSponsoringModal').submit(function (e) {
e.preventDefault();
if (sanityCheck('editSponsoringModal')) {
Expand Down
3 changes: 2 additions & 1 deletion src/common/resources/translations/translations.de.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ module.exports = {
"STATUS_WITHDRAWN": "Zurückgezogen",
"LABEL_EMAIL": "Emailadresse des Sponsors (optional)",
"ESTIMATED_DONATE_PROMISE": "Geschätztes Spendenversprechen",
"SELECT_TEAM": "Team auswählen"
"SELECT_TEAM": "Team auswählen",
'NO_NEW_SPONSORINGS': 'Momentan können keine Sponsorings eingetragen werden.'
},
"CLOSED": {
"HEADLINE": "Anmeldung geschlossen",
Expand Down
3 changes: 2 additions & 1 deletion src/common/resources/translations/translations.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ module.exports = {
"STATUS_WITHDRAWN": "Withdrawn",
"LABEL_EMAIL": "Email address of sponsor (optional)",
"ESTIMATED_DONATE_PROMISE": "Estimated donate promise",
"SELECT_TEAM": "Select team"
"SELECT_TEAM": "Select team",
"NO_NEW_SPONSORINGS": "At the moment it is not possible to add a sponsoring."
},
"CLOSED": {
"HEADLINE": "Registration closed",
Expand Down
9 changes: 5 additions & 4 deletions src/server/controller/SponsoringController.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,24 @@ sponsoring.showSponsorings = function*(req, res) {
let outSponsoring = [];
let outChallenges = [];
let confirmedDonations = [];
//INCOMING
let teams = [];

//INCOMING
if (req.user.status.is.team) {
incSponsoring = yield sponsoring.getByTeam(req);
incChallenges = yield sponsoring.challenge.getByTeam(req);
confirmedDonations = yield sponsoring.invoice.getByTeam(req);
req.user.me.participant.event = yield api.event.get(req.user.me.participant.eventId);
}

//OUTGOING
if (req.user.status.is.sponsor) {
outSponsoring = yield sponsoring.getBySponsor(req);
outChallenges = yield sponsoring.challenge.getBySponsor(req);
teams = yield sponsoring.getAllTeamsSummary(req);
teams = teams.filter(team => team.eventAllowNewSponsoring);
}


const teams = yield sponsoring.getAllTeamsSummary(req);

res.render('dynamic/sponsoring/sponsoring', {
error: req.flash('error'),
layout: 'master',
Expand Down
Loading

0 comments on commit 58f0ac9

Please sign in to comment.