Skip to content

Commit

Permalink
Fix trailing slashes and html errs due to deprecated #httpServletRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
07joshua03 committed May 6, 2024
1 parent 7cebd72 commit 2839847
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 20 deletions.
15 changes: 15 additions & 0 deletions src/main/java/ch/wisv/events/WebConfiguration.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package ch.wisv.events;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfiguration implements WebMvcConfigurer {

@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseTrailingSlashMatch(true);
}

}
24 changes: 8 additions & 16 deletions src/main/resources/templates/admin/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,48 @@
<nav class="col-sm-3 col-md-2 d-none d-sm-block sidebar" th:fragment="sidebar">
<ul class="nav nav-pills flex-column">
<li class="nav-item">
<a th:href="@{/administrator/}" class="nav-link"
th:classappend="${#httpServletRequest.getRequestURI() == '/administrator/' ? 'active':''}">
<a th:href="@{/administrator/}" class="nav-link">
<i class="fas fa-tachometer-alt fa-fw" aria-hidden="true"></i> Overview
</a>
</li>
</ul>
<ul class="nav nav-pills flex-column">
<li class="nav-item">
<a th:href="@{/administrator/events/}" class="nav-link"
th:classappend="${#httpServletRequest.getRequestURI().contains('/administrator/events/') ? 'active':''}">
<a th:href="@{/administrator/events/}" class="nav-link">
<i class="fa fa-calendar fa-fw" aria-hidden="true"></i> Events
</a>
</li>
<li class="nav-item">
<a th:href="@{/administrator/products/}" class="nav-link"
th:classappend="${#httpServletRequest.getRequestURI().contains('/administrator/products/') ? 'active':''}">
<a th:href="@{/administrator/products/}" class="nav-link">
<i class="fas fa-ticket-alt fa-fw" aria-hidden="true"></i> Products
</a>
</li>
</ul>
<ul class="nav nav-pills flex-column">
<li class="nav-item">
<a th:href="@{/administrator/orders/}" class="nav-link"
th:classappend="${#httpServletRequest.getRequestURI().contains('/administrator/orders/') ? 'active':''}">
<a th:href="@{/administrator/orders/}" class="nav-link">
<i class="fa fa-shopping-cart fa-fw" aria-hidden="true"></i> Orders
</a>
</li>
<li class="nav-item">
<a th:href="@{/administrator/customers/}" class="nav-link"
th:classappend="${#httpServletRequest.getRequestURI().contains('/administrator/customers/') ? 'active':''}">
<a th:href="@{/administrator/customers/}" class="nav-link">
<i class="fa fa-users fa-fw" aria-hidden="true"></i> Customers
</a>
</li>
</ul>
<ul class="nav nav-pills flex-column">
<li class="nav-item">
<a th:href="@{/administrator/webhooks/}" class="nav-link"
th:classappend="${#httpServletRequest.getRequestURI().contains('/administrator/webhooks/') ? 'active':''}">
<a th:href="@{/administrator/webhooks/}" class="nav-link">
<i class="fa fa-globe fa-fw" aria-hidden="true"></i> Webhooks
</a>
<a th:href="@{/administrator/tasks/}" class="nav-link"
th:classappend="${#httpServletRequest.getRequestURI().contains('/administrator/tasks/') ? 'active':''}">
<a th:href="@{/administrator/tasks/}" class="nav-link">
<i class="fa fa-list fa-fw" aria-hidden="true"></i> Tasks
</a>
</li>
</ul>
<ul class="nav nav-pills flex-column">
<li class="nav-item">
<a th:href="@{/administrator/salesexport/}" class="nav-link"
th:classappend="${#httpServletRequest.getRequestURI().contains('/administrator/salesexport/') ? 'active':''}">
<a th:href="@{/administrator/salesexport/}" class="nav-link">
<i class="far fa-money-bill-alt fa-fw" aria-hidden="true"></i> Sales Export
</a>
</li>
Expand Down
6 changes: 2 additions & 4 deletions src/main/resources/templates/sales/stats/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
<nav class="col-sm-3 col-md-2 d-none d-sm-block sidebar" th:fragment="sidebar">
<ul class="nav nav-pills flex-column">
<li class="nav-item">
<a th:href="@{'/sales/stats/event/' + ${key}}" class="nav-link"
th:classappend="${#httpServletRequest.getRequestURI().contains('/sales/stats/event/') ? 'active':''}">
<a th:href="@{'/sales/stats/event/' + ${key}}" class="nav-link">
<i class="fa fa-calendar fa-fw" aria-hidden="true"></i> Event
</a>
</li>
<li class="nav-item">
<a th:href="@{'/sales/stats/products/'+${key}}" class="nav-link"
th:classappend="${#httpServletRequest.getRequestURI().contains('/sales/stats/product/') ? 'active':''}">
<a th:href="@{'/sales/stats/products/'+${key}}" class="nav-link">
<i class="fas fa-ticket-alt fa-fw" aria-hidden="true"></i> Products
</a>
</li>
Expand Down

0 comments on commit 2839847

Please sign in to comment.