mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-26 20:54:21 +01:00
confirm delete icalendar imports + fix display + add translations
This commit is contained in:
parent
d93ce15a47
commit
32e7fc3900
@ -762,8 +762,8 @@ Application.Controllers.controller('DeleteRecurrentAvailabilityController', ['$s
|
||||
* Controller used in the iCalendar (ICS) imports management page
|
||||
*/
|
||||
|
||||
Application.Controllers.controller('AdminICalendarController', ['$scope', 'iCalendars', 'ICalendar', 'growl', '_t',
|
||||
function ($scope, iCalendars, ICalendar, growl, _t) {
|
||||
Application.Controllers.controller('AdminICalendarController', ['$scope', 'iCalendars', 'ICalendar', 'dialogs', 'growl', '_t',
|
||||
function ($scope, iCalendars, ICalendar, dialogs, growl, _t) {
|
||||
// list of ICS sources
|
||||
$scope.calendars = iCalendars;
|
||||
|
||||
@ -813,17 +813,33 @@ Application.Controllers.controller('AdminICalendarController', ['$scope', 'iCale
|
||||
* @param calendar
|
||||
*/
|
||||
$scope.delete = function (calendar) {
|
||||
ICalendar.delete(
|
||||
{ id: calendar.id },
|
||||
dialogs.confirm(
|
||||
{
|
||||
resolve: {
|
||||
object () {
|
||||
return {
|
||||
title: _t('icalendar.confirmation_required'),
|
||||
msg: _t('icalendar.confirm_delete_import')
|
||||
};
|
||||
}
|
||||
}
|
||||
},
|
||||
function () {
|
||||
// success
|
||||
const idx = $scope.calendars.indexOf(calendar);
|
||||
$scope.calendars.splice(idx, 1);
|
||||
}, function (error) {
|
||||
// failed
|
||||
growl.error(_t('icalendar.delete_failed'));
|
||||
console.error(error);
|
||||
});
|
||||
ICalendar.delete(
|
||||
{ id: calendar.id },
|
||||
function () {
|
||||
// success
|
||||
const idx = $scope.calendars.indexOf(calendar);
|
||||
$scope.calendars.splice(idx, 1);
|
||||
growl.info(_t('icalendar.delete_success'));
|
||||
}, function (error) {
|
||||
// failed
|
||||
growl.error(_t('icalendar.delete_failed'));
|
||||
console.error(error);
|
||||
}
|
||||
);
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -40,7 +40,7 @@
|
||||
<tr ng-repeat="calendar in calendars">
|
||||
<td class="calendar-name">{{calendar.name}}</td>
|
||||
<td class="calendar-url"><a href="{{calendar.url}}" target="_blank">{{calendar.url}}</a></td>
|
||||
<td class="calendar-legend-block text-left"><span class="calendar-legend" ng-style="calendarStyle(calendar)" translate> {{ calendar.textHidden ? '' : 'icalendar.example' }}</span>
|
||||
<td class="calendar-legend-block text-left"><span class="calendar-legend" ng-style="calendarStyle(calendar)" translate> {{ calendar.text_hidden ? '' : 'icalendar.example' }}</span>
|
||||
<td class="calendar-actions">
|
||||
<button class="btn btn-info" ng-click="sync(calendar)"><i class="fa fa-refresh"></i></button>
|
||||
<button class="btn btn-danger" ng-click="delete(calendar)"><i class="fa fa-trash"></i></button>
|
||||
@ -72,7 +72,7 @@
|
||||
<div class="input-group-addon">
|
||||
<i class="fa fa-paint-brush"></i>
|
||||
</div>
|
||||
<input type="text" minicolors ng-model="newCalendar.text_color" class="form-control" placeholder="{{ 'icalendar.text_color' | translate}}" required/>
|
||||
<input type="text" minicolors ng-model="newCalendar.text_color" class="form-control" placeholder="{{ 'icalendar.text_color' | translate}}" ng-required="!newCalendar.text_hidden"/>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<label for="hideText" class="control-label m-r" translate>{{ 'icalendar.hide_text' }}</label>
|
||||
|
@ -36,7 +36,7 @@
|
||||
<h3 class="col-md-11 col-sm-11 col-xs-11 text-black" translate>{{ 'calendar.show_unavailables' }}</h3>
|
||||
<input class="col-md-1 col-sm-1 col-xs-1" type="checkbox" ng-model="filter.dispo" ng-change="filterAvailabilities(filter)">
|
||||
</div>
|
||||
<div class="m-t">
|
||||
<div class="m-t" ng-hide="externals.length == 0">
|
||||
<div class="row">
|
||||
<h3 class="col-md-11 col-sm-11 col-xs-11 text-black" translate>{{ 'calendar.externals' }}</h3>
|
||||
<input class="col-md-1 col-sm-1 col-xs-1" type="checkbox" ng-model="filter.externals" ng-change="toggleFilter('externals', filter)">
|
||||
|
@ -88,6 +88,28 @@ en:
|
||||
view_reservations: "View reservations"
|
||||
legend: "legend"
|
||||
|
||||
icalendar:
|
||||
icalendar:
|
||||
icalendar_import: "iCalendar import"
|
||||
intro: "Fab-manager allows to automatically import calendar events, at RFC 5545 iCalendar format, from external URL. These URL are synchronized every nights and the events are shown in the public calendar."
|
||||
new_import: "New ICS import"
|
||||
color: "Colour"
|
||||
text_color: "Text colour"
|
||||
url: "URL"
|
||||
name: "Name"
|
||||
example: "Example"
|
||||
display: "Display"
|
||||
hide_text: "Hide the text"
|
||||
hidden: "Hidden"
|
||||
shown: "Shown"
|
||||
create_error: "Unable to create iCalendar import. Please try again later"
|
||||
delete_failed: "Unable to delete the iCalendar import. Please try again later"
|
||||
refresh: "Updating..."
|
||||
sync_failed: "Unable to synchronize the URL. Please try again later"
|
||||
confirmation_required: "Confirmation required"
|
||||
confirm_delete_import: "Do you really want to delete this iCalendar import?"
|
||||
delete_success: "iCalendar import successfully deleted"
|
||||
|
||||
project_elements:
|
||||
# management of the projects' components
|
||||
project_elements:
|
||||
|
@ -88,6 +88,28 @@ es:
|
||||
view_reservations: "Ver reservas" # translation_missing
|
||||
legend: "leyenda"
|
||||
|
||||
icalendar:
|
||||
icalendar:
|
||||
icalendar_import: "iCalendar import" # translation_missing
|
||||
intro: "Fab-manager allows to automatically import calendar events, at RFC 5545 iCalendar format, from external URL. These URL are synchronized every nights and the events are shown in the public calendar." # translation_missing
|
||||
new_import: "New ICS import" # translation_missing
|
||||
color: "Colour" # translation_missing
|
||||
text_color: "Text colour" # translation_missing
|
||||
url: "URL" # translation_missing
|
||||
name: "Name" # translation_missing
|
||||
example: "Example" # translation_missing
|
||||
display: "Display" # translation_missing
|
||||
hide_text: "Hide the text" # translation_missing
|
||||
hidden: "Hidden" # translation_missing
|
||||
shown: "Shown" # translation_missing
|
||||
create_error: "Unable to create iCalendar import. Please try again later" # translation_missing
|
||||
delete_failed: "Unable to delete the iCalendar import. Please try again later" # translation_missing
|
||||
refresh: "Updating..." # translation_missing
|
||||
sync_failed: "Unable to synchronize the URL. Please try again later" # translation_missing
|
||||
confirmation_required: "Confirmation required" # translation_missing
|
||||
confirm_delete_import: "Do you really want to delete this iCalendar import?" # translation_missing
|
||||
delete_success: "iCalendar import successfully deleted" # translation_missing
|
||||
|
||||
project_elements:
|
||||
# management of the projects' components
|
||||
project_elements:
|
||||
|
@ -106,6 +106,9 @@ fr:
|
||||
delete_failed: "Impossible de supprimer l'import iCalendar. Veuillez réessayer ultérieurement"
|
||||
refresh: "Mise à jour en cours..."
|
||||
sync_failed: "Impossible de synchroniser l'URL. Veuillez réessayer ultérieurement"
|
||||
confirmation_required: "Confirmation requise"
|
||||
confirm_delete_import: "Êtes-vous sur de vouloir supprimer cet import iCalendar ?"
|
||||
delete_success: "L'import iCalendar a bien été supprimé"
|
||||
|
||||
project_elements:
|
||||
# gestion des éléments constituant les projets
|
||||
|
@ -88,6 +88,28 @@ pt:
|
||||
view_reservations: "Ver reservas" # translation_missing
|
||||
legend: "legenda"
|
||||
|
||||
icalendar:
|
||||
icalendar:
|
||||
icalendar_import: "iCalendar import" # translation_missing
|
||||
intro: "Fab-manager allows to automatically import calendar events, at RFC 5545 iCalendar format, from external URL. These URL are synchronized every nights and the events are shown in the public calendar." # translation_missing
|
||||
new_import: "New ICS import" # translation_missing
|
||||
color: "Colour" # translation_missing
|
||||
text_color: "Text colour" # translation_missing
|
||||
url: "URL" # translation_missing
|
||||
name: "Name" # translation_missing
|
||||
example: "Example" # translation_missing
|
||||
display: "Display" # translation_missing
|
||||
hide_text: "Hide the text" # translation_missing
|
||||
hidden: "Hidden" # translation_missing
|
||||
shown: "Shown" # translation_missing
|
||||
create_error: "Unable to create iCalendar import. Please try again later" # translation_missing
|
||||
delete_failed: "Unable to delete the iCalendar import. Please try again later" # translation_missing
|
||||
refresh: "Updating..." # translation_missing
|
||||
sync_failed: "Unable to synchronize the URL. Please try again later" # translation_missing
|
||||
confirmation_required: "Confirmation required" # translation_missing
|
||||
confirm_delete_import: "Do you really want to delete this iCalendar import?" # translation_missing
|
||||
delete_success: "iCalendar import successfully deleted" # translation_missing
|
||||
|
||||
project_elements:
|
||||
# management of the projects' components
|
||||
project_elements:
|
||||
|
Loading…
x
Reference in New Issue
Block a user