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

[%-
USE Master;
USE Api2;
USE CPBranding;
USE VarCache;

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

SET doesNewsExist = Api2.exec( 'News', 'does_news_exist', {} );
IF doesNewsExist.0;
    SET doesGlobalNewsExist = Api2.exec( 'News', 'does_news_type_exist', {'type' => 'global'} );
    IF doesGlobalNewsExist.0;
        SET globalNews = Api2.exec( 'News', 'get_news', {'type' => 'global'} ).0;
    END;

    SET doesResoldNewsExist = Api2.exec( 'News', 'does_news_type_exist', {'type' => 'resold'} );
    IF doesResoldNewsExist.0;
        SET resoldNews = Api2.exec( 'News', 'get_news', {'type' => 'resold'} ).0;
    END;

    SET doesResellersNewsExist = Api2.exec( 'News', 'does_news_type_exist', {'type' => 'cpanel'} );
    IF doesResellersNewsExist.0;
        SET resellerNews = Api2.exec( 'News', 'get_news', {'type' => 'cpanel'} ).0;
    END;
END;

Api2.pre_exec("Email", "listpopswithdisk");
SET mail_accounts_near_quota = Api2.exec("Email", "listpopswithdisk", {"nearquotaonly"=>"1"} );
Api2.post_exec("Email", "listpopswithdisk");

IF !CPANEL.notification_count;
SET CPANEL.notification_count = execute(
        'Notifications',
        'get_notifications_count',
        {},
    ).data;
END;

SET notifications_exist = 0;
%]

[% WRAPPER '_assets/master.html.tt'
    page_title = locale.maketext("Notifications")
    hide_page_heading = 1
    app_key = "notifications"
    page_stylesheets = ['notifications/index.css']
    focus_feature_search = 1
-%]

<ul class="alert-list clearfix">
    [% IF CPANEL.ENV.item("CPRESELLER") %]
        [% notifications_exist = 1 %]
        <li class="alert-item">
                <div id="alertRoorResellerLoggedin" class="alert alert-info">
                    <span class="glyphicon glyphicon-info-sign"></span>
                    [% locale.maketext("[output,strong,Information:] You are logged in as a reseller or root user.") %]
                </div>
        </li>
    [% END %]
    [% IF (ExpVar.expand('$disk_quota_is_full')) %]
        [% notifications_exist = 1 %]
        [% IF CPANEL.feature("diskusageviewer");
                SET disk_usage_info = CPBranding.get_application_from_available_applications(varcache.available_applications, 'disk_usage');
                SET error_msg = locale.maketext("[output,strong,Warning:] This account has reached the maximum disk usage quota. Use [output,url,_1,_2,id,_3] to delete unused files or contact the system administrator.", CPANEL.CPVAR.dprefix _ disk_usage_info.url, disk_usage_info.itemdesc, "lnkDiskUsage");
            ELSE;
                SET error_msg = locale.maketext("[output,strong,Warning:] This account has reached the maximum disk usage quota.");
            END
        %]

        <li class="alert-item">
            <div id="alertDiskUsage" class="alert alert-warning">
                <span class="glyphicon glyphicon-exclamation-sign"></span>
                [% error_msg %]
            </div>
        </li>
    [%  END; %]

    [% IF mail_accounts_near_quota.size; %]
        [% notifications_exist = 1 %]
        <li class="alert-item">
            <div id="alertMailAccountQuota" class="alert alert-warning">
                <span class="glyphicon glyphicon-exclamation-sign"></span>
                [% locale.maketext("[output,strong,Warning:] The following email account(s) have quota issues:") %]
                <ul class="quota-warning">
                [% SET mailFeatureEnabled = CPANEL.feature("popaccts"); %]
                [% FOREACH mail_account IN mail_accounts_near_quota %]
                    [% IF mailFeatureEnabled;
                        SET url = CPANEL.CPVAR.dprefix _ 'mail/editquota.html?email=' _ mail_account.user.uri() _ '&domain=' _ mail_account.domain.uri();  %]
                    <li>
                        <a href="[% url %]">[% mail_account.email.html() %]</a>
                    </li>
                    [% ELSE %]
                    <li>
                        [% mail_account.email.html() %]
                    </li>
                    [% END %]
                [% END %]
                </ul>
            </div>
        </li>
    [%  END; %]
</ul>

[% BLOCK news %]
<div class="panel panel-widget">
    <div id="news_[% type %]_heading" class="panel-heading widget-heading">
        [% heading %]
    </div>
    <div id="news_[% type %]_content"  class="panel-body">
        [% news %]
    </div>
</div>
[% END %]

[% IF doesNewsExist.0 %]
[% notifications_exist = 1 %]
<ul class="alert-list clearfix">
    [% IF globalNews %]
        <li class="alert-item">
            [% PROCESS news type="global" heading=locale.maketext("General News") news=globalNews; %]
        </li>
    [% END %]
    [% IF resoldNews %]
        <li class="alert-item">
            [% PROCESS news type="resold" heading=locale.maketext("News") news=resoldNews; %]
        </li>
    [% END %]
    [% IF resellerNews %]
        <li class="alert-item">
            [% PROCESS news type="reseller" heading=locale.maketext("News") news=resellerNews; %]
        </li>
    [% END %]
</ul>
[% END %]

[% IF notifications_exist == 0 %]
    <section id="calloutNoNotifications" class="callout callout-info">
        [% locale.maketext("You have not received any notifications.") %]
    </section>
[% END %]

[% END %]
Back to Directory File Manager