diff --git a/src/app/index.coffee b/src/app/index.coffee index 7de5b192c2..57996a5535 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -12,6 +12,7 @@ helpers = require './helpers' browser = require './browser' party = require './party' items = require './items' +profile = require './profile' helpers.viewHelpers view character.view view @@ -73,6 +74,7 @@ ready (model) -> tasks.app(exports, model) items.app(exports, model) party.app(exports, model) + profile.app(exports, model) require('../server/private').app(exports, model) require('./debug').app(exports, model) if model.get('_view.nodeEnv') != 'production' diff --git a/src/app/profile.coffee b/src/app/profile.coffee new file mode 100644 index 0000000000..31b49f125b --- /dev/null +++ b/src/app/profile.coffee @@ -0,0 +1,17 @@ +module.exports.app = (appExports, model) -> + user = model.at('_user') + + appExports.profileAddWebsite = (e, el) -> + newWebsite = model.get('_newProfileWebsite') + return if /^(\s)*$/.test(newWebsite) + user.unshift 'profile.websites', newWebsite + model.set '_newProfileWebsite', '' + + appExports.profileEdit = (e, el) -> model.set '_profileEditing', true + appExports.profileSave = (e, el) -> model.set '_profileEditing', false + appExports.profileRemoveWebsite = (e, el) -> + sites = user.get 'profile.websites' + i = sites.indexOf $(el).attr('data-website') + sites.splice(i,1) + user.set 'profile.websites', sites + diff --git a/views/app/index.html b/views/app/index.html index a4bd65e5f8..c3001ef05b 100644 --- a/views/app/index.html +++ b/views/app/index.html @@ -140,61 +140,147 @@ do a find for the string after "→" {#with _user.preferences} + + + +
+
- -
- -
{username(_user.auth)}
-
+ +
+ +
{username(_user.auth)}
+
- - - -
  • - - - - -
  • + + + +
  • + + + + +
  • - -
  • - - - - - - -
  • + +
  • + + + + + + +
  • - -
  • - - - - - - + +
  • + + + + + + + +
  • -
  • -
    - {#if equal(_user.preferences.gender, 'f')} - -
  • - - - + {#if equal(_user.preferences.gender, 'f')} + +
  • + + + + +
  • -
  • -
    - {/} + {/} +
    + +
    +
    {/} <@footer>
    + +
    +
    + {#if _profileEditing} + Save + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    +
    + +
    +
    +
      + {#each _user.profile.websites as :website} + +
    • {:website}
    • + {/} +
    + +
    + Save + {else} +

    + {#if @user.profile.name}{@user.profile.name} + {else}{username(@user.auth)} + {/} + {#if @main}Edit{/} +

    + {#if @user.profile.imageUrl} + + {/} + {#if @user.profile.blurb} +

    {@user.profile.blurb}

    + {/} + {#if @user.profile.websites} +
      + {#each @user.profile.websites as :website} +
    • {:website}
    • + {/} +
    + {/} + + {/} +
    + +
    +

    Badges

    +

    Coming Soon

    +
    + +
    + {#if _flash.error}