浏览代码

fix #627 add prefix and suffix of errors

Shinsuke Sugaya 9 年之前
父节点
当前提交
9a15852d40

+ 69 - 1
src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java

@@ -26,6 +26,18 @@ public class FessMessages extends FessLabels {
     /** The serial version UID for object serialization. (Default) */
     /** The serial version UID for object serialization. (Default) */
     private static final long serialVersionUID = 1L;
     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"> */
     /** The key of the message: <ul class="has-error"> */
     public static final String ERRORS_HEADER = "{errors.header}";
     public static final String ERRORS_HEADER = "{errors.header}";
 
 
@@ -413,11 +425,67 @@ public class FessMessages extends FessLabels {
     /** The key of the message: Deleted data. */
     /** The key of the message: Deleted data. */
     public static final String SUCCESS_crud_delete_crud_table = "{success.crud_delete_crud_table}";
     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.
      * Add the created action message for the key 'errors.header' with parameters.
      * <pre>
      * <pre>
      * message: &lt;ul class="has-error"&gt;
      * message: &lt;ul class="has-error"&gt;
-     * comment: ------------
      * </pre>
      * </pre>
      * @param property The property name for the message. (NotNull)
      * @param property The property name for the message. (NotNull)
      * @return this. (NotNull)
      * @return this. (NotNull)

+ 4 - 0
src/main/resources/fess_message.properties

@@ -5,6 +5,10 @@
 # ----------------------------------------------------------
 # ----------------------------------------------------------
 #                                               Lasta Taglib
 #                                               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.header=<ul class="has-error">
 errors.footer=</ul>
 errors.footer=</ul>
 errors.prefix=<li><i class="fa fa-exclamation-circle"></i>
 errors.prefix=<li><i class="fa fa-exclamation-circle"></i>