mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-04 07:28:26 +01:00
Fixed ${navPluginsTabs} getting replaced with a locale
- Makes plugin tabs accessible again when using locale - Fixed players.html and error.html for the new sb-admin-2.js behavior (tabs need id) Affects issues: - Fixed #1409
This commit is contained in:
parent
6b4db32244
commit
a6b98e658e
@ -116,8 +116,8 @@ public class NetworkPage implements Page {
|
|||||||
return UnaryChain.of(templateHtml)
|
return UnaryChain.of(templateHtml)
|
||||||
.chain(theme::replaceThemeColors)
|
.chain(theme::replaceThemeColors)
|
||||||
.chain(placeholders::apply)
|
.chain(placeholders::apply)
|
||||||
.chain(locale::replaceLanguageInHtml)
|
|
||||||
.chain(pluginPlaceholders::apply)
|
.chain(pluginPlaceholders::apply)
|
||||||
|
.chain(locale::replaceLanguageInHtml)
|
||||||
.apply();
|
.apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -28,6 +28,7 @@ import com.djrapitops.plan.settings.config.PlanConfig;
|
|||||||
import com.djrapitops.plan.settings.locale.Locale;
|
import com.djrapitops.plan.settings.locale.Locale;
|
||||||
import com.djrapitops.plan.settings.theme.Theme;
|
import com.djrapitops.plan.settings.theme.Theme;
|
||||||
import com.djrapitops.plan.settings.theme.ThemeVal;
|
import com.djrapitops.plan.settings.theme.ThemeVal;
|
||||||
|
import com.djrapitops.plan.utilities.java.UnaryChain;
|
||||||
import com.djrapitops.plan.version.VersionChecker;
|
import com.djrapitops.plan.version.VersionChecker;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -104,16 +105,19 @@ public class PlayerPage implements Page {
|
|||||||
|
|
||||||
placeholders.put("contributors", Contributors.generateContributorHtml());
|
placeholders.put("contributors", Contributors.generateContributorHtml());
|
||||||
|
|
||||||
String html = locale.replaceLanguageInHtml(placeholders.apply(templateHtml));
|
PlaceholderReplacer pluginPlaceholders = new PlaceholderReplacer();
|
||||||
|
|
||||||
placeholders = new PlaceholderReplacer();
|
|
||||||
PlayerPluginTab pluginTabs = pageFactory.inspectPluginTabs(playerUUID);
|
PlayerPluginTab pluginTabs = pageFactory.inspectPluginTabs(playerUUID);
|
||||||
|
|
||||||
placeholders.put("playerName", playerName);
|
pluginPlaceholders.put("playerName", playerName);
|
||||||
placeholders.put("backButton", (serverInfo.getServer().isProxy() ? Html.BACK_BUTTON_NETWORK : Html.BACK_BUTTON_SERVER).create());
|
pluginPlaceholders.put("backButton", (serverInfo.getServer().isProxy() ? Html.BACK_BUTTON_NETWORK : Html.BACK_BUTTON_SERVER).create());
|
||||||
placeholders.put("navPluginsTabs", pluginTabs.getNav());
|
pluginPlaceholders.put("navPluginsTabs", pluginTabs.getNav());
|
||||||
placeholders.put("pluginsTabs", pluginTabs.getTab());
|
pluginPlaceholders.put("pluginsTabs", pluginTabs.getTab());
|
||||||
|
|
||||||
return placeholders.apply(theme.replaceThemeColors(html));
|
return UnaryChain.of(templateHtml)
|
||||||
|
.chain(theme::replaceThemeColors)
|
||||||
|
.chain(placeholders::apply)
|
||||||
|
.chain(pluginPlaceholders::apply)
|
||||||
|
.chain(locale::replaceLanguageInHtml)
|
||||||
|
.apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,8 +111,8 @@ public class ServerPage implements Page {
|
|||||||
return UnaryChain.of(templateHtml)
|
return UnaryChain.of(templateHtml)
|
||||||
.chain(theme::replaceThemeColors)
|
.chain(theme::replaceThemeColors)
|
||||||
.chain(placeholders::apply)
|
.chain(placeholders::apply)
|
||||||
.chain(locale::replaceLanguageInHtml)
|
|
||||||
.chain(pluginPlaceholders::apply)
|
.chain(pluginPlaceholders::apply)
|
||||||
|
.chain(locale::replaceLanguageInHtml)
|
||||||
.apply();
|
.apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -71,7 +71,7 @@
|
|||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
<div id="content" style="display: flex;">
|
<div id="content" style="display: flex;">
|
||||||
<!-- Begin Player Overview Tab -->
|
<!-- Begin Player Overview Tab -->
|
||||||
<div class="tab" style="width: 100%;">
|
<div class="tab" id="information" style="width: 100%;">
|
||||||
<div class="container-fluid mt-4">
|
<div class="container-fluid mt-4">
|
||||||
<!-- Page Heading -->
|
<!-- Page Heading -->
|
||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
const content = document.getElementById("content");
|
const content = document.getElementById("content");
|
||||||
const navButtons = Array.from(document.getElementsByClassName("nav-button"));
|
const navButtons = Array.from(document.getElementsByClassName("nav-button"));
|
||||||
const tabs = Array.from(document.getElementsByClassName("tab")).filter(tab => tab.id);
|
const tabs = Array.from(document.getElementsByClassName("tab")).filter(tab => tab.id); // TABS NEED IDS
|
||||||
const tabCount = tabs.length;
|
const tabCount = tabs.length;
|
||||||
|
|
||||||
function openTab(openIndex) {
|
function openTab(openIndex) {
|
||||||
|
@ -632,8 +632,6 @@
|
|||||||
</div> <!-- End of Geolocations tab -->
|
</div> <!-- End of Geolocations tab -->
|
||||||
<!-- Begin Plugins Overview Tab -->
|
<!-- Begin Plugins Overview Tab -->
|
||||||
${tabsPlugins}
|
${tabsPlugins}
|
||||||
<div class="tab"></div>
|
|
||||||
<div class="tab"></div>
|
|
||||||
</div> <!-- End of Main Content -->
|
</div> <!-- End of Main Content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- End of Content Wrapper -->
|
<!-- End of Content Wrapper -->
|
||||||
|
@ -550,10 +550,6 @@
|
|||||||
</div> <!-- /.container-fluid -->
|
</div> <!-- /.container-fluid -->
|
||||||
</div> <!-- End of Servers Overview Tab-->
|
</div> <!-- End of Servers Overview Tab-->
|
||||||
${pluginsTabs}
|
${pluginsTabs}
|
||||||
<div class="tab"></div>
|
|
||||||
<div class="tab"></div>
|
|
||||||
<div class="tab"></div>
|
|
||||||
<div class="tab"></div>
|
|
||||||
</div> <!-- End of Main Content -->
|
</div> <!-- End of Main Content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- End of Content Wrapper -->
|
<!-- End of Content Wrapper -->
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
<!-- Main Content -->
|
<!-- Main Content -->
|
||||||
<div id="content" style="display: flex;">
|
<div id="content" style="display: flex;">
|
||||||
<!-- Begin Player Overview Tab -->
|
<!-- Begin Player Overview Tab -->
|
||||||
<div class="tab" style="width: 100%;">
|
<div class="tab" id="players" style="width: 100%;">
|
||||||
<div class="container-fluid mt-4">
|
<div class="container-fluid mt-4">
|
||||||
<!-- Page Heading -->
|
<!-- Page Heading -->
|
||||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||||
|
@ -1105,8 +1105,6 @@
|
|||||||
</div> <!-- End of Performance tab -->
|
</div> <!-- End of Performance tab -->
|
||||||
<!-- Begin Plugins Overview Tab -->
|
<!-- Begin Plugins Overview Tab -->
|
||||||
${tabsPlugins}
|
${tabsPlugins}
|
||||||
<div class="tab"></div>
|
|
||||||
<div class="tab"></div>
|
|
||||||
</div> <!-- End of Main Content -->
|
</div> <!-- End of Main Content -->
|
||||||
</div>
|
</div>
|
||||||
<!-- End of Content Wrapper -->
|
<!-- End of Content Wrapper -->
|
||||||
|
Loading…
Reference in New Issue
Block a user