move link to /locs to settings menu if we have more than one location and some template work on locs
This commit is contained in:
parent
0a14ac1f60
commit
a507063174
@ -501,6 +501,12 @@ function widget_settings_menu($arr) {
|
|||||||
if($abk)
|
if($abk)
|
||||||
$abook_self_id = $abk[0]['abook_id'];
|
$abook_self_id = $abk[0]['abook_id'];
|
||||||
|
|
||||||
|
$hublocs = q("select count(*) as total from hubloc where hubloc_hash = '%s'",
|
||||||
|
dbesc($channel['channel_hash'])
|
||||||
|
);
|
||||||
|
|
||||||
|
$hublocs = (($hublocs[0]['total'] > 1) ? true : false);
|
||||||
|
|
||||||
$tabs = array(
|
$tabs = array(
|
||||||
array(
|
array(
|
||||||
'label' => t('Account settings'),
|
'label' => t('Account settings'),
|
||||||
@ -534,14 +540,16 @@ function widget_settings_menu($arr) {
|
|||||||
'label' => t('Display settings'),
|
'label' => t('Display settings'),
|
||||||
'url' => $a->get_baseurl(true).'/settings/display',
|
'url' => $a->get_baseurl(true).'/settings/display',
|
||||||
'selected' => ((argv(1) === 'display') ? 'active' : ''),
|
'selected' => ((argv(1) === 'display') ? 'active' : ''),
|
||||||
);
|
|
||||||
|
|
||||||
$tabs[] = array(
|
|
||||||
'label' => t('Connected apps'),
|
|
||||||
'url' => $a->get_baseurl(true) . '/settings/oauth',
|
|
||||||
'selected' => ((argv(1) === 'oauth') ? 'active' : ''),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if($hublocs) {
|
||||||
|
$tabs[] = array(
|
||||||
|
'label' => t('Manage locations'),
|
||||||
|
'url' => $a->get_baseurl(true) . '/locs',
|
||||||
|
'selected' => ((argv(1) === 'locs') ? 'active' : ''),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// IF can go away when UNO export and import is fully functional
|
// IF can go away when UNO export and import is fully functional
|
||||||
if(! UNO) {
|
if(! UNO) {
|
||||||
$tabs[] = array(
|
$tabs[] = array(
|
||||||
|
11
mod/locs.php
11
mod/locs.php
@ -110,11 +110,12 @@ function locs_content(&$a) {
|
|||||||
|
|
||||||
$o = replace_macros(get_markup_template('locmanage.tpl'), array(
|
$o = replace_macros(get_markup_template('locmanage.tpl'), array(
|
||||||
'$header' => t('Manage Channel Locations'),
|
'$header' => t('Manage Channel Locations'),
|
||||||
'$loc' => t('Location (address)'),
|
'$loc' => t('Location'),
|
||||||
'$mkprm' => t('Primary Location'),
|
'$addr' => t('Address'),
|
||||||
'$drop' => t('Drop location'),
|
'$mkprm' => t('Primary'),
|
||||||
|
'$drop' => t('Drop'),
|
||||||
'$submit' => t('Submit'),
|
'$submit' => t('Submit'),
|
||||||
'$sync' => t('Sync now'),
|
'$sync' => t('Sync Now'),
|
||||||
'$sync_text' => t('Please wait several minutes between consecutive operations.'),
|
'$sync_text' => t('Please wait several minutes between consecutive operations.'),
|
||||||
'$drop_text' => t('When possible, drop a location by logging into that website/hub and removing your channel.'),
|
'$drop_text' => t('When possible, drop a location by logging into that website/hub and removing your channel.'),
|
||||||
'$last_resort' => t('Use this form to drop the location if the hub is no longer operating.'),
|
'$last_resort' => t('Use this form to drop the location if the hub is no longer operating.'),
|
||||||
@ -122,4 +123,4 @@ function locs_content(&$a) {
|
|||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
@ -167,9 +167,7 @@ function manage_content(&$a) {
|
|||||||
'$intros_format' => t('%d new introductions'),
|
'$intros_format' => t('%d new introductions'),
|
||||||
'$channel_usage_message' => $channel_usage_message,
|
'$channel_usage_message' => $channel_usage_message,
|
||||||
'$delegated_desc' => t('Delegated Channel'),
|
'$delegated_desc' => t('Delegated Channel'),
|
||||||
'$delegates' => $delegates,
|
'$delegates' => $delegates
|
||||||
'$locs' => t('Manage locations')
|
|
||||||
|
|
||||||
));
|
));
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
@ -1,3 +1,32 @@
|
|||||||
td {
|
#locs-index {
|
||||||
padding: 10px;
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locs-index th:nth-child(1),
|
||||||
|
#locs-index td:nth-child(1){
|
||||||
|
padding: 7px 3px 7px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locs-index th:nth-child(3),
|
||||||
|
#locs-index td:nth-child(3){
|
||||||
|
padding: 7px 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locs-index th:nth-child(4),
|
||||||
|
#locs-index td:nth-child(4){
|
||||||
|
padding: 7px 10px 7px 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primehub,
|
||||||
|
.drophub {
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.primehub:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drophub:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
color: red;
|
||||||
}
|
}
|
||||||
|
4
view/pdl/mod_locs.pdl
Normal file
4
view/pdl/mod_locs.pdl
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[region=aside]
|
||||||
|
[widget=settings_menu][/widget]
|
||||||
|
[/region]
|
||||||
|
|
4
view/pdl/mod_uexport.pdl
Normal file
4
view/pdl/mod_uexport.pdl
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[region=aside]
|
||||||
|
[widget=settings_menu][/widget]
|
||||||
|
[/region]
|
||||||
|
|
@ -44,10 +44,6 @@
|
|||||||
<i class="icon-user{{if $channel.intros != 0}} new-notification{{/if}}"></i>
|
<i class="icon-user{{if $channel.intros != 0}} new-notification{{/if}}"></i>
|
||||||
{{if $channel.intros != 0}}<a href='manage/{{$channel.channel_id}}/connections/ifpending'>{{/if}}{{$channel.intros|string_format:$intros_format}}{{if $channel.intros != 0}}</a>{{/if}}
|
{{if $channel.intros != 0}}<a href='manage/{{$channel.channel_id}}/connections/ifpending'>{{/if}}{{$channel.intros|string_format:$intros_format}}{{if $channel.intros != 0}}</a>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="channel-link">
|
|
||||||
<i class="icon-map-marker"></i>
|
|
||||||
<a href="manage/{{$channel.channel_id}}/locs">{{$locs}}</a>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,38 +1,41 @@
|
|||||||
<div class="generic-content-wrapper-styled">
|
<div class="generic-content-wrapper">
|
||||||
<h2>{{$header}}</h2>
|
<div class="section-title-wrapper">
|
||||||
|
<script>
|
||||||
<script>
|
function primehub(id) {
|
||||||
function primehub(id) {
|
$.post(baseurl + '/locs','primary='+id,function(data) { window.location.href=window.location.href; });
|
||||||
$.post(baseurl + '/locs','primary='+id,function(data) { window.location.href=window.location.href; });
|
}
|
||||||
}
|
function drophub(id) {
|
||||||
function drophub(id) {
|
$.post(baseurl + '/locs','drop='+id,function(data) { window.location.href=window.location.href; });
|
||||||
$.post(baseurl + '/locs','drop='+id,function(data) { window.location.href=window.location.href; });
|
}
|
||||||
}
|
</script>
|
||||||
</script>
|
<button class="btn btn-success btn-xs pull-right" onclick="window.location.href='/locs/f=&sync=1'; return false;"><i class="icon-refresh"></i> {{$sync}}</button>
|
||||||
|
<h2>{{$header}}</h2>
|
||||||
<div class="descriptive-text">{{$sync_text}}</div>
|
</div>
|
||||||
<br />
|
<div class="section-content-wrapper-np">
|
||||||
<div class="descriptive-text">{{$drop_text}}</div>
|
<div class="section-content-warning-wrapper">
|
||||||
<div class="descriptive-text">{{$last_resort}}</div>
|
{{$sync_text}}
|
||||||
<br />
|
</div>
|
||||||
|
<div class="section-content-info-wrapper">
|
||||||
|
{{$drop_text}}<br>
|
||||||
|
{{$last_resort}}
|
||||||
|
</div>
|
||||||
<table>
|
<table id="locs-index">
|
||||||
<tr><td>{{$loc}}</td><td>{{$mkprm}}</td><td>{{$drop}}</td></tr>
|
<tr>
|
||||||
{{foreach $hubs as $hub}}
|
<th>{{$loc}}</th>
|
||||||
{{if ! $hub.deleted }}
|
<th>{{$addr}}</th>
|
||||||
<tr><td>
|
<th>{{$mkprm}}</th>
|
||||||
{{$hub.hubloc_url}} ({{$hub.hubloc_addr}})</td>
|
<th>{{$drop}}</th>
|
||||||
<td>
|
</tr>
|
||||||
{{if $hub.primary}}<button class="btn btn-std"><i class="icon-check"></i></button>{{else}}<button class="btn btn-std" onclick="primehub({{$hub.hubloc_id}}); return false;" ><i class="icon-check-empty" ></i></button>{{/if}}
|
{{foreach $hubs as $hub}}
|
||||||
</td>
|
{{if ! $hub.deleted }}
|
||||||
<td><button class="btn btn-std" onclick="drophub({{$hub.hubloc_id}}); return false;"><i class="icon-trash"></i></button></td>
|
<tr>
|
||||||
</tr>
|
<td>{{$hub.hubloc_url}}</td>
|
||||||
{{/if}}
|
<td>{{$hub.hubloc_addr}}</td>
|
||||||
{{/foreach}}
|
<td>{{if $hub.primary}}<i class="icon-check"></i>{{else}}<i class="icon-check-empty primehub" onclick="primehub({{$hub.hubloc_id}}); return false;"></i>{{/if}}</td>
|
||||||
</table>
|
<td><i class="icon-trash drophub" onclick="drophub({{$hub.hubloc_id}}); return false;"></i></td>
|
||||||
|
</tr>
|
||||||
|
{{/if}}
|
||||||
|
{{/foreach}}
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
|
||||||
<button class="btn btn-std" onclick="window.location.href='/locs/f=&sync=1'; return false;">{{$sync}}</button>
|
|
||||||
|
Reference in New Issue
Block a user