Skip to content

Commit 8baf60a

Browse files
committed
refactor: use CSS for marking required fields in most of the places
1 parent f52fa5f commit 8baf60a

File tree

11 files changed

+32
-63
lines changed

11 files changed

+32
-63
lines changed

src/main/frontend/src/components/SeriesSaleImportForm.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,8 @@ class SeriesSaleImportFormView extends React.PureComponent {
136136
onSubmit={ handleSubmit }>
137137

138138
<div className="form-group form-group-sm">
139-
<label htmlFor="series-sale-url" className="control-label col-sm-3">
139+
<label htmlFor="series-sale-url" className="control-label col-sm-3 required-field">
140140
{ l10n['t_url'] || 'URL' }
141-
<span className="required_field"> *</span>
142141
</label>
143142
<div className="col-sm-6">
144143
<input id="series-sale-url"

src/main/webapp/WEB-INF/views/account/activate.html

+8-12
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@ <h3 th:text="#{t_activation_on_site}">
8989
th:object="${activateAccountForm}">
9090

9191
<div class="form-group" th:classappend="${#fields.hasErrors('login') ? 'has-error' : ''}">
92-
<label for="login" class="control-label col-sm-3">
93-
<span th:remove="tag" th:text="#{t_login}">Login</span>
94-
<span class="required_field">*</span>
92+
<label for="login" class="control-label col-sm-3 required-field" th:text="#{t_login}">
93+
Login
9594
</label>
9695
<div class="col-sm-5">
9796
<input type="text" id="login" class="form-control" required="required" th:field="*{login}" />
@@ -114,9 +113,8 @@ <h3 th:text="#{t_activation_on_site}">
114113
</div>
115114

116115
<div class="form-group" th:classappend="${#fields.hasErrors('password') ? 'has-error' : ''}">
117-
<label for="password" class="control-label col-sm-3">
118-
<span th:remove="tag" th:text="#{t_password}">Password</span>
119-
<span class="required_field">*</span>
116+
<label for="password" class="control-label col-sm-3 required-field" th:text="#{t_password}">
117+
Password
120118
</label>
121119
<div class="col-sm-5">
122120
<input type="password" id="password" class="form-control" required="required" th:field="*{password}" />
@@ -127,9 +125,8 @@ <h3 th:text="#{t_activation_on_site}">
127125
</div>
128126

129127
<div class="form-group" th:classappend="${#fields.hasErrors('passwordConfirmation') ? 'has-error' : ''}">
130-
<label for="passwordConfirmation" class="control-label col-sm-3">
131-
<span th:remove="tag" th:text="#{t_password_again}">Retype password</span>
132-
<span class="required_field">*</span>
128+
<label for="passwordConfirmation" class="control-label col-sm-3 required-field" th:text="#{t_password_again}">
129+
Retype password
133130
</label>
134131
<div class="col-sm-5">
135132
<input type="password" id="passwordConfirmation" class="form-control" required="required" th:field="*{passwordConfirmation}" />
@@ -140,9 +137,8 @@ <h3 th:text="#{t_activation_on_site}">
140137
</div>
141138

142139
<div class="form-group" th:classappend="${#fields.hasErrors('activationKey') ? 'has-error' : ''}">
143-
<label for="activationKey" class="control-label col-sm-3">
144-
<span th:remove="tag" th:text="#{t_activation_key}">Activation key</span>
145-
<span class="required_field">*</span>
140+
<label for="activationKey" class="control-label col-sm-3 required-field" th:text="#{t_activation_key}">
141+
Activation key
146142
</label>
147143
<div class="col-sm-5">
148144
<input type="text" id="activationKey" class="form-control" required="required" th:field="*{activationKey}" />

src/main/webapp/WEB-INF/views/account/auth.html

+4-6
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,17 @@ <h3 th:text="#{t_authentication_on_site}">
9494
<form id="auth-account-form" action="../site/index.html" th:action="@{${LOGIN_PAGE}}" method="post" class="form-horizontal">
9595

9696
<div class="form-group">
97-
<label for="login" class="control-label col-sm-4">
98-
<span th:remove="tag" th:text="#{t_login}">Login</span>
99-
<span class="required_field">*</span>
97+
<label for="login" class="control-label col-sm-4 required-field" th:text="#{t_login}">
98+
Login
10099
</label>
101100
<div class="col-sm-4">
102101
<input type="text" id="login" name="login" required="required" value="" class="form-control" />
103102
</div>
104103
</div>
105104

106105
<div class="form-group">
107-
<label for="password" class="control-label col-sm-4">
108-
<span th:remove="tag" th:text="#{t_password}">Password</span>
109-
<span class="required_field">*</span>
106+
<label for="password" class="control-label col-sm-4 required-field" th:text="#{t_password}">
107+
Password
110108
</label>
111109
<div class="col-sm-4">
112110
<input type="password" id="password" name="password" required="required" value="" class="form-control" />

src/main/webapp/WEB-INF/views/account/register.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ <h3 th:text="#{t_registration_on_site}">
8787
th:object="${registerAccountForm}">
8888

8989
<div class="form-group" th:classappend="${#fields.hasErrors('email') ? 'has-error' : ''}">
90-
<label class="control-label col-sm-4" for="email">
91-
<span th:remove="tag" th:text="#{t_email}">E-mail</span>
92-
<span class="required_field">*</span>
90+
<label for="email" class="control-label col-sm-4 required-field" th:text="#{t_email}">
91+
E-mail
9392
</label>
9493
<div class="col-sm-5">
9594
<input class="form-control" type="email" id="email" required="required" autofocus="autofocus" th:field="*{email}" />

src/main/webapp/WEB-INF/views/category/add.html

+2-5
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ <h3 th:text="${#strings.capitalize(create_category)}">
7777
th:action="@{${ADD_CATEGORY_PAGE}}" th:object="${addCategoryForm}">
7878

7979
<div class="form-group" th:classappend="${#fields.hasErrors('name') ? 'has-error' : ''}">
80-
<label for="name" class="control-label col-sm-4">
81-
<span th:remove="tag" th:text="#{t_name_in_english}">
82-
Name (in English)
83-
</span>
84-
<span class="required_field">*</span>
80+
<label for="name" class="control-label col-sm-4 required-field" th:text="#{t_name_in_english}">
81+
Name (in English)
8582
</label>
8683
<div class="col-sm-5">
8784
<input id="name" type="text" class="form-control" required="required" th:field="*{name}" />

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ <h3 th:text="${#strings.capitalize(add_country)}">
7777
th:action="@{${ADD_COUNTRY_PAGE}}" th:object="${addCountryForm}">
7878

7979
<div class="form-group" th:classappend="${#fields.hasErrors('name') ? 'has-error' : ''}">
80-
<label for="name" class="control-label col-sm-4">
81-
<span th:remove="tag" th:text="#{t_name_in_english}">
82-
Name (in English)
83-
</span>
84-
<span class="required_field">*</span>
80+
<label for="name" class="control-label col-sm-4 required-field" th:text="#{t_name_in_english}">
81+
Name (in English)
8582
</label>
8683
<div class="col-sm-5">
8784
<input id="name" type="text" class="form-control" required="required" th:field="*{name}" />

src/main/webapp/WEB-INF/views/participant/add.html

+2-5
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,8 @@ <h3 th:text="${#strings.capitalize(header)}">
7777
th:action="@{${ADD_PARTICIPANT_PAGE}}" th:object="${addParticipantForm}">
7878

7979
<div class="form-group" th:classappend="${#fields.hasErrors('name') ? 'has-error' : ''}">
80-
<label for="name" class="control-label col-sm-4">
81-
<span th:remove="tag" th:text="#{t_name}">
82-
Name
83-
</span>
84-
<span class="required_field">*</span>
80+
<label for="name" class="control-label col-sm-4 required-field" th:text="#{t_name}">
81+
Name
8582
</label>
8683
<div class="col-sm-5">
8784
<input id="name" type="text" class="form-control" required="required" th:field="*{name}" />

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

+4-10
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,8 @@ <h3 th:text="${#strings.capitalize(add_series)}">
9797
issueDateHasValues=${addSeriesForm.day != null or addSeriesForm.month != null or addSeriesForm.year != null}">
9898

9999
<div class="form-group form-group-sm" th:classappend="${#fields.hasErrors('category') ? 'has-error' : ''}">
100-
<label for="category" class="control-label col-sm-3">
101-
<span th:remove="tag" th:text="#{t_category}">
102-
Category
103-
</span>
104-
<span class="required_field">*</span>
100+
<label for="category" class="control-label col-sm-3 required-field" th:text="#{t_category}">
101+
Category
105102
</label>
106103
<div class="col-sm-5">
107104
<select id="category" name="category" class="form-control" required="required">
@@ -192,11 +189,8 @@ <h3 th:text="${#strings.capitalize(add_series)}">
192189
</div>
193190

194191
<div class="form-group form-group-sm" th:classappend="${#fields.hasErrors('quantity') ? 'has-error' : ''}">
195-
<label for="quantity" class="control-label col-sm-3">
196-
<span th:remove="tag" th:text="#{t_quantity}">
197-
Quantity
198-
</span>
199-
<span class="required_field">*</span>
192+
<label for="quantity" class="control-label col-sm-3 required-field" th:text="#{t_quantity}">
193+
Quantity
200194
</label>
201195
<div class="col-sm-6">
202196
<div class="row">

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,9 @@ <h3 th:text="#{t_gathered_data}">
200200

201201
<tr th:unless="${disabled}" th:classappend="${#fields.hasErrors('quantity') ? 'has-error' : ''}">
202202
<th>
203-
<label for="quantity" class="control-label" th:text="#{t_quantity}">
203+
<label for="quantity" class="control-label required-field" th:text="#{t_quantity}">
204204
Quantity
205205
</label>
206-
<span class="required_field">*</span>
207206
</th>
208207
<td>
209208
<input id="quantity"

src/main/webapp/WEB-INF/views/series/import/request.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ <h3 th:text="${#strings.capitalize(header)}">
7676
<form id="import-series-form" method="get" action="info.html" class="form-horizontal" th:method="post" th:action="@{${REQUEST_IMPORT_SERIES_PAGE}}" th:object="${requestImportForm}">
7777

7878
<div class="form-group" th:classappend="${#fields.hasErrors('url') ? 'has-error' : ''}">
79-
<label class="control-label col-sm-4" for="url">
80-
<span th:remove="tag" th:text="#{t_url}">URL</span>
81-
<span class="required_field">*</span>
79+
<label for="url" class="control-label col-sm-4 required-field" th:text="#{t_url}">
80+
URL
8281
</label>
8382
<div class="col-sm-5">
8483
<input id="url" type="url" class="form-control" required="required" autofocus="autofocus" th:field="*{url}" />

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

+4-10
Original file line numberDiff line numberDiff line change
@@ -656,11 +656,8 @@ <h5 th:text="#{t_add_info_who_selling_series}">Add info about selling/buying thi
656656
</div>
657657

658658
<div class="form-group form-group-sm" th:classappend="${#fields.hasErrors('sellerId') ? 'has-error' : ''}">
659-
<label for="seller" class="control-label col-sm-3">
660-
<span th:remove="tag" th:text="#{t_seller}">
661-
Seller
662-
</span>
663-
<span class="required_field">*</span>
659+
<label for="seller" class="control-label col-sm-3 required-field" th:text="#{t_seller}">
660+
Seller
664661
</label>
665662
<div class="col-sm-6">
666663
<select id="seller" class="form-control" required="required" th:field="*{sellerId}">
@@ -718,11 +715,8 @@ <h5 th:text="#{t_add_info_who_selling_series}">Add info about selling/buying thi
718715
</div>
719716

720717
<div class="form-group form-group-sm" th:classappend="${#fields.hasErrors('price') or #fields.hasErrors('currency') ? 'has-error' : ''}">
721-
<label for="price" class="control-label col-sm-3">
722-
<span th:remove="tag" th:text="#{t_price}">
723-
Price
724-
</span>
725-
<span class="required_field">*</span>
718+
<label for="price" class="control-label col-sm-3 required-field" th:text="#{t_price}">
719+
Price
726720
</label>
727721
<div class="col-sm-6">
728722
<div class="row">

0 commit comments

Comments
 (0)