Skip to content

Commit cce20d0

Browse files
committed
task: add an empty AddReleaseYearForm.
Address to #1344 Part of #1343
1 parent 9892a3a commit cce20d0

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// IMPORTANT:
3+
// You must update ResourceUrl.RESOURCES_VERSION each time whenever you're modified this file!
4+
//
5+
6+
class AddReleaseYearForm extends React.Component {
7+
8+
render() {
9+
return (
10+
<div>TODO: add release year form</div>
11+
)
12+
}
13+
}

src/main/java/ru/mystamps/web/feature/site/ResourceUrl.java

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public final class ResourceUrl {
4747
private static final String SIMILAR_SERIES_FORM_JS = "/public/js/" + RESOURCES_VERSION + "/components/SimilarSeriesForm.js";
4848
private static final String ADD_COMMENT_FORM_JS = "/public/js/" + RESOURCES_VERSION + "/components/AddCommentForm.js";
4949
private static final String CATALOG_PRICE_FORM_JS = "/public/js/" + RESOURCES_VERSION + "/components/AddCatalogPriceForm.js";
50+
private static final String RELEASE_YEAR_FORM_JS = "/public/js/" + RESOURCES_VERSION + "/components/AddReleaseYearForm.js";
5051
private static final String BOOTSTRAP_LANGUAGE = "https://cdn.jsdelivr.net/gh/usrz/bootstrap-languages@3ac2a3d2b27ac43a471cd99e79d378a03b2c6b5f/languages.min.css";
5152
private static final String FAVICON_ICO = "/favicon.ico";
5253

@@ -84,6 +85,7 @@ public static void exposeResourcesToView(Map<String, String> resources, String h
8485
put(resources, host, "SIMILAR_SERIES_FORM_JS", SIMILAR_SERIES_FORM_JS);
8586
put(resources, host, "ADD_COMMENT_FORM_JS", ADD_COMMENT_FORM_JS);
8687
put(resources, host, "CATALOG_PRICE_FORM_JS", CATALOG_PRICE_FORM_JS);
88+
put(resources, host, "RELEASE_YEAR_FORM_JS", RELEASE_YEAR_FORM_JS);
8789
}
8890

8991
// see also MvcConfig.addResourceHandlers()

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

+14
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ <h5 th:text="#{t_hidden_images}">Hidden images</h5>
392392
</div>
393393
</div>
394394

395+
<div id="add-release-year" sec:authorize="hasAuthority('CREATE_SERIES')"></div>
396+
395397
<div id="add-catalog-price" sec:authorize="hasAuthority('CREATE_SERIES')"></div>
396398

397399
<div id="add-comment" sec:authorize="hasAuthority('ADD_COMMENTS_TO_SERIES')"></div>
@@ -928,9 +930,16 @@ <h5 th:text="#{t_add_info_who_selling_series}">Add info about selling/buying thi
928930
<!--/*/
929931
<th:block sec:authorize="hasAuthority('CREATE_SERIES')">
930932
/*/-->
933+
<script src="../../../../../../target/classes/js/components/AddReleaseYearForm.js" th:src="${RELEASE_YEAR_FORM_JS}"></script>
931934
<script src="../../../../../../target/classes/js/components/AddCatalogPriceForm.js" th:src="${CATALOG_PRICE_FORM_JS}"></script>
932935
<script th:inline="javascript">
933936
/*[+
937+
var addReleaseYearProps = {
938+
'csrfHeaderName': [[ ${_csrf.headerName} ]],
939+
'csrfTokenValue': [[ ${_csrf.token} ]],
940+
'l10n': {
941+
}
942+
};
934943
var addCatalogPriceProps = {
935944
'csrfHeaderName': [[ ${_csrf.headerName} ]],
936945
'csrfTokenValue': [[ ${_csrf.token} ]],
@@ -940,12 +949,17 @@ <h5 th:text="#{t_add_info_who_selling_series}">Add info about selling/buying thi
940949
+]*/
941950

942951
/*[- */
952+
var addReleaseYearProps = {
953+
'url': '/series/100',
954+
'l10n': {}
955+
};
943956
var addCatalogPriceProps = {
944957
'url': '/series/100',
945958
'l10n': {}
946959
};
947960
/* -]*/
948961

962+
renderComponent(AddReleaseYearForm, addReleaseYearProps, 'add-release-year');
949963
renderComponent(AddCatalogPriceForm, addCatalogPriceProps, 'add-catalog-price');
950964
</script>
951965
<!--/*/

0 commit comments

Comments
 (0)