{% extends "_layouts/base" %} {# Give the body a .mobile class for mobile devices #} {% if craft.app.request.isMobileBrowser(true) %} {% set bodyClass = (bodyClass is defined and bodyClass ? bodyClass~' ' : '') ~ 'mobile' %} {% endif %} {% do view.registerTranslations('app', [ "Show", "Hide", ]) %} {% set localeData = craft.app.locale %} {% set orientation = localeData.getOrientation() %} {% block foot %}
{% js at head %} // Create the Craft object window.Craft = { systemUid: "{{ craft.app.getSystemUid()|e('js') }}", baseUrl: "{{ url()|e('js') }}", baseCpUrl: "{{ cpUrl()|e('js') }}", baseSiteUrl: "{{ siteUrl()|e('js') }}", actionUrl: "{{ actionUrl()|e('js') }}", jqueryPaymentUrl: "{{ (view.getAssetManager().getPublishedUrl('@lib/jquery.payment', true)~'/jquery.payment.js')|e('js') }}", scriptName: "{{ craft.app.request.getScriptFilename()|e('js') }}", omitScriptNameInUrls: {{ craft.app.config.general.omitScriptNameInUrls ? 'true' : 'false' }}, usePathInfo: {{ craft.app.config.general.usePathInfo ? 'true' : 'false' }}, useCompressedJs: {{ craft.app.config.general.useCompressedJs ? 'true' : 'false' }}, actionTrigger: "{{ craft.app.config.general.actionTrigger|e('js') }}", path: "{{ craft.app.request.getPathInfo()|e('js') }}", language: "{{ craft.app.language|e('js') }}", timezone: "{{ craft.app.getTimeZone()|e('js') }}", siteId: {{ craft.app.isInstalled and not craft.app.updates.isCraftDbMigrationNeeded ? craft.app.sites.currentSite.id : 'null' }}, orientation: "{{ orientation|e('js') }}", left: "{{ orientation == 'ltr' ? 'left' : 'right' }}", right: "{{ orientation == 'ltr' ? 'right' : 'left' }}", username: {{ currentUser is defined and currentUser ? ('"'~currentUser.username|e('js')~'"')|raw : 'null' }}, remainingSessionTime: {{ craft.app.request.getSegment(1) not in ['updates', 'manualupdate'] ? craft.app.user.getRemainingSessionTime() : 0 }}, Solo: {{ CraftSolo }}, Pro: {{ CraftPro }}, edition: {{ CraftEdition }}, isMultiSite: {{ craft.app.getIsMultiSite() ? 'true' : 'false' }}, translations: {}, maxUploadSize: {{ craft.io.getMaxUploadSize() }}, isImagick: {{ craft.app.images.getIsImagick() ? 'true' : 'false' }}, forceConfirmUnload: {{ forceConfirmUnload is defined and forceConfirmUnload ? 'true' : 'false' }}, defaultIndexCriteria: { enabledForSite: null }, {% if craft.app.config.general.enableCsrfProtection %} csrfTokenValue: "{{ craft.app.request.getCsrfToken()|e('js') }}", csrfTokenName: "{{ craft.app.config.general.csrfTokenName|e('js') }}", {% endif %} runQueueAutomatically: {{ craft.app.config.general.runQueueAutomatically ? 'true' : 'false' }}, slugWordSeparator: "{{ craft.app.config.general.slugWordSeparator|e('js') }}", limitAutoSlugsToAscii: {{ craft.app.config.general.limitAutoSlugsToAscii ? 'true' : 'false' }}, fileKinds: {{ craft.io.getFileKinds()|json_encode|raw }}, datepickerOptions: { constrainInput: false, dateFormat: "{{ localeData.getDateFormat('short', 'jui')|e('js') }}", prevText: '{{ "Prev"|t('app')|e('js') }}', nextText: '{{ "Next"|t('app')|e('js') }}', firstDay: {{ currentUser.getPreference('weekStartDay') ?? craft.app.config.general.defaultWeekStartDay }}, dayNames: {{ localeData.getWeekDayNames('full', true)|json_encode|raw }}, dayNamesShort: {{ localeData.getWeekDayNames('short', true)|json_encode|raw }}, dayNamesMin: {{ localeData.getWeekDayNames('abbreviated', true)|json_encode|raw }}, monthNames: {{ localeData.getMonthNames('full', true)|values|json_encode|raw }}, monthNamesShort: {{ localeData.getMonthNames('abbreviated', true)|values|json_encode|raw }} }, timepickerOptions: { timeFormat: '{{ localeData.getTimeFormat('short', 'php') }}', closeOnWindowScroll: false, orientation: '{{ orientation == 'ltr' ? 'l' : 'r' }}', lang: { am: '{{ localeData.getAMName()|lower }}', AM: '{{ localeData.getAMName() }}', pm: '{{ localeData.getPMName()|lower }}', PM: '{{ localeData.getPMName() }}' } }, primarySiteId: {{ craft.app.isInstalled and not craft.app.updates.isCraftDbMigrationNeeded ? craft.app.sites.primarySite.id : 'null' }}, sites: [ {% for site in craft.app.sites.getAllSites() %} { id: {{ site.id }}, handle: "{{ site.handle|e('js') }}", name: "{{ site.name|t('site')|e('js') }}" }{% if not loop.last %},{% endif %} {% endfor %} ], publishableSections: [ {% if isInstalled and currentUser is defined and currentUser %} {% for section in craft.app.sections.getEditableSections() %} {% if section.type != 'single' and currentUser.can('createEntries:'~section.id) %} { id: {{ section.id }}, name: "{{ section.name|t('site')|e('js') }}", handle: "{{ section.handle|e('js') }}", type: "{{ section.type }}", entryTypes: [ {% for entryType in section.getEntryTypes() %} { id: {{ entryType.id }}, name: "{{ entryType.name|t('site')|e('js') }}", handle: "{{ entryType.handle|e('js') }}" }{% if not loop.last %},{% endif %} {% endfor %} ] }{% if not loop.last %},{% endif %} {% endif %} {% endfor %} {% endif %} ], editableCategoryGroups: [ {% if isInstalled %} {% for group in craft.app.categories.getEditableGroups() %} {id: {{ group.id }}, name: "{{ group.name|t('site')|e('js') }}", handle: "{{ group.handle|e('js') }}"}{% if not loop.last %},{% endif %} {% endfor %} {% endif %} ] }; // Picture element HTML5 shiv document.createElement('picture'); {% endjs %} {% endblock %}