Skip to content

Commit 2886627

Browse files
committed
/series/add: fix pre-population of country with special URL.
Fix #438
1 parent d3b91a3 commit 2886627

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

src/main/java/ru/mystamps/web/Url.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public final class Url {
5252
// CheckStyle: ignore LineLength for next 3 lines
5353
public static final String ADD_SERIES_PAGE = "/series/add";
5454
public static final String ADD_SERIES_WITH_CATEGORY_PAGE = "/series/add/category/{id}";
55-
public static final String ADD_SERIES_WITH_COUNTRY_PAGE = "/series/add/country/{id}";
55+
public static final String ADD_SERIES_WITH_COUNTRY_PAGE = "/series/add/country/{slug}";
5656
public static final String INFO_SERIES_PAGE = "/series/{id}";
5757
public static final String ADD_IMAGE_SERIES_PAGE = "/series/{id}/image";
5858
public static final String SEARCH_SERIES_BY_CATALOG = "/series/search/by_catalog";

src/main/java/ru/mystamps/web/controller/CountryController.java

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ public String showInfoBySlug(
113113
String lang = LocaleUtils.getLanguageOrNull(userLocale);
114114
List<SeriesInfoDto> series = seriesService.findByCountryId(id, lang);
115115

116-
model.addAttribute("countryId", id);
117116
model.addAttribute("countrySlug", slug);
118117
model.addAttribute("countryName", name);
119118
model.addAttribute("seriesOfCountry", series);

src/main/java/ru/mystamps/web/controller/SeriesController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public String showFormWithCategory(
144144

145145
@RequestMapping(Url.ADD_SERIES_WITH_COUNTRY_PAGE)
146146
public String showFormWithCountry(
147-
@Country @PathVariable("id") LinkEntityDto country,
147+
@Country @PathVariable("slug") LinkEntityDto country,
148148
Model model) {
149149

150150
AddSeriesForm form = new AddSeriesForm();

src/main/webapp/WEB-INF/views/country/info.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ <h3 th:text="${#strings.capitalize(header)}">
9595

9696
<!--/*/
9797
<div class="row" th:if="${justAddedCountry}">
98-
<div class="alert alert-success text-center col-sm-4 col-sm-offset-4" th:utext="#{t_country_just_added(@{${ADD_SERIES_WITH_COUNTRY_PAGE}(id=${countryId})})}">
98+
<div class="alert alert-success text-center col-sm-4 col-sm-offset-4" th:utext="#{t_country_just_added(@{${ADD_SERIES_WITH_COUNTRY_PAGE}(slug=${countrySlug})})}">
9999
Country has been added.<br />
100100
Now you could <a href="../series/add.html" class="alert-link">proceed with creating series</a>.
101101
</div>

0 commit comments

Comments
 (0)