Allow organizer to update event attendee count.
This commit is contained in:
Родитель
c2da7412df
Коммит
906ef521d8
|
@ -186,5 +186,9 @@ body#events.details {
|
|||
width: 24em;
|
||||
margin: 20px 10px;
|
||||
}
|
||||
input[name="attendees"] {
|
||||
width: 5em;
|
||||
margin: 0px 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -195,6 +195,10 @@ module.exports = function(init) {
|
|||
return snum_true
|
||||
return Boolean(event.featured)
|
||||
},
|
||||
attendees: function(event) {
|
||||
if (event.attendees)
|
||||
return parseInt(event.attendees);
|
||||
},
|
||||
};
|
||||
// Date/Time field transforms
|
||||
['begin', 'end'].forEach(function(pfx) {
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
var orm = require('../config/orm')();
|
||||
require('../models')(orm);
|
||||
|
||||
/* old attendee values
|
||||
0> 1-10
|
||||
1> 10-20
|
||||
2> 20-50
|
||||
3> 50-100
|
||||
4> 100-200
|
||||
5> 200-500
|
||||
*/
|
||||
|
||||
orm.models.Event.all().success(function(events) {
|
||||
events.forEach(function(event) {
|
||||
var attendee_conversion = [
|
||||
5, 15, 35, 75, 150, 350
|
||||
]
|
||||
event.updateAttributes({
|
||||
attendees: attendee_conversion[event.attendees] || event.attendees
|
||||
});
|
||||
});
|
||||
}).error(console.error.bind(console));
|
|
@ -116,6 +116,10 @@
|
|||
<label for="event_registerLink">Registration Link: </label>
|
||||
<input id="event_registerLink" type="text" name="registerLink"
|
||||
placeholder="{{ event.registerLink or "http://example.com/" }}" />
|
||||
<br >
|
||||
<label for="event_attendees"># of Attendees: </label>
|
||||
<input id="event_attendees" type="number" name="attendees"
|
||||
placeholder="~{{ event.attendees or "?" }}" />
|
||||
</span>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
|
Загрузка…
Ссылка в новой задаче