Skip to content

Commit

Permalink
add empty content warning
Browse files Browse the repository at this point in the history
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
  • Loading branch information
georgehrke authored and DeepDiver1975 committed Aug 25, 2017
1 parent 64a0e57 commit 936f975
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions css/app/globals.css
Expand Up @@ -56,3 +56,18 @@
height: 32px;
width: 32px;
}

#emptycontent-container {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(255, 255, 255, .85);
z-index: 1000;
}

.icon-calendar {
background-image: url('../../img/favicon-touch.svg');
}
3 changes: 3 additions & 0 deletions js/app/controllers/calcontroller.js
Expand Up @@ -140,6 +140,9 @@ app.controller('CalController', ['$scope', 'Calendar', 'CalendarService', 'VEven
is.loading = false;
// TODO - scope.apply should not be necessary here
$scope.$apply();
}).catch((reason) => {
angular.element('#header-right').css('display', 'none');
angular.element('#emptycontent-container').css('display', 'block');
});
}

Expand Down
4 changes: 4 additions & 0 deletions templates/main.php
Expand Up @@ -100,6 +100,10 @@
<div id="importpopover-container"></div>
<?php endif; ?>

<div id="emptycontent-container">
<?php print_unescaped($this->inc('part.emptycontent')); ?>
</div>

<script type="text/ng-template" id="eventspopovereditor.html">
<?php print_unescaped($this->inc('editor.popover')); ?>
</script>
Expand Down
5 changes: 5 additions & 0 deletions templates/part.emptycontent.php
@@ -0,0 +1,5 @@
<div id="emptycontent">
<div class="icon-calendar"></div>
<h2><?php p($l->t('Calendar does not exist')); ?></h2>
<p><?php p($l->t('Maybe you got a wrong link or the calendar was unshared?')); ?></p>
</div>

0 comments on commit 936f975

Please sign in to comment.