[%
USE Uapi;
USE JSON;
SET CPANEL.CPVAR.dprefix = "../../";
SET user = CPANEL.FORM.user;
SET is_me = !user;
SET config = Uapi.exec('DAV', 'get_calendar_contacts_config', { user => user });
SET cpdavd_enabled = ExpVar.expand('$hascpdavd') ? 1 : 0;
SET user = config.data.user;
SET title = (is_me ? locale.maketext('Calendars and Contacts Configuration') : locale.maketext('Calendars and Contacts Configuration for: [_1]', user));
SET has_feature = CPANEL.feature('caldavcarddav');
%]
[% WRAPPER '_assets/master.html.tt'
app_key = 'calendar_and_contacts'
page_title = title
include_legacy_stylesheets = 0
include_legacy_scripts = 1
include_cjt = 1
use_master_bootstrap = 0
page_stylesheets = [
'mail/calendars_and_contacts/index.css'
]
-%]
<div class="body-content">
[% IF !has_feature %]
<div class="alert alert-danger">
<span class="glyphicon glyphicon-exclamation-sign"></span>
<div class="alert-message">
<strong>[% locale.maketext('Error:') %]</strong> [% locale.maketext('You do not have access to this feature!') %]
</div>
</div>
[% ELSIF !cpdavd_enabled %]
<div class="alert alert-danger">
<span class="glyphicon glyphicon-exclamation-sign"></span>
<div class="alert-message">
<strong>[% locale.maketext('Error:') %]</strong> [% locale.maketext('Your server administrator must enable the [asis,cpdavd] service to use this feature.') %]
</div>
</div>
[% END %]
[% IF !config.status %]
<div class="alert alert-danger">
<span class="glyphicon glyphicon-exclamation-sign"></span>
<div class="alert-message">
<strong>[% locale.maketext('Error:') %]</strong> [% config.errors_as_string() FILTER html %]
</div>
</div>
[% ELSE %]
<div ng-controller="applicationController">
<div id="viewContent"
class="ng-cloak"
ng-view
ng-cloak></div>
</div>
[% END %]
</div>
[% IF has_feature; # No point in loading the other assets if this is dead in the water %]
<script type="text/javascript">
PAGE.config = [% config.data.json() %];
</script>
[% PROCESS '_assets/cjt2_header_include.tt' %]
[% END %]
[% END #wrapper -%]