Skip to content
Snippets Groups Projects
Commit d739dade authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Adding newlines at end of files; Add flex tab on settings page.

parent be901dbc
No related branches found
No related tags found
No related merge requests found
......@@ -70,17 +70,17 @@ Router.route '/settings/:group?',
if Meteor.user()?.admin isnt true
Router.go('home')
@next()
waitOn: ->
return Meteor.subscribe 'admin-settings'
data: ->
return {
group: @params.group
group: if @params.group then @params.group else Settings.findOne({ type: 'group' })?._id
}
action: ->
this.render('settings')
onAfterAction: ->
KonchatNotification.getDesktopPermission()
Router.route '/room/:_id',
name: 'room'
......
......@@ -15,4 +15,4 @@ Template.body.onRendered ->
j.async = true
j.src = '//www.googletagmanager.com/gtm.js?id=' + i + dl
f.parentNode.insertBefore j, f
dataLayerComputation.stop()
\ No newline at end of file
dataLayerComputation.stop()
Template.settings.helpers
tSearchSettings: ->
return t('Search_settings')
groups: ->
return Settings.find({type: 'group'}).fetch()
group: ->
return Settings.findOne { _id: @group, type: 'group' }
settings: ->
return Settings.find({ group: @group, type: 'variable' }).fetch()
return Settings.find({ group: @group }).fetch()
flexOpened: ->
return 'opened' if Session.equals('flexOpened', true)
arrowPosition: ->
console.log 'room.helpers arrowPosition' if window.rocketDebug
return 'left' unless Session.equals('flexOpened', true)
Template.settings.events
"click .burger": ->
......
......@@ -34,9 +34,10 @@
</section>
<section class="flex-tab">
<div class="control">
<button class="more"><span class="arrow {{arrowPosition}}"></span></button>
<div class="search-form">
<div class="input-line search">
<input type="text" class="search" placeholder={{tSearchSettings}} />
<input type="text" class="search" placeholder={{_ "Search_settings"}} />
<i class="icon-plus"></i>
</div>
</div>
......@@ -48,16 +49,7 @@
<a href="{{pathFor 'settings' group=_id}}">{{_ i18nLabel}}</a>
</li>
{{/each}}
{{!-- <li>
<a href="{{pathFor 'settings' group='authentication'}}">{{_ "Authentication_Methods"}}</a>
</li>
<li>
<a href="{{pathFor 'settings' group='messages'}}">{{_ "Message_Editing_Deleting"}}</a>
</li>
<li>
<a href="{{pathFor 'settings' group='registration'}}">{{_ "Registration"}}</a>
</li> --}}
</ul>
</div>
</section>
</ul>
</div>
</section>
</template>
......@@ -9,7 +9,6 @@
"are_also_typing" : "are also typing",
"are_typing" : "are typing",
"Are_you_sure" : "Are you sure?",
"Authentication_Methods" : "Authentication Methods",
"away" : "away",
"away_male" : "away",
"away_female" : "away",
......@@ -86,7 +85,6 @@
"Members" : "Members",
"Members_List" : "Members List",
"Members_placeholder" : "Members",
"Message_Editing_Deleting" : "Message Editing/Deleting",
"More_channels" : "More channels",
"Msgs" : "Msgs",
"multi" : "multi",
......@@ -115,7 +113,6 @@
"quote" : "quote",
"Recents" : "Recents",
"Register" : "Register a new account",
"Registration" : "Registration",
"Remember_me" : "Remember me",
"Remove" : "Remove",
"Reset_password" : "Reset password",
......
Meteor.startup ->
Meteor.subscribe 'settings'
\ No newline at end of file
Meteor.subscribe 'settings'
......@@ -7,4 +7,4 @@
RocketChat.settings = {}
RocketChat.settings.get = (_id) ->
return Settings.findOne(_id)
\ No newline at end of file
return Settings.findOne(_id)
Meteor.publish 'settings', ->
console.log '[publish] settings'.green
if this.userId
user = Meteor.users.findOne this.userId
if user.admin
return Settings.find()
return Settings.find { public: true }, { fields: _id: 1, value: 1 }
Meteor.publish 'admin-settings', ->
console.log '[publish] admin-settings'.green
return Settings.find { public: true }, { fields: _id: 1, value: 1}
\ No newline at end of file
unless @userId
return @ready()
user = Meteor.users.findOne @userId
if user.admin
return Settings.find()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment