Viewing File: /usr/local/cpanel/base/frontend/jupiter/passenger/index.html.tt

[%

SET CPANEL.CPVAR.dprefix = "../";

SET domains_result = execute('DomainInfo', 'list_domains', {});

# NOTE: The resource_usage_macro.html.tt macro was not used here
# because we need to be able to control the hiding and showing of the
# add application button using client-side logic. We only need the upper
# limit to do this.
IF !CPANEL.CPDATA.exists('MAXPASSENGERAPPS') || CPANEL.CPDATA.item('MAXPASSENGERAPPS') == '';
    SET MAX_PASSENGER_APPS = 4;
ELSE;
    IF CPANEL.CPDATA.item('MAXPASSENGERAPPS') == 'unlimited';
        SET MAX_PASSENGER_APPS = "Infinity";
    ELSE;
        SET MAX_PASSENGER_APPS = CPANEL.CPDATA.item('MAXPASSENGERAPPS');
    END;
END;

SET stylesheets = [];
IF !CPANEL.ua_is_mobile;
    stylesheets.push("css/angular-chosen-spinner.css");
    stylesheets.push("libraries/chosen/1.5.1/chosen.min.css");
END;
stylesheets.push('passenger/index.css');

WRAPPER '_assets/master.html.tt'
    app_key = 'application_manager'
    include_legacy_stylesheets = 0
    include_legacy_scripts = 0
    include_cjt = 0
    include_lang = 0
    use_master_bootstrap = 0
    page_stylesheets = stylesheets
-%]

    <div class="body-content">
        <p id="descPassenger" class="description">
            [% locale.maketext("This feature allows you to register, manage, and deploy your custom applications using [asis,Phusion Passenger].") %]
        </p>

        <!-- NOTE: leave the alert-group in single quotes -->
        <cp-alert-list alert-group="'passenger'"></cp-alert-list>
        <div id="viewContent"
             class="ng-cloak"
             ng-view
             ng-cloak></div>
    </div>

    <script type="text/javascript">
        var PAGE = PAGE || {};
        PAGE.domains = [% domains_result.data.json() || '{}' %];
        PAGE.has_mod_env = [% CPANEL.has_modenv().json() || 'false' %];
        PAGE.homedir = [% CPANEL.homedir.json() || '""' %];
        PAGE.max_passenger_apps = [% MAX_PASSENGER_APPS.json() %];
        PAGE.securityToken = [% CPANEL.ENV.cp_security_token.json() || '""' %];
    </script>

    [% PROCESS '_assets/cjt2_header_include.tt' %]

    <script id="passenger/views/manage.ptt" type="text/ng-template">
        [% PROCESS "passenger/views/manage.ptt" %]
    </script>
    <script id="passenger/views/details.ptt" type="text/ng-template">
        [% PROCESS "passenger/views/details.ptt" %]
    </script>
    <script id="passenger/directives/table_row_form.ptt" type="text/ng-template">
        [% PROCESS "passenger/directives/table_row_form.ptt" %]
    </script>

    <script type="text/ng-template" id="select_directory.html">
        <div class="modal-header">
            <h4 class="modal-title" id="selectDirectoryModalLabel">[% locale.maketext('Select Directory') %]</h4>
        </div>
        <div class="modal-body directory-browser">
            <div class="directory-browser-breadcrumb">
                <span class="directory-browser-path-label">[% locale.maketext('Selected Path:') %]</span>
                <span class="directory-browser-path-icon">
                    <i class="fas fa-home" aria-hidden="true"></i>
                </span>
                <span class="directory-browser-path-value"
                      ng-bind="ctrl.getDisplayPath()">
                </span>
            </div>
            <div class="directory-browser-loading" ng-if="ctrl.isLoading"
                role="status" aria-live="polite">
                <i class="fas fa-spinner fa-spin" aria-hidden="true"></i>
                [% locale.maketext('Loading …') %]
            </div>
            <div class="directory-browser-error"
                role="alert"
                aria-live="assertive"
                ng-if="!ctrl.isLoading && ctrl.errorMessage">
                <i class="fas fa-exclamation-triangle" aria-hidden="true"></i>
                <span ng-bind="ctrl.errorMessage"></span>
            </div>
            <div class="directory-browser-list" ng-if="!ctrl.isLoading && !ctrl.errorMessage"
                role="list"
                aria-label="[% locale.maketext('Directories') %]">
                <div role="listitem">
                    <button type="button"
                        class="directory-browser-item directory-browser-item-home"
                        ng-class="{ 'active': ctrl.currentPath === '' }"
                        ng-click="ctrl.navigateTo('')">
                        <i class="fas fa-home directory-browser-item-icon" aria-hidden="true"></i>
                        <span>[% locale.maketext('Home') %]</span>
                    </button>
                </div>
                <div role="listitem"
                    ng-if="ctrl.hasParentDirectory()">
                    <button type="button"
                        class="directory-browser-item directory-browser-item-parent"
                        ng-click="ctrl.navigateToParent()">
                        <i class="fas fa-level-up-alt directory-browser-item-icon" aria-hidden="true"></i>
                        <span>[% locale.maketext('Parent Directory') %]</span>
                    </button>
                </div>
                <div class="directory-browser-item"
                    role="listitem"
                    ng-repeat="dir in ctrl.directories"
                    ng-class="{ 'active': ctrl.selectedDir === dir.name }">
                    <button type="button"
                        class="directory-browser-item-select"
                        ng-attr-aria-pressed="{{ ctrl.selectedDir === dir.name ? 'true' : 'false' }}"
                        ng-click="ctrl.selectDirectory(dir.name)">
                        <i class="fas fa-folder directory-browser-item-icon" aria-hidden="true"></i>
                        <span ng-bind="dir.name"></span>
                    </button>
                    <button type="button"
                        class="directory-browser-item-arrow"
                        ng-click="ctrl.navigateInto(dir.name, $event)"
                        aria-label="[% locale.maketext('Open [_1]', '{{dir.name}}') %]">
                        &rarr;
                    </button>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <div class="pull-left">
                <button type="button"
                    id="newFolderBtn"
                    class="btn btn-default"
                    ng-click="ctrl.openCreateFolderModal()"
                    ng-disabled="ctrl.isLoading">
                    [% locale.maketext('New Folder') %]
                </button>
            </div>
            <button type="button"
                class="btn btn-link"
                ng-click="ctrl.cancel()">
                [% locale.maketext('Cancel') %]
            </button>
            <button type="button"
                id="selectDirectoryBtn"
                class="btn btn-primary"
                ng-click="ctrl.selectAndClose()">
                [% locale.maketext('Select Directory') %]
            </button>
        </div>
    </script>

    <script type="text/ng-template" id="create_directory.html">
        <div class="modal-header">
            <h4 class="modal-title" id="createDirectoryModalLabel">[% locale.maketext('New Folder') %]</h4>
        </div>
        <form ng-submit="ctrl.submit()" novalidate>
            <div class="modal-body">
                <div class="form-group directory-browser-create-form">
                    <label class="directory-browser-create-label" for="newFolderNameInput">
                        [% locale.maketext('New Folder Name:') %]
                    </label>
                    <input type="text"
                        id="newFolderNameInput"
                        class="form-control"
                        ng-model="ctrl.folderName"
                        ng-disabled="ctrl.isSubmitting"
                        aria-required="true"
                        ng-attr-aria-invalid="{{ ctrl.errorMessage ? 'true' : undefined }}"
                        ng-attr-aria-describedby="{{ ctrl.errorMessage ? 'newFolderError' : undefined }}">
                </div>
                <div id="newFolderError"
                    class="directory-browser-create-error"
                    role="alert"
                    aria-live="assertive"
                    ng-if="ctrl.errorMessage">
                    <i class="fas fa-exclamation-triangle" aria-hidden="true"></i>
                    <span ng-bind="ctrl.errorMessage"></span>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button"
                    id="cancelNewFolderBtn"
                    class="btn btn-link"
                    ng-click="ctrl.cancel()"
                    ng-disabled="ctrl.isSubmitting">
                    [% locale.maketext('Cancel') %]
                </button>
                <button type="submit"
                    id="createNewFolderBtn"
                    class="btn btn-primary"
                    ng-disabled="ctrl.isSubmitting || !ctrl.folderName || !ctrl.folderName.trim()">
                    [% locale.maketext('Create New Folder') %]
                </button>
            </div>
        </form>
    </script>
[% END #wrapper -%]
Back to Directory