Merge branch 'dev' into oauth2

This commit is contained in:
Andrew Manning 2018-02-25 08:36:52 -05:00
commit e3095ce6b2
14 changed files with 79 additions and 16 deletions

View File

@ -245,6 +245,11 @@ class Connections extends \Zotlabs\Web\Controller {
((intval($rr['abook_blocked'])) ? t('Blocked') : ''),
((intval($rr['abook_not_here'])) ? t('Not connected at this location') : '')
);
$oneway = false;
if(! intval(get_abconfig(local_channel(),$rr['xchan_hash'],'their_perms','post_comments'))) {
$oneway = true;
}
foreach($status as $str) {
if(!$str)
@ -283,7 +288,8 @@ class Connections extends \Zotlabs\Web\Controller {
'ignore_hover' => t('Ignore connection'),
'ignore' => ((! $rr['abook_ignored']) ? t('Ignore') : false),
'recent_label' => t('Recent activity'),
'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id'])
'recentlink' => z_root() . '/network/?f=&cid=' . intval($rr['abook_id']),
'oneway' => $oneway
);
}
}

View File

@ -304,7 +304,7 @@ class Profile_photo extends \Zotlabs\Web\Controller {
}
$channel = \App::get_channel();
$pf = 0;
$newuser = false;
if(argc() == 2 && argv(1) === 'new')
@ -318,8 +318,8 @@ class Profile_photo extends \Zotlabs\Web\Controller {
$resource_id = argv(2);
// When using an existing photo, we don't have a dialogue to offer a choice of profiles,
// so it gets attached to the default
$pf = (($_REQUEST['pf']) ? intval($_REQUEST['pf']) : 0);
$c = q("select id, is_default from profile where uid = %d",
intval(local_channel())
@ -331,6 +331,9 @@ class Profile_photo extends \Zotlabs\Web\Controller {
$_REQUEST['profile'] = $c[0]['id'];
$multi_profiles = false;
}
else {
$_REQUEST['profile'] = $pf;
}
$r = q("SELECT id, album, imgscale FROM photo WHERE uid = %d AND resource_id = '%s' ORDER BY imgscale ASC",
intval(local_channel()),
@ -430,6 +433,16 @@ class Profile_photo extends \Zotlabs\Web\Controller {
intval(local_channel())
);
if($profiles) {
for($x = 0; $x < count($profiles); $x ++) {
$profiles[$x]['selected'] = false;
if($pf && $profiles[$x]['id'] == $pf)
$profiles[$x]['selected'] = true;
if((! $pf) && $profiles[$x]['is_default'])
$profiles[$x]['selected'] = true;
}
}
$importing = ((array_key_exists('importfile',\App::$data)) ? true : false);
if(! x(\App::$data,'imagecrop')) {

View File

@ -44,7 +44,7 @@ class Viewconnections extends \Zotlabs\Web\Controller {
$sql_extra = '';
if(! $is_owner) {
$abook_flags = " and abook_hidden = 0 ";
$abook_flags .= " and abook_hidden = 0 ";
$sql_extra = " and xchan_hidden = 0 ";
}
@ -69,8 +69,13 @@ class Viewconnections extends \Zotlabs\Web\Controller {
$contacts = array();
foreach($r as $rr) {
$oneway = false;
if(! intval(get_abconfig(\App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_comments'))) {
$oneway = true;
}
$url = chanlink_hash($rr['xchan_hash']);
$url = chanlink_hash($rr['xchan_hash']);
if($url) {
$contacts[] = array(
'id' => $rr['abook_id'],
@ -83,6 +88,7 @@ class Viewconnections extends \Zotlabs\Web\Controller {
'sparkle' => '',
'itemurl' => $rr['url'],
'network' => '',
'oneway' => $oneway
);
}
}

View File

@ -1617,13 +1617,16 @@ function get_site_info() {
'lastpoll' => get_config('system','lastpoll'),
'info' => (($site_info) ? $site_info : ''),
'channels_total' => $channels_total_stat,
'channels_active_halfyear' => $channels_active_halfyear_stat,
'channels_active_monthly' => $channels_active_monthly_stat,
'local_posts' => $local_posts_stat,
'local_comments' => $local_comments_stat,
'hide_in_statistics' => $hide_in_statistics
];
if(! $hide_in_statistics) {
$data['channels_active_halfyear'] = $channels_active_halfyear_stat;
$data['channels_active_monthly'] = $channels_active_monthly_stat;
$data['local_posts'] = $local_posts_stat;
$data['local_comments'] = $local_comments_stat;
}
return $data;
}

View File

@ -979,7 +979,7 @@ function contact_block() {
// than wishful thinking; even though soapbox channels and feeds will disable it.
if(! intval(get_abconfig(App::$profile['uid'],$rr['xchan_hash'],'their_perms','post_comments'))) {
$rr['archived'] = true;
$rr['oneway'] = true;
}
$micropro[] = micropro($rr,true,'mpfriend');
}
@ -1033,6 +1033,7 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) {
return replace_macros(get_markup_template(($textmode)?'micropro_txt.tpl':'micropro_img.tpl'),array(
'$click' => (($contact['click']) ? $contact['click'] : ''),
'$class' => $class . (($contact['archived']) ? ' archived' : ''),
'$oneway' => (($contact['oneway']) ? true : false),
'$url' => $url,
'$photo' => $contact['xchan_photo_s'],
'$name' => $contact['xchan_name'],

View File

@ -36,4 +36,10 @@
.connphone {
color: green;
}
}
.contact-photo-wrapper .oneway-overlay {
margin-top: -25px;
margin-left: 53px;
font-size: 20px;
}

View File

@ -31,3 +31,9 @@
.contact-entry-end {
clear: both;
}
.contact-entry-photo-wrapper .oneway-overlay {
margin-top: 25px;
margin-left: -25px;
font-size: 20px;
}

View File

@ -216,3 +216,10 @@ a.wikilist {
#notifications {
margin-bottom: 1rem;
}
/* contact block */
.contact-block-div .oneway-overlay {
font-size: 20px;
margin-left: -25px;
margin-top: 25px;
}

View File

@ -37,7 +37,9 @@
$.post("embedphotos/photolink", {href: href},
function(ddata) {
if (ddata['status']) {
window.location.href = 'profile_photo/use/' + ddata['resource_id'];
var pf = $('#profile-photo-profiles').val();
var prof = ((typeof pf !== 'undefined') ? '?f=&pf=' + pf : '');
window.location.href = 'profile_photo/use/' + ddata['resource_id'] + prof;
} else {
window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']);
}

View File

@ -1800,3 +1800,8 @@ dl.bb-dl > dd > li {
.caption-visible {
max-height: 75%;
}
.oneway-overlay {
position: absolute;
text-shadow: -2px 0 1px #fff, 0 2px 1px#fff, 2px 0 1px #fff, 0 -2px 1px #fff;
}

View File

@ -18,7 +18,12 @@
</div>
<div class="section-content-tools-wrapper">
<div class="contact-photo-wrapper" >
<a href="{{$contact.url}}" title="{{$contact.img_hover}}" ><img class="directory-photo-img {{if $contact.classes}}{{$contact.classes}}{{/if}}" src="{{$contact.thumb}}" alt="{{$contact.name}}" /></a>
<a href="{{$contact.url}}" title="{{$contact.img_hover}}" >
<img class="directory-photo-img {{if $contact.classes}}{{$contact.classes}}{{/if}}" src="{{$contact.thumb}}" alt="{{$contact.name}}" />
</a>
{{if $contact.oneway}}
<i class="fa fa-fw fa-minus-circle oneway-overlay text-danger"></i>
{{/if}}
</div>
<div class="contact-info">
{{if $contact.status}}

View File

@ -1,6 +1,9 @@
<div class="contact-entry-wrapper" id="contact-entry-wrapper-{{$contact.id}}" >
<div class="contact-entry-photo-wrapper" >
<a href="{{$contact.link}}" title="{{$contact.img_hover}}" ><img class="contact-block-img" src="{{$contact.thumb}}" alt="{{$contact.name}}" /></a>
{{if $contact.oneway}}
<i class="fa fa-fw fa-minus-circle oneway-overlay text-danger"></i>
{{/if}}
</div>
<div class="contact-entry-photo-end" ></div>
<div class="contact-entry-name" id="contact-entry-name-{{$contact.id}}" >{{$contact.name}}</div>

View File

@ -1 +1 @@
<div class="contact-block-div{{if $class}} {{$class}}{{/if}}"><a class="contact-block-link{{if $class}} {{$class}}{{/if}}{{if $click}} fakelink{{/if}}" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}><img class="contact-block-img{{if $class}} {{$class}}{{/if}}" src="{{$photo}}" title="{{$title}}" alt="" /></a></div>
<div class="contact-block-div{{if $class}} {{$class}}{{/if}}"><a class="contact-block-link{{if $class}} {{$class}}{{/if}}{{if $click}} fakelink{{/if}}" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}><img class="contact-block-img{{if $class}} {{$class}}{{/if}}" src="{{$photo}}" title="{{$title}}" alt="" />{{if $oneway}}<i class="fa fa-fw fa-minus-circle oneway-overlay text-danger"></i>{{/if}}</a></div>

View File

@ -27,7 +27,7 @@
<label id="profile-photo-profiles-label" class="form-label" for="profile-photo-profiles">{{$lbl_profiles}}</label>
<select name="profile" id="profile-photo-profiles" class="form-control" >
{{foreach $profiles as $p}}
<option value="{{$p.id}}" {{if $p.is_default}}selected="selected"{{/if}}>{{$p.name}}</option>
<option value="{{$p.id}}" {{if $p.selected}}selected="selected"{{/if}}>{{$p.name}}</option>
{{/foreach}}
</select>
<div class="clear"></div>