Show the iCal sharing link instead of directly open it (references #141)

This commit is contained in:
Bernd Bestel 2019-03-05 19:36:14 +01:00
parent 4932b9c6d2
commit fcdeda91d9
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
4 changed files with 12 additions and 3 deletions

View File

@ -335,7 +335,8 @@ return array(
'This is for statistical purposes only' => 'This is for statistical purposes only',
'You have to select a recipe' => 'You have to select a recipe',
'Key type' => 'Key type',
'Export as iCal' => 'Export as iCal',
'Share/Integrate calendar (iCal)' => 'Share/Integrate calendar (iCal)',
'Use the following (public) URL to share or integrate the calendar in iCal format' => 'Use the following (public) URL to share or integrate the calendar in iCal format',
'Allow partial units in stock' => 'Allow partial units in stock',
'Enable tare weight handling' => 'Enable tare weight handling',
'This is useful e.g. for flour in jars - on purchase/consume/inventory you always weigh the whole jar, the amount to be posted is then automatically calculated based on what is in stock and the tare weight defined below' => 'This is useful e.g. for flour in jars - on purchase/consume/inventory you always weigh the whole jar, the amount to be posted is then automatically calculated based on what is in stock and the tare weight defined below',

View File

@ -506,3 +506,8 @@ $(".locale-number-format[data-format='currency']").each(function ()
{
$(this).text(parseFloat($(this).text()).toLocaleString(undefined, { style: "currency", currency: Grocy.Currency }));
});
$(document).on("click", ".easy-link-copy-textbox", function()
{
$(this).select();
});

View File

@ -17,7 +17,10 @@ $("#ical-button").on("click", function(e)
Grocy.Api.Get('calendar/ical/sharing-link',
function(result)
{
location.href = result.url;
bootbox.alert({
title: L('Share/Integrate calendar (iCal)'),
message: L('Use the following (public) URL to share or integrate the calendar in iCal format') + '<input type="text" class="form-control form-control-sm mt-2 easy-link-copy-textbox" value="' + result.url + '">'
});
},
function(xhr)
{

View File

@ -19,7 +19,7 @@
<h1>
@yield('title')
<a id="ical-button" class="btn btn-outline-dark" href="#">
<i class="fas fa-calendar-plus"></i>&nbsp;{{ $L('Export as iCal') }}
<i class="fas fa-calendar-plus"></i>&nbsp;{{ $L('Share/Integrate calendar (iCal)') }}
</a>
</h1>
</div>