Skip to content
Snippets Groups Projects
Commit 171fc721 authored by Diego Sampaio's avatar Diego Sampaio
Browse files

fix settings page

parent c850cc19
No related branches found
No related tags found
No related merge requests found
......@@ -41,21 +41,7 @@ FlowRouter.route '/settings/:group?',
@register 'admin-settings', Meteor.subscribe('admin-settings')
action: ->
FlowLayout.render 'main', {}
track = Tracker.autorun ->
if not FlowRouter.subsReady()
return
track?.stop()
if not Meteor.user()? or Meteor.user().admin isnt true
FlowRouter.go('home')
return
FlowLayout.render 'main', {center: 'settings'}
KonchatNotification.getDesktopPermission()
FlowLayout.render 'main', {center: 'settings'}
FlowRouter.route '/history/private',
name: 'privateHistory'
......
Template.settings.helpers
isAdmin: ->
return Meteor.user().admin is true
groups: ->
return Settings.find({type: 'group'}).fetch()
group: ->
......@@ -32,4 +34,4 @@ Template.settings.events
Template.settings.onRendered ->
console.log 'room.onRendered' if window.rocketDebug
Session.set 'flexOpened', true
FlexTab.check()
\ No newline at end of file
FlexTab.check()
......@@ -13,43 +13,49 @@
</div>
</head>
<div class="content">
<h3>{{label}}</h3>
<div class="rocket-form">
<fieldset>
<legend>
<!-- <h3>This is another section</h3>
<p>This is a configuration text. With configuration info</p> -->
</legend>
{{#each settings}}
<div class="input-line double-col">
<label>{{label}}</label>
<div>
<input type="text" name="input-name" value="{{value}}" />
{{#unless isAdmin}}
<p>You are not authorized to view this page.</p>
{{else}}
<h3>{{label}}</h3>
<div class="rocket-form">
<fieldset>
<legend>
<!-- <h3>This is another section</h3>
<p>This is a configuration text. With configuration info</p> -->
</legend>
{{#each settings}}
<div class="input-line double-col">
<label>{{label}}</label>
<div>
<input type="text" name="input-name" value="{{value}}" />
</div>
</div>
</div>
{{/each}}
</fieldset>
</div>
{{/each}}
</fieldset>
</div>
{{/unless}}
</div>
</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={{_ "Search_settings"}} />
<i class="icon-plus"></i>
{{#if isAdmin}}
<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={{_ "Search_settings"}} />
<i class="icon-plus"></i>
</div>
</div>
</div>
</div>
<div class="content">
<ul class='list cf_ lines'>
{{#each groups}}
<li>
<a href="{{pathFor 'settings' group=_id}}">{{_ i18nLabel}}</a>
</li>
{{/each}}
</ul>
</div>
</section>
<div class="content">
<ul class='list cf_ lines'>
{{#each groups}}
<li>
<a href="{{pathFor 'settings' group=_id}}">{{_ i18nLabel}}</a>
</li>
{{/each}}
</ul>
</div>
</section>
{{/if}}
</template>
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