Changes to main settings template and user profile template

pull/435/head
Marcelo Schmidt 11 years ago
parent a3abc32f2d
commit 5e261c80da
  1. 2
      client/routes/router.coffee
  2. 2
      client/views/app/sideNav/userStatus.html
  3. 6
      client/views/usersettings/userSettings.coffee
  4. 12
      client/views/usersettings/userSettings.html
  5. 6
      client/views/usersettings/userSettingsFlex.html
  6. 17
      client/views/usersettings/userSettingsProfile.coffee
  7. 53
      client/views/usersettings/userSettingsProfile.html
  8. 1
      i18n/en.i18n.json
  9. 3
      server/methods/saveUserProfile.coffee

@ -52,7 +52,7 @@ FlowRouter.route '/usersettings/:group?',
unless params.group
params.group = 'Profile'
params.group = _.capitalize params.group, true
BlazeLayout.render 'main', { center: 'userSettings', settings: "userSettings#{params.group}" }
BlazeLayout.render 'main', { center: "userSettings#{params.group}" }
FlowRouter.route '/history/private',
name: 'privateHistory'

@ -17,7 +17,7 @@
<a href="" data-status="away" class="status away"><span>{{_ "Away" context="male"}}</span></a>
<a href="" data-status="busy" class="status busy"><span>{{_ "Busy" context="male"}}</span></a>
<a href="" data-status="offline" class="status offline"><span>{{_ "Invisible"}}</span></a>
<a href="" id="settings"><i class="icon-sliders"></i><span>{{_ "Settings"}}</span></a>
<a href="" id="settings"><i class="icon-sliders"></i><span>{{_ "My_Account"}}</span></a>
<a href="" id="logout"><i class="icon-logout"></i><span>{{_ "Logout"}}</span></a>
</div>
</nav>

@ -9,9 +9,3 @@ Template.userSettings.onRendered ->
Tracker.afterFlush ->
SideNav.setFlex "userSettingsFlex"
SideNav.openFlex()
Template.userSettings.events
'click .submit button': (e, t) ->
if t.child?.length > 0
for child in t.child
child.save?()

@ -6,17 +6,5 @@
<span class="room-title">{{_ "User_Settings"}}</span>
</h2>
</head>
<div class="content">
<div class="info">
<h3>{{label}}</h3>
<h3>{{description}}</h3>
</div>
<div class="rocket-form">
{{> Template.dynamic template=settings}}
<div class="submit">
<button class="button"><i class="icon-send"></i><span>{{_ "Save_changes"}}</span></button>
</div>
</div>
</div>
</section>
</template>

@ -1,7 +1,7 @@
<template name="userSettingsFlex">
<header>
<div>
<h4>{{_ "User_Settings"}}</h4>
<h4>{{_ "My_Account"}}</h4>
</div>
</header>
<div class="content">
@ -9,7 +9,9 @@
<ul>
<li>
<a href="{{pathFor 'userSettings' group='profile'}}">{{_ "Profile"}}</a>
<a href="{{pathFor 'changeAvatar'}}">{{_ "Change_avatar"}}</a>
{{!-- <a href="{{pathFor 'userSettings' group='account'}}">{{_ "Account_Settings"}}</a> --}}
{{!-- <a href="{{pathFor 'userSettings' group='notification'}}">{{_ "Notification"}}</a> --}}
<a href="{{pathFor 'changeAvatar'}}">{{_ "Change_avatar"}}</a> {{!-- move this to profile --}}
</li>
</ul>
</div>

@ -1,4 +1,9 @@
Template.userSettingsProfile.helpers
flexOpened: ->
return 'opened' if Session.equals('flexOpened', true)
arrowPosition: ->
console.log 'room.helpers arrowPosition' if window.rocketDebug
return 'left' unless Session.equals('flexOpened', true)
languages: ->
languages = TAPi18n.getLanguages()
result = []
@ -32,9 +37,6 @@ Template.userSettingsProfile.onCreated ->
if _.trim $('#password').val()
data.password = _.trim $('#password').val()
if $('#showUTCTime:checked').length
data.showUTCTime = true
Meteor.call 'saveUserProfile', data, (error, results) ->
if results
toastr.success t('Profile_saved_successfully')
@ -46,3 +48,12 @@ Template.userSettingsProfile.onCreated ->
if error
toastr.error error.reason
Template.userSettingsProfile.onRendered ->
Tracker.afterFlush ->
SideNav.setFlex "userSettingsFlex"
SideNav.openFlex()
Template.userSettingsProfile.events
'click .submit button': (e, t) ->
t.save()

@ -1,28 +1,35 @@
<template name="userSettingsProfile">
<fieldset>
<div class="input-line">
<label for="language">{{_ "Language"}}</label>
<div>
<select id="language" class="required">
{{#each languages}}
<option value="{{key}}" selected="{{userLanguage key}}" dir="auto">{{name}}</option>
{{/each}}
</select>
</div>
</div>
<div class="input-line">
<label for="password">{{_ "Password"}}</label>
<div>
<input type="password" name="password" id="password" />
</div>
</div>
<div class="input-line">
<div class="input-line">
<label for="showUTC"></label>
<div>
<label><input type="checkbox" name="showUTC" id="showUTC" value="1" /> {{_ "Show_UTC"}}</label>
<section class="page-container page-home page-static">
<head class="fixed-title">
{{> burger}}
<h2>
<span class="room-title">{{_ "Profile"}}</span>
</h2>
</head>
<div class="content">
<div class="rocket-form">
<fieldset>
<div class="input-line">
<label for="language">{{_ "Language"}}</label>
<div>
<select id="language" class="required">
{{#each languages}}
<option value="{{key}}" selected="{{userLanguage key}}" dir="auto">{{name}}</option>
{{/each}}
</select>
</div>
</div>
<div class="input-line">
<label for="password">{{_ "Password"}}</label>
<div>
<input type="password" name="password" id="password" />
</div>
</div>
</fieldset>
<div class="submit">
<button class="button"><i class="icon-send"></i><span>{{_ "Save_changes"}}</span></button>
</div>
</div>
</div>
</fieldset>
</section>
</template>

@ -93,6 +93,7 @@
"More_channels" : "More channels",
"Msgs" : "Msgs",
"multi" : "multi",
"My_Account" : "My Account",
"n_messages" : "%s messages",
"Name" : "Name",
"New_messages" : "New messages",

@ -8,8 +8,7 @@ Meteor.methods
Accounts.setPassword Meteor.userId(), settings.password, { logout: false }
profile = {}
profile.showUTCTime = !! settings.showUTCTime
Meteor.users.update Meteor.userId(), { $set: { "settings.profile": profile } }
return true
Loading…
Cancel
Save