Skip to content

Commit

Permalink
Adapt remain main site prefixes and catch a regression introduced with
Browse files Browse the repository at this point in the history
  • Loading branch information
mukil committed Jan 3, 2021
1 parent 6254c02 commit a3d886d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions src/main/java/de/mikromedia/webpages/WebpagePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ public Viewable getWebsitePage(@PathParam("site") String sitePrefix, @PathParam(
String location = "/" + sitePrefix + "/" + webAlias;
// 1) Query for website topic
Topic usersWebsite = getWebsiteByPrefix(sitePrefix);
if (usersWebsite != null) {
prepareGenericViewData(SIMPLE_PAGE_TEMPLATE_NAME, sitePrefix, pageAlias);
prepareWebsiteViewData(usersWebsite, location);
}
// 2) check related webpages
Webpage webpage = getWebsitesWebpage(usersWebsite, pageAlias);
if (webpage != null) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/views/fragments/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ <h3 class="ui header">Menu</h3>

<div class="four wide column recent">
<h3 class="ui header">Pages</h3>
<div class="ui link list webpages" th:if="${!#lists.isEmpty(webpages) and #strings.equals(website, 'standard')}">
<div class="ui link list webpages" th:if="${!#lists.isEmpty(webpages) and #strings.equals(website, 'main')}">
<div th:each="webpage,iterStat : ${webpages}" th:if="${iterStat.count lte 5}">
<a th:href="'/' + ${webpage.webAlias}" th:class="'item'" th:id="${webpage.id}" th:text="${webpage.title}">Menu Item</a>
</div>
</div>
<div class="ui link list webpages" th:if="${!#lists.isEmpty(webpages) and !#strings.equals(website, 'standard')}">
<div class="ui link list webpages" th:if="${!#lists.isEmpty(webpages) and !#strings.equals(website, 'main')}">
<div th:each="webpage,iterStat : ${webpages}" th:if="${iterStat.count lte 5}">
<a th:href="${webpage.webAlias}" th:class="'item'" th:id="${webpage.id}" th:text="${webpage.title}">Menu Item</a>
</div>
Expand Down Expand Up @@ -120,12 +120,12 @@ <h3>Menu</h3>
<div class="block webpages">
<div class="content">
<h3>Pages</h3>
<ul class="webpages" th:if="${!#lists.isEmpty(webpages) and #strings.equals(website, 'standard')}">
<ul class="webpages" th:if="${!#lists.isEmpty(webpages) and #strings.equals(website, 'main')}">
<li th:each="webpage,iterStat : ${webpages}" th:if="${iterStat.count lte 5}">
<a th:href="'/' + ${webpage.webAlias}" th:class="'item'" th:id="${webpage.id}" th:text="${webpage.title}">Menu Item</a>
</li>
</ul>
<ul class="webpages" th:if="${!#lists.isEmpty(webpages) and !#strings.equals(website, 'standard')}">
<ul class="webpages" th:if="${!#lists.isEmpty(webpages) and !#strings.equals(website, 'main')}">
<li th:each="webpage,iterStat : ${webpages}" th:if="${iterStat.count lte 5}">
<a th:href="${webpage.webAlias}" th:class="'item'" th:id="${webpage.id}" th:text="${webpage.title}">Menu Item</a>
</li>
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/views/fragments/widgets.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

<div th:fragment="logo-site-link" class="logo-site-link">
<a th:if="${#strings.contains(website, 'standard')}" title="Visit the frontpage of this website"
<a th:if="${#strings.contains(website, 'main')}" title="Visit the frontpage of this website"
alt="Link to the frontpage of this website" href="/"
class="item sitename header">
<img class="logo" th:title="${siteName} + ' Frontpage'" th:if="${not #strings.isEmpty(siteLogoPath)}"
th:src="'/filerepo/' + ${siteLogoPath}" />
<span th:if="${#strings.isEmpty(siteLogoPath)}" th:text="${siteName}">Sitename</span>
</a>
<a th:if="${!#strings.contains(website, 'standard')}" th:title="'Visit the frontpage of ' + ${website} + 's website'"
<a th:if="${!#strings.contains(website, 'main')}" th:title="'Visit the frontpage of ' + ${website} + 's website'"
title="'Visit the frontpage of this website'" alt="Link to the frontpage of this website"
class="item sitename header" th:href="'/' + ${website}">
<img class="logo" th:title="${siteName} + ' Frontpage'" th:if="${not #strings.isEmpty(siteLogoPath)}"
Expand All @@ -17,14 +17,14 @@
</div>

<div th:fragment="logo-site-link-square" class="logo-site-link">
<a th:if="${#strings.contains(website, 'standard')}" title="Visit the frontpage of this website"
<a th:if="${#strings.contains(website, 'main')}" title="Visit the frontpage of this website"
alt="Link to the frontpage of this website" href="/"
class="item sitename header">
<img class="logo" th:title="${siteName} + ' Frontpage'" th:if="${not #strings.isEmpty(siteLogoPath)}"
th:src="'/filerepo/' + ${siteLogoPath}" />
<div th:if="${#strings.isEmpty(siteLogoPath)}" th:text="${siteName}">Sitename</div>
</a>
<a th:if="${!#strings.contains(website, 'standard')}" th:title="'Visit the frontpage of ' + ${website} + 's website'"
<a th:if="${!#strings.contains(website, 'main')}" th:title="'Visit the frontpage of ' + ${website} + 's website'"
title="'Visit the frontpage of this website'" alt="Link to the frontpage of this website"
class="item sitename header" th:href="'/' + ${website}">
<img class="logo" th:title="${siteName} + ' Frontpage'" th:if="${not #strings.isEmpty(siteLogoPath)}"
Expand All @@ -42,13 +42,13 @@
</div>

<div th:fragment="footer-site-link" class="footer-site-link">
<a th:if="${#strings.contains(website, 'standard')}" title="Visit the frontpage of this website"
<a th:if="${#strings.contains(website, 'main')}" title="Visit the frontpage of this website"
alt="Link to the frontpage of this website" href="/">
<img class="logo" th:title="${siteName} + ' Frontpage'" th:if="${not #strings.isEmpty(siteLogoPath)}"
th:src="'/filerepo/' + ${siteLogoPath}" />
<h1 th:if="${#strings.isEmpty(siteLogoPath)}" th:text="${siteName}"></h1>
</a>
<a th:if="${!#strings.contains(website, 'standard')}" th:title="'Visit the frontpage of ' + ${website} + 's website'"
<a th:if="${!#strings.contains(website, 'main')}" th:title="'Visit the frontpage of ' + ${website} + 's website'"
title="'Visit the frontpage of this website'" alt="Link to the frontpage of this website"
th:href="'/' + ${website}">
<img class="logo" th:title="${siteName} + ' Frontpage'" th:if="${not #strings.isEmpty(siteLogoPath)}"
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/views/frontpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ <h1 class="ui header">Webpages</h1>
<article th:each="page : ${webpages}" th:class="${pageStat.odd}? 'odd'"
itemtype="http://schema.org/WebPage" itemscope="">
<h2 class="ui header">
<a th:if="${#strings.contains(website, 'standard')}"
<a th:if="${#strings.contains(website, 'main')}"
itemprop="url" th:href="'/' + ${page.webAlias}">
<span class="title" itemprop="name" th:text="${page.title}">Title of page</span>
<!--span class="created value" th:text="${#dates.format(page.creationDate, 'dd. MMMM yyyy')}"></span-->
</a>
<a th:if="${!#strings.contains(website, 'standard')}"
<a th:if="${!#strings.contains(website, 'main')}"
itemprop="url" th:href="'/' + ${website} + '/' + ${page.webAlias}">
<span class="title" itemprop="name" th:text="${page.title}">Title of page</span>
<!--span class="created value" th:text="${#dates.format(page.creationDate, 'dd. MMMM yyyy')}"></span-->
Expand Down

0 comments on commit a3d886d

Please sign in to comment.