Compare commits
2 commits
eb50618fe8
...
6698e27300
Author | SHA1 | Date | |
---|---|---|---|
|
6698e27300 | ||
|
ebafb4cae6 |
3 changed files with 28 additions and 9 deletions
|
@ -102,8 +102,15 @@ class VCard
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
|
if ($contact['contact-type'] == Contact::TYPE_COMMUNITY) {
|
||||||
$showgroup_link = 'network/group/' . $id;
|
$mention_label = DI::l10n()->t('Post to group');
|
||||||
|
$mention_url = 'compose/0?body=!' . $contact['addr'];
|
||||||
|
$showgroup_label = DI::l10n()->t('View group');
|
||||||
|
$showgroup_url = 'network/group/' . $id;
|
||||||
|
} else {
|
||||||
|
$mention_label = DI::l10n()->t('Mention');
|
||||||
|
$mention_url = 'compose/0?body=@' . $contact['addr'];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [
|
return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [
|
||||||
|
@ -124,10 +131,8 @@ class VCard
|
||||||
'$unfollow_link' => $unfollow_link,
|
'$unfollow_link' => $unfollow_link,
|
||||||
'$wallmessage' => DI::l10n()->t('Message'),
|
'$wallmessage' => DI::l10n()->t('Message'),
|
||||||
'$wallmessage_link' => $wallmessage_link,
|
'$wallmessage_link' => $wallmessage_link,
|
||||||
'$mention' => DI::l10n()->t('Mention'),
|
'$mention' => [$mention_label, $mention_url],
|
||||||
'$posttogroup' => DI::l10n()->t('Post to group'),
|
'$showgroup' => [$showgroup_label, $showgroup_url]
|
||||||
'$showgroup' => DI::l10n()->t('View group'),
|
|
||||||
'$showgroup_link' => $showgroup_link,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,20 @@ $(document).ready(function () {
|
||||||
target: ".flex-target",
|
target: ".flex-target",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// add mention-link button to the second navbar
|
||||||
|
let $mentionButton = $("#mention-link-button");
|
||||||
|
if ($mentionButton.length) {
|
||||||
|
$mentionButton.appendTo("#topbar-second > .container > #navbar-button").css("padding", "2");
|
||||||
|
$("#mention-link").addClass("btn-sm ");
|
||||||
|
$("#mention-link > span i").addClass("fa-2x");
|
||||||
|
if ($mentionButton.hasClass("modal-open")) {
|
||||||
|
$mentionButton.on("click", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
jotShow();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// add Jot button to the second navbar
|
// add Jot button to the second navbar
|
||||||
let $jotButton = $("#jotOpen");
|
let $jotButton = $("#jotOpen");
|
||||||
if ($jotButton.length) {
|
if ($jotButton.length) {
|
||||||
|
|
|
@ -58,17 +58,17 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $contact.addr}}
|
{{if $contact.addr}}
|
||||||
<div id="mention-link-button">
|
<div id="mention-link-button">
|
||||||
<button type="button" id="mention-link" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="openWallMessage('compose/0?body={{if $contact.forum==1}}!{{else}}@{{/if}}{{$contact.addr}}')">
|
<button type="button" id="mention-link" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="openWallMessage('{{$mention.1}}')" titel="{{$mention.0}}" aria-label="{{$mention.0}}">
|
||||||
<span class=""><i class="fa fa-pencil-square-o"></i></span>
|
<span class=""><i class="fa fa-pencil-square-o"></i></span>
|
||||||
<span class="">{{if $contact.forum==1}}{{$posttogroup}}{{else}}{{$mention}}{{/if}}</span>
|
<span class="">{{$mention.0}}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $contact.forum==1 || $contact.prv==1}}
|
{{if $contact.forum==1 || $contact.prv==1}}
|
||||||
<div id="show-group-button">
|
<div id="show-group-button">
|
||||||
<button type="button" id="show-group" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="window.location.href='{{$showgroup_link}}'">
|
<button type="button" id="show-group" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="window.location.href='{{$showgroup.1}}'">
|
||||||
<span class=""><i class="fa fa-group"></i></span>
|
<span class=""><i class="fa fa-group"></i></span>
|
||||||
<span class="">{{$showgroup}}</span>
|
<span class="">{{$showgroup.0}}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
Loading…
Reference in a new issue