fix #627 add prefix and suffix of errors

This commit is contained in:
Shinsuke Sugaya 2016-08-20 23:41:34 +09:00
parent 92cef6c944
commit 9a15852d40
2 changed files with 73 additions and 1 deletions

View file

@ -26,6 +26,18 @@ public class FessMessages extends FessLabels {
/** The serial version UID for object serialization. (Default) */
private static final long serialVersionUID = 1L;
/** The key of the message: */
public static final String ERRORS_front_header = "{errors.front_header}";
/** The key of the message: */
public static final String ERRORS_front_footer = "{errors.front_footer}";
/** The key of the message: <div class="alert alert-warning"> */
public static final String ERRORS_front_prefix = "{errors.front_prefix}";
/** The key of the message: </div> */
public static final String ERRORS_front_suffix = "{errors.front_suffix}";
/** The key of the message: <ul class="has-error"> */
public static final String ERRORS_HEADER = "{errors.header}";
@ -413,11 +425,67 @@ public class FessMessages extends FessLabels {
/** The key of the message: Deleted data. */
public static final String SUCCESS_crud_delete_crud_table = "{success.crud_delete_crud_table}";
/**
* Add the created action message for the key 'errors.front_header' with parameters.
* <pre>
* message:
* comment: ------------
* </pre>
* @param property The property name for the message. (NotNull)
* @return this. (NotNull)
*/
public FessMessages addErrorsFrontHeader(String property) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_front_header));
return this;
}
/**
* Add the created action message for the key 'errors.front_footer' with parameters.
* <pre>
* message:
* </pre>
* @param property The property name for the message. (NotNull)
* @return this. (NotNull)
*/
public FessMessages addErrorsFrontFooter(String property) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_front_footer));
return this;
}
/**
* Add the created action message for the key 'errors.front_prefix' with parameters.
* <pre>
* message: &lt;div class="alert alert-warning"&gt;
* </pre>
* @param property The property name for the message. (NotNull)
* @return this. (NotNull)
*/
public FessMessages addErrorsFrontPrefix(String property) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_front_prefix));
return this;
}
/**
* Add the created action message for the key 'errors.front_suffix' with parameters.
* <pre>
* message: &lt;/div&gt;
* </pre>
* @param property The property name for the message. (NotNull)
* @return this. (NotNull)
*/
public FessMessages addErrorsFrontSuffix(String property) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_front_suffix));
return this;
}
/**
* Add the created action message for the key 'errors.header' with parameters.
* <pre>
* message: &lt;ul class="has-error"&gt;
* comment: ------------
* </pre>
* @param property The property name for the message. (NotNull)
* @return this. (NotNull)

View file

@ -5,6 +5,10 @@
# ----------------------------------------------------------
# Lasta Taglib
# ------------
errors.front_header=
errors.front_footer=
errors.front_prefix=<div class="alert alert-warning">
errors.front_suffix=</div>
errors.header=<ul class="has-error">
errors.footer=</ul>
errors.prefix=<li><i class="fa fa-exclamation-circle"></i>