Skip to content

Commit

Permalink
new templates tabPlace_ui_hist, tabUser_ui_hist, tabUser_ui_friends, …
Browse files Browse the repository at this point in the history
…,fix popups opts
  • Loading branch information
stefanocudini committed Nov 11, 2018
1 parent 8827c2e commit 04ac771
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 33 deletions.
2 changes: 1 addition & 1 deletion packages/core/client/Place.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Kepler.Place = Class.extend({
Blaze.renderWithData(Template[self.templatePopup], self.rData, divp);


self.marker.bindPopup(divp.firstChild, K.Map.options.popup);
self.marker.bindPopup(divp.firstChild, opts.popups);
}
else {
e.target.on('click', function(ee) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/client/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Kepler.User = Class.extend({
var div = L.DomUtil.create('div','');
if(Template[self.templatePopup])
Blaze.renderWithData(Template[self.templatePopup], self, div);
this.bindPopup(div.firstChild, K.Map.options.popup);
this.bindPopup(div.firstChild, opts.popups);
}
}
else
Expand Down
5 changes: 5 additions & 0 deletions packages/core/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Kepler.settings = {
"awayOnWindowBlur": true
},
"templates": {
//TODO refact.. templates without placeholder
"tabPlace_ui_hist": { "show": true},
"tabUser_ui_hist": { "show": true},
"tabUser_ui_friends": { "show": true},

//core/ui templates configurations
"navSidebar": {
"navSidebar_ui_profile": { order:-10 },
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/client/views/panels/friends.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<input class="users-search form-control" type="text" placeholder="{{i18n 'label_find'}}" />
<span class="search-canc form-control-feedback" aria-hidden="true"><i class="icon icon-canc"></i></span>
</div>
<div class="col-xs-6 text-right">
{{#with currentUser}}
{{> user_status}}
{{/with}}
<div class="col-xs-6 text-right" style="padding-left:0">
{{#with currentUser}}
{{> user_status}}
{{/with}}
<input id="switch_online" type="checkbox" />
</div>
</div>
Expand Down
27 changes: 24 additions & 3 deletions packages/ui/client/views/panels/place.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ <h4 class="pull-left">
<i class="icon icon-info"></i> <span>{{i18n 'btn_info'}}</span>
</a>
</li>
{{#if settings 'templates.tabPlace_ui_hist.show'}}
<li>
<a href="#tab_histplace" data-toggle="tab">
<i class="icon icon-hist"></i> <span>{{i18n 'btn_hist'}}</span>
</a>
</li>
</li>
{{/if}}
</ul>

<div class="tab-content">
Expand All @@ -36,9 +38,13 @@ <h4 class="pull-left">
{{> pluginsTemplate name='tabPlace'}}

</div>
{{#if settings 'templates.tabPlace_ui_hist.show'}}
<div class="tab-pane" id="tab_histplace">
{{> tab_histplace}}

{{> tabPlace_ui_hist}}

</div>
{{/if}}
</div>
</div>
</div>
Expand All @@ -64,7 +70,6 @@ <h4 class="pull-left">
</template>

<template name="panelPlace_ui_info">

<ul class="list-group">
{{#if desc}}
<li class="list-group-item">
Expand All @@ -79,5 +84,21 @@ <h4 class="pull-left">
</li>
{{/if}}
</ul>
</template>

<template name="tabPlace_ui_hist">
{{#if hist.length}}
<label>{{i18n 'label_histplace'}}</label>
<ul class="list-group list-items">
{{#each hist}}
<li class="list-group-item">
{{#with userById this}}
{{> item_user}}
{{/with}}
</li>
{{/each}}
</ul>
{{else}}
<label class="text-gray">{{i18n 'label.nohistplace'}}</label>
{{/if}}
</template>
17 changes: 0 additions & 17 deletions packages/ui/client/views/panels/place/histplace.html

This file was deleted.

16 changes: 14 additions & 2 deletions packages/ui/client/views/panels/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,22 @@ <h4 class="pull-left">
<i class="icon icon-info"></i> <span>{{i18n 'btn_info'}}</span>
</a>
</li>
{{#if settings 'templates.tabUser_ui_friends.show'}}
<li class="">
<a href="#tab_friends" data-toggle="tab">
<i class="icon icon-users"></i> <span>{{i18n 'btn_friends'}}</span>
</a>
</li>
{{/if}}
{{#if settings 'templates.tabUser_ui_hist.show'}}
{{#if isFriend}}
<li class="">
<a href="#tab_histuser" data-toggle="tab">
<i class="icon icon-hist"></i> <span>{{i18n 'btn_hist'}}</span>
</a>
</li>
{{/if}}
{{/if}}
</ul>

<div class="tab-content">
Expand All @@ -68,14 +72,22 @@ <h4 class="pull-left">
{{> pluginsTemplate name='tabUser'}}

</div>
{{#if settings 'templates.tabUser_ui_friends.show'}}
<div class="tab-pane" id="tab_friends">
{{> tab_friends}}

{{> tabUser_ui_friends}}

</div>
{{/if}}
{{#if settings 'templates.tabUser_ui_hist.show'}}
{{#if isFriend}}
<div class="tab-pane" id="tab_histuser">
{{> tab_histuser}}

{{> tabUser_ui_hist}}

</div>
{{/if}}
{{/if}}
</div>

{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/views/panels/user/friends.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<template name="tab_friends">
<template name="tabUser_ui_friends">
{{#if friendsCommon}}
<label>{{i18n 'label_friendscomm'}}</label>
<ul class="list-group list-items">
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/views/panels/user/friends.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

Template.tab_friends.helpers({
Template.tabUser_ui_friends.helpers({
friendsCommon: function() {
if(this.friends)
return _.intersection(this.friends, K.Profile.data.friends);
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/views/panels/user/histuser.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<template name="tab_histuser">
<template name="tabUser_ui_hist">
{{#if hist.length}}
<label>{{i18n 'label_histuser'}}</label>
<ul class="list-group list-items">
Expand Down
1 change: 0 additions & 1 deletion packages/ui/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Package.onUse(function(api) {
'client/views/panels/panelList.html',
'client/views/panels/panelList.js',
'client/views/panels/place.html',
'client/views/panels/place/histplace.html',
'client/views/panels/places.html',
'client/views/panels/places.js',
'client/views/panels/profile.html',
Expand Down
7 changes: 6 additions & 1 deletion private/settings.light-ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
}
},
"templates": {
"tabPlace_ui_hist": { "show": false},
"tabUser_ui_friends": { "show": false},
"tabUser_ui_hist": { "show": false},


"pageHome": {
"pageHome_theme": { "show": false }
},
Expand Down Expand Up @@ -108,7 +113,7 @@
},
"markerClusterPlace": {
"markerClusterPlace_ui_checkins": { "show": false }
},
},
"itemPlace": {
"itemPlace_ui_checkins": { "show": false },
"itemPlace_conver": { "show": false },
Expand Down

0 comments on commit 04ac771

Please sign in to comment.