[guadec-web-regcfp/develop] Make gender freeform
- From: Patrick Uiterwijk <puiterwijk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [guadec-web-regcfp/develop] Make gender freeform
- Date: Wed, 24 Jun 2015 15:28:25 +0000 (UTC)
commit 957d45bd01768a13d9329c29b74912ca566d1c3d
Author: Patrick Uiterwijk <puiterwijk redhat com>
Date: Wed Jun 24 17:28:05 2015 +0200
Make gender freeform
models/registration.js | 2 +-
routes/registration.js | 9 +++------
views/registration/register.hbs | 11 +----------
3 files changed, 5 insertions(+), 17 deletions(-)
---
diff --git a/models/registration.js b/models/registration.js
index f884018..04eff71 100644
--- a/models/registration.js
+++ b/models/registration.js
@@ -6,7 +6,7 @@ module.exports = function(sequelize, DataTypes) {
is_public: DataTypes.BOOLEAN,
badge_printed: DataTypes.BOOLEAN,
receipt_sent: DataTypes.BOOLEAN,
- gender: DataTypes.ENUM('male', 'female', 'other'),
+ gender: DataTypes.STRING,
country: DataTypes.STRING,
}, {
classMethods: {
diff --git a/routes/registration.js b/routes/registration.js
index 9a30e9d..c990d96 100644
--- a/routes/registration.js
+++ b/routes/registration.js
@@ -14,8 +14,6 @@ var config = require('../config/config.json')[env];
var paypal = require('paypal-rest-sdk');
paypal.configure(config['paypal']);
-var genders = ['male', 'female', 'other'];
-
router.all('/', utils.require_feature("registration"));
router.all('/list', utils.require_permission('registration/view_public'));
@@ -227,11 +225,10 @@ router.get('/register', function(req, res, next) {
req.user.getRegistration()
.complete(function(err, reg) {
res.render('registration/register', { registration: reg,
- ask_regfee: reg == null,
- allGenders: genders });
+ ask_regfee: reg == null });
});
} else {
- res.render('registration/register', { registration: {is_public: true}, ask_regfee: true, allGenders:
genders });
+ res.render('registration/register', { registration: {is_public: true}, ask_regfee: true });
};
});
@@ -266,7 +263,7 @@ function handle_registration(req, res, next) {
.complete(function(err, reg) {
var reg_info = {
irc: req.body.irc.trim(),
- gender: req.body.gender,
+ gender: req.body.gender.trim(),
country: req.body.country.trim(),
is_public: req.body.is_public.indexOf('false') == -1,
badge_printed: false,
diff --git a/views/registration/register.hbs b/views/registration/register.hbs
index 5d3c48c..94eb7d7 100644
--- a/views/registration/register.hbs
+++ b/views/registration/register.hbs
@@ -19,16 +19,7 @@ Please note that we can only provide receipts for payments over {{config.registr
{{/unless}}</p>
</tr>
--<tr><td>Gender</td>
-<td>
-{{#each allGenders}}
-<input type="radio" name="gender" value="{{this}}" id="gender_{{this}}"
-{{#ifEqual ../registration.gender this}}
-checked
-{{/ifEqual}}
-><label for="gender_{{this}}">{{this}}</label>
-{{/each}}
-<br/><p class="note">We will not publish gender data.<br/> It will only be used for attendee
statistics.</p></td></tr>
+-<tr><td>Gender</td><td><input type="text" name="gender" value="{{registration.gender}}"
placeholder="(optional: male, female, genderqueer, etc.")"><br/><p class="note">We will not publish gender
data.<br/> It will only be used for attendee statistics and for an invitation to the women's
dinner.</p></td></tr>
-<tr><td>Country</td><td><input type="text" name="country" value="{{registration.country}}"
placeholder="(optional)"><br/><p class="note">We will not publish country data.<br/> It will only be used for
attendee statistics.</p></td></tr>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]