Add share button on own planning

This commit is contained in:
ostertun
2020-10-05 13:09:24 +02:00
parent 138071769c
commit 5e926f3e75
4 changed files with 18 additions and 6 deletions

View File

@@ -6,7 +6,8 @@
// Title
$content = '<h1>Saison-Planung</h1>';
$content .= '<p id="p-username"></p>';
$content .= '<p id="p-username" class="mb-1"></p>';
$content .= $tpl->load('button', ['<i class="fas fa-share-alt"></i>&ensp;Teilen', '#', 'html-id' => 'button-share']);
$content .= $tpl->load('select', ['html-id' => 'select-year', 'placeholder' => 'Jahr', 'css-class' => 'mt-3 mb-0']);
$sp['output'] .= $tpl->load('card', [$content]);

View File

@@ -3,27 +3,27 @@
<div class="content mb-0">
<div class="divider mb-0"></div>
<div class="list-group list-custom-small list-icon-0">
<a href="#" class="shareToFacebook">
<a href="#" class="shareToFacebook" target="_blank">
<i class="font-18 fab fa-facebook color-facebook"></i>
<span class="font-13">Facebook</span>
<i class="fa fa-angle-right"></i>
</a>
<a href="#" class="shareToTwitter">
<a href="#" class="shareToTwitter" target="_blank">
<i class="font-18 fab fa-twitter-square color-twitter"></i>
<span class="font-13">Twitter</span>
<i class="fa fa-angle-right"></i>
</a>
<a href="#" class="shareToLinkedIn">
<a href="#" class="shareToLinkedIn" target="_blank">
<i class="font-18 fab fa-linkedin color-linkedin"></i>
<span class="font-13">LinkedIn</span>
<i class="fa fa-angle-right"></i>
</a>
<a href="#" class="shareToWhatsApp">
<a href="#" class="shareToWhatsApp" target="_blank">
<i class="font-18 fab fa-whatsapp-square color-whatsapp"></i>
<span class="font-13">WhatsApp</span>
<i class="fa fa-angle-right"></i>
</a>
<a href="#" class="shareToMail border-0">
<a href="#" class="shareToMail border-0" target="_blank">
<i class="font-18 fa fa-envelope-square color-mail"></i>
<span class="font-13">Email</span>
<i class="fa fa-angle-right"></i>

View File

@@ -115,6 +115,8 @@ var siteScript = async function() {
$('#switch-status-bezahlt').parent().parent().click(planningSwitchChanged);
}
$('#a-share-planning').attr('href', LINK_PRE + 'planning_view?user=' + USER_ID);
today = getToday();
var selectedYear = $('#select-year').val();

View File

@@ -46,6 +46,15 @@ var siteScript = async function() {
$('#p-username').text(user.username);
if (isLoggedIn() && (userid == USER_ID)) {
$('#button-share').show();
$('#button-share').click(function(){
$('#menu-share').showMenu();
});
} else {
$('#button-share').hide();
}
if (firstCall) {
firstCall = false;
initYear();