Search in sources :

Example 1 with PlaceholderReplacer

use of com.djrapitops.plan.delivery.formatting.PlaceholderReplacer in project Plan by plan-player-analytics.

the class InternalErrorPage method toHtml.

@Override
public String toHtml() {
    PlaceholderReplacer placeholders = new PlaceholderReplacer();
    placeholders.put("title", Icon.called("bug") + " 500 Internal Error occurred");
    placeholders.put("titleText", "500 Internal Error occurred");
    placeholders.put("paragraph", createContent());
    placeholders.put("versionButton", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
    placeholders.put("version", versionChecker.getCurrentVersion());
    placeholders.put("updateModal", versionChecker.getUpdateModal());
    placeholders.put("contributors", Contributors.generateContributorHtml());
    return placeholders.apply(template);
}
Also used : PlaceholderReplacer(com.djrapitops.plan.delivery.formatting.PlaceholderReplacer)

Example 2 with PlaceholderReplacer

use of com.djrapitops.plan.delivery.formatting.PlaceholderReplacer in project Plan by plan-player-analytics.

the class ErrorsPage method toHtml.

@Override
public String toHtml() {
    PlaceholderReplacer placeholders = new PlaceholderReplacer();
    placeholders.put("title", Icon.called("bug").build().toHtml() + " Error logs");
    placeholders.put("titleText", "Error logs");
    placeholders.put("paragraph", buildBody());
    placeholders.put("versionButton", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
    placeholders.put("version", versionChecker.getCurrentVersion());
    placeholders.put("updateModal", versionChecker.getUpdateModal());
    placeholders.put("contributors", Contributors.generateContributorHtml());
    return UnaryChain.of(template).chain(theme::replaceThemeColors).chain(placeholders::apply).chain(locale::replaceLanguageInHtml).apply();
}
Also used : PlaceholderReplacer(com.djrapitops.plan.delivery.formatting.PlaceholderReplacer)

Example 3 with PlaceholderReplacer

use of com.djrapitops.plan.delivery.formatting.PlaceholderReplacer in project Plan by plan-player-analytics.

the class PlayersPage method toHtml.

@Override
public String toHtml() {
    PlaceholderReplacer placeholders = new PlaceholderReplacer();
    placeholders.put("refreshBarrier", config.get(WebserverSettings.REDUCED_REFRESH_BARRIER));
    placeholders.put("versionButton", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
    placeholders.put("version", versionChecker.getCurrentVersion());
    placeholders.put("updateModal", versionChecker.getUpdateModal());
    placeholders.put("contributors", Contributors.generateContributorHtml());
    if (serverInfo.getServer().isProxy()) {
        placeholders.put("networkName", config.get(ProxySettings.NETWORK_NAME));
    } else {
        placeholders.put("networkName", config.get(PluginSettings.SERVER_NAME));
    }
    return locale.replaceLanguageInHtml(placeholders.apply(theme.replaceThemeColors(templateHtml)));
}
Also used : PlaceholderReplacer(com.djrapitops.plan.delivery.formatting.PlaceholderReplacer)

Example 4 with PlaceholderReplacer

use of com.djrapitops.plan.delivery.formatting.PlaceholderReplacer in project Plan by plan-player-analytics.

the class QueryPage method toHtml.

@Override
public String toHtml() {
    PlaceholderReplacer placeholders = new PlaceholderReplacer();
    placeholders.put("versionButton", versionChecker.getUpdateButton().orElse(versionChecker.getCurrentVersionButton()));
    placeholders.put("version", versionChecker.getCurrentVersion());
    placeholders.put("updateModal", versionChecker.getUpdateModal());
    placeholders.put("contributors", Contributors.generateContributorHtml());
    return UnaryChain.of(template).chain(theme::replaceThemeColors).chain(placeholders::apply).chain(locale::replaceLanguageInHtml).apply();
}
Also used : PlaceholderReplacer(com.djrapitops.plan.delivery.formatting.PlaceholderReplacer)

Example 5 with PlaceholderReplacer

use of com.djrapitops.plan.delivery.formatting.PlaceholderReplacer in project Plan by plan-player-analytics.

the class LoginPage method toHtml.

@Override
public String toHtml() {
    PlaceholderReplacer placeholders = new PlaceholderReplacer();
    placeholders.put("command", getCommand());
    placeholders.put("version", versionChecker.getCurrentVersion());
    return UnaryChain.of(template).chain(theme::replaceThemeColors).chain(placeholders::apply).chain(locale::replaceLanguageInHtml).apply();
}
Also used : PlaceholderReplacer(com.djrapitops.plan.delivery.formatting.PlaceholderReplacer)

Aggregations

PlaceholderReplacer (com.djrapitops.plan.delivery.formatting.PlaceholderReplacer)9 CachingSupplier (com.djrapitops.plan.delivery.domain.container.CachingSupplier)2 ExtensionData (com.djrapitops.plan.extension.implementation.results.ExtensionData)2 ExtensionServerDataQuery (com.djrapitops.plan.extension.implementation.storage.queries.ExtensionServerDataQuery)2 ServerUUID (com.djrapitops.plan.identification.ServerUUID)2 UUID (java.util.UUID)1