diff --git a/core/config.js b/core/config.js index bda34c26..ab7f7d54 100644 --- a/core/config.js +++ b/core/config.js @@ -91,6 +91,9 @@ function getDefaultConfig() { defaults : { theme : 'NU-MAYA', // :TODO: allow "*" here passwordChar : '*', // TODO: move to user ? + dateTimeFormat : { + short : 'MM/DD/YYYY', + } }, /* diff --git a/core/mci_view_factory.js b/core/mci_view_factory.js index 9b99de8a..d6dfe8bf 100644 --- a/core/mci_view_factory.js +++ b/core/mci_view_factory.js @@ -35,19 +35,20 @@ MCIViewFactory.prototype.getPredefinedViewLabel = function(code) { VN : packageJson.version, UN : this.client.user.username, - UI : this.client.user.userId, + UI : this.client.user.userId.toString(), UG : _.values(this.client.user.groups).join(', '), UR : this.client.user.properties.real_name, LO : this.client.user.properties.location, UA : this.client.user.getAge().toString(), - UB : moment(this.client.user.properties.birthdate).format('MM/DD/YYYY'), - //UB : this.client.user.getFormattedBirthDate('medium'), + UB : moment(this.client.user.properties.birthdate).format(this.client.currentTheme.helpers.getDateFormat()), US : this.client.user.properties.sex, UE : this.client.user.properties.email_address, UW : this.client.user.properties.web_address, UF : this.client.user.properties.affiliation, UT : this.client.user.properties.theme_id, + ND : this.client.runtime.id.toString(), + OS : { linux : 'Linux', darwin : 'Mac OS X', @@ -212,6 +213,11 @@ MCIViewFactory.prototype.createFromMCI = function(mci) { default : options.text = this.getPredefinedViewLabel(mci.code); if(_.isString(options.text)) { + setWidth(0); + + setOption(1, 'textStyle'); + setOption(2, 'justify'); + view = new TextView(options); } break; diff --git a/core/theme.js b/core/theme.js index b8354da5..6951f027 100644 --- a/core/theme.js +++ b/core/theme.js @@ -52,8 +52,18 @@ function loadTheme(themeID, cb) { } } return pwChar; + }, + getDateFormat : function(style) { + style = style || 'short'; + + var format = Config.defaults.dateTimeFormat[style] || 'MM/DD/YYYY'; + + if(_.has(theme, 'customization.defaults.dateTimeFormat')) { + return theme.customization.defaults.dateTimeFormat[style] || format; + } + return format; } - } + }; cb(null, theme); } catch(e) { diff --git a/core/user_group.js b/core/user_group.js index 2b46748d..febac904 100644 --- a/core/user_group.js +++ b/core/user_group.js @@ -38,8 +38,7 @@ function getGroupsForUser(userId, cb) { cb(err); return; } else { - console.log(row); - //groups[row.group_id] + groups[row.group_id] = row.group_name; } }, function complete() { diff --git a/mods/art/userstats.ans b/mods/art/userstats.ans new file mode 100644 index 00000000..5b35b80c Binary files /dev/null and b/mods/art/userstats.ans differ diff --git a/mods/themes/NU-MAYA/theme.json b/mods/themes/NU-MAYA/theme.json index 483310dc..c783c49f 100644 --- a/mods/themes/NU-MAYA/theme.json +++ b/mods/themes/NU-MAYA/theme.json @@ -8,6 +8,9 @@ "general" : { "passwordChar" : "φ" }, + "dateTimeFormat" : { + "short" : "YYYY-MMM-DD" + }, "mci" : { "TM" : { "styleSGR1" : "|00|30|01"