roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ko...@apache.org
Subject svn commit: r1680272 - in /roller/trunk/app/src/main: java/org/apache/roller/weblogger/ui/core/tags/calendar/ resources/ webapp/WEB-INF/jsps/editor/ webapp/themes/basic/ webapp/themes/basicmobile/ webapp/themes/fauxcoly/ webapp/themes/gaurav/
Date Tue, 19 May 2015 12:37:55 GMT
Author: kohei
Date: Tue May 19 12:37:54 2015
New Revision: 1680272

URL: http://svn.apache.org/r1680272
Log:
ROL-2073 Move hard-coded date / timestamp formatting to ApplicationResources

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java
    roller/trunk/app/src/main/resources/ApplicationResources.properties
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp
    roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
    roller/trunk/app/src/main/webapp/themes/basic/_day.vm
    roller/trunk/app/src/main/webapp/themes/basicmobile/_day-mobile.vm
    roller/trunk/app/src/main/webapp/themes/basicmobile/_day.vm
    roller/trunk/app/src/main/webapp/themes/basicmobile/weblog-mobile.vm
    roller/trunk/app/src/main/webapp/themes/fauxcoly/day.vm
    roller/trunk/app/src/main/webapp/themes/gaurav/day.vm

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/tags/calendar/CalendarTag.java
Tue May 19 12:37:54 2015
@@ -150,12 +150,12 @@ public class CalendarTag extends TagSupp
             // ceate object to represent today
             todayCal = model.getCalendar();
             todayCal.setTime( new Date() );
-            
-            // formatter Month-Year title of calendar
-            SimpleDateFormat formatTitle = new SimpleDateFormat("MMMM yyyy", mLocale);
-            
+
             // get Resource Bundle
             ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources", mLocale);
+
+            // formatter Month-Year title of calendar
+            SimpleDateFormat formatTitle = new SimpleDateFormat(bundle.getString("calendar.dateFormat"),
mLocale);
             
             // go back to first day in month
             cal = model.getCalendar();
@@ -368,6 +368,6 @@ public class CalendarTag extends TagSupp
     public int doEndTag( PrintWriter pw ) throws JspException {
         return EVAL_PAGE;
     }
-    
+
 }
 

Modified: roller/trunk/app/src/main/resources/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources.properties?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources.properties Tue May 19 12:37:54
2015
@@ -126,6 +126,7 @@ calendar.summary=Blog Archive Calendar
 calendar.prev=Prev
 calendar.today=Today
 calendar.next=Next
+calendar.dateFormat=MMMM yyyy
 
 # ------------------------------------------------------------- CategoryForm.jsp
 
@@ -279,6 +280,8 @@ commentManagement.readmore=View Entire C
 
 commentManagement.saveError=Error saving comment
 
+commentManagement.date.toStringFormat={0,date,MM/dd/yy hh:mm a}
+
 # -------------------------------------------------------------- CommentServlet
 
 commentServlet.commentAccepted=Your comment has been accepted.
@@ -666,6 +669,8 @@ macro.weblog.comment=Comment
 macro.weblog.comment.unknown=Unknown
 macro.weblog.datepattern=MMMMM dd, yyyy 'at' hh:mm aa z
 macro.weblog.date.toStringFormat=EEEE MMMM dd, yyyy
+macro.weblog.datetime.toStringFormat=hh:mma MMM dd, yyyy
+macro.weblog.time.toStringFormat=hh:mma
 macro.weblog.preview=Comment Preview
 macro.weblog.commentpermalink.title=comment permalink
 # below used by some themes in Roller-extras
@@ -1633,6 +1638,8 @@ weblogEntryQuery.nowShowing=Displaying {
 weblogEntryQuery.prev=Previous page
 weblogEntryQuery.next=Next page
 
+weblogEntryQuery.date.toStringFormat={0,date,MM/dd/yy hh:mm a}
+
 # ---------------------------------------------------------------------- Website
 
 websiteSettings.title=Weblog Settings

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Comments.jsp Tue May 19 12:37:54
2015
@@ -122,9 +122,17 @@
                 </s:text>
             </div>
             <div style="float:right;">
-                <s:date name="firstComment.postTime" format="MM/dd/yy hh:mm a" />
+                <s:if test="firstComment.postTime != null">
+                    <s:text name="commentManagement.date.toStringFormat">
+                        <s:param value="firstComment.postTime" />
+                    </s:text>
+                </s:if>
                 ---
-                <s:date name="lastComment.postTime" format="MM/dd/yy hh:mm a" />
+                <s:if test="lastComment.postTime != null">
+                    <s:text name="commentManagement.date.toStringFormat">
+                        <s:param value="lastComment.postTime" />
+                    </s:text>
+                </s:if>
             </div>
             <br />
 

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/Entries.jsp Tue May 19 12:37:54 2015
@@ -40,9 +40,17 @@
     </div>
     <s:if test="pager.items.size() > 0">
         <div style="float:right;">
-            <s:date name="firstEntry.pubTime" format="MM/dd/yy hh:mm a" />
-            --- 
-            <s:date name="lastEntry.pubTime" format="MM/dd/yy hh:mm a" />
+            <s:if test="firstEntry.pubTime != null">
+                <s:text name="weblogEntryQuery.date.toStringFormat">
+                    <s:param value="firstEntry.pubTime" />
+                </s:text>
+            </s:if>
+            ---
+            <s:if test="lastEntry.pubTime != null">
+                <s:text name="weblogEntryQuery.date.toStringFormat">
+                    <s:param value="lastEntry.pubTime" />
+                </s:text>
+            </s:if>
         </div>
     </s:if>
     <br />
@@ -137,11 +145,19 @@
     </s:else>
     
     <td>
-        <s:date name="#post.pubTime" format="MM/dd/yy hh:mm a" />
+        <s:if test="#post.pubTime != null">
+            <s:text name="weblogEntryQuery.date.toStringFormat">
+                <s:param value="#post.pubTime" />
+            </s:text>
+        </s:if>
     </td>
     
     <td>
-        <s:date name="#post.updateTime" format="MM/dd/yy hh:mm a" />
+        <s:if test="#post.updateTime != null">
+            <s:text name="weblogEntryQuery.date.toStringFormat">
+                <s:param value="#post.updateTime" />
+            </s:text>
+        </s:if>
     </td>
     
     <td>

Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp Tue May 19 12:37:54
2015
@@ -76,7 +76,7 @@
                     <span style="color:green; font-weight:bold">
                         <s:text name="weblogEdit.published" />
                         (<s:text name="weblogEdit.updateTime" />
-                        <s:date name="entry.updateTime" format="dd/MM/yyyy hh:mm a" />)
+                        <s:date name="entry.updateTime" />)
                     </span>
                 </s:if>
                 <s:elseif test="bean.draft">

Modified: roller/trunk/app/src/main/webapp/themes/basic/_day.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/basic/_day.vm?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/basic/_day.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/basic/_day.vm Tue May 19 12:37:54 2015
@@ -4,7 +4,7 @@
 <div class="dayBox">
 
     <div class="dayTitle">
-       $utils.formatDate($day, "EEEE MMM dd, yyyy")
+       $utils.formatDate($day, $text.get("macro.weblog.date.toStringFormat"))
     </div>
 
     #foreach( $entry in $entries )
@@ -19,7 +19,7 @@
             #end
         </p>
         <p class="entryInfo">
-            Posted at <a href="$url.entry($entry.anchor)">$utils.formatDate($entry.pubTime,
"hh:mma MMM dd, yyyy")</a>
+            Posted at <a href="$url.entry($entry.anchor)">$utils.formatDate($entry.pubTime,
$text.get("macro.weblog.datetime.toStringFormat"))</a>
             by $entry.creator.screenName in <span class="category">$entry.category.name</span>
&nbsp;|&nbsp;
             #if ($utils.isUserAuthorizedToAuthor($entry.website))
                 <a href="$url.editEntry($entry.anchor)">$text.get("generic.edit")</a>
&nbsp;|&nbsp;

Modified: roller/trunk/app/src/main/webapp/themes/basicmobile/_day-mobile.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/basicmobile/_day-mobile.vm?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/basicmobile/_day-mobile.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/basicmobile/_day-mobile.vm Tue May 19 12:37:54
2015
@@ -2,7 +2,7 @@
 ## $entry here is a WeblogEntryWrapper
 <!-- _day-mobile -->
 <ul data-role="listview" data-divider-theme="b" data-inset="true">
-  <li data-role="list-divider">$utils.formatDate($day, "EEEE MMM dd, yyyy")</li>
+  <li data-role="list-divider">$utils.formatDate($day, $text.get("macro.weblog.date.toStringFormat"))</li>
   ## Loop entries
   #foreach( $entry in $entries )
     <li data-role="list-divider" data-theme="a">
@@ -34,7 +34,7 @@
           </p>
         #end
         <p class="ui-li-desc content-textbox">
-          Posted at $utils.formatDate($entry.pubTime, "hh:mma MMM dd, yyyy")
+          Posted at $utils.formatDate($entry.pubTime, $text.get("macro.weblog.datetime.toStringFormat"))
           by $entry.creator.screenName in <span class="category">$entry.category.name</span>
         </p>
       #if(!$model.permalink)

Modified: roller/trunk/app/src/main/webapp/themes/basicmobile/_day.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/basicmobile/_day.vm?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/basicmobile/_day.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/basicmobile/_day.vm Tue May 19 12:37:54 2015
@@ -4,7 +4,7 @@
 <div class="dayBox">
 
     <div class="dayTitle">
-       $utils.formatDate($day, "EEEE MMM dd, yyyy")
+       $utils.formatDate($day, $text.get("macro.weblog.date.toStringFormat"))
     </div>
 
     #foreach( $entry in $entries )
@@ -19,7 +19,7 @@
             #end
         </p>
         <p class="entryInfo">
-            Posted at <a href="$url.entry($entry.anchor)">$utils.formatDate($entry.pubTime,
"hh:mma MMM dd, yyyy")</a>
+            Posted at <a href="$url.entry($entry.anchor)">$utils.formatDate($entry.pubTime,
$text.get("macro.weblog.datetime.toStringFormat"))</a>
             by $entry.creator.screenName in <span class="category">$entry.category.name</span>
&nbsp;|&nbsp;
             #if ($utils.isUserAuthorizedToAuthor($entry.website))
                 <a href="$url.editEntry($entry.anchor)">$text.get("generic.edit")</a>
&nbsp;|&nbsp;

Modified: roller/trunk/app/src/main/webapp/themes/basicmobile/weblog-mobile.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/basicmobile/weblog-mobile.vm?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/basicmobile/weblog-mobile.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/basicmobile/weblog-mobile.vm Tue May 19 12:37:54
2015
@@ -70,7 +70,7 @@
       #else
         ## No entries.
         <ul data-role="listview" data-divider-theme="b" data-inset="true">
-          <li data-role="list-divider">$utils.formatDate($utils.now, "EEEE MMM dd,
yyyy")</li>
+          <li data-role="list-divider">$utils.formatDate($utils.now, $text.get("macro.weblog.date.toStringFormat"))</li>
           <li data-theme="a">
             <span class="ui-li-desc content-textbox">
               <h3>$text.get("macro.weblog.noEntriesForCategory")</h3>

Modified: roller/trunk/app/src/main/webapp/themes/fauxcoly/day.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/fauxcoly/day.vm?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/fauxcoly/day.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/fauxcoly/day.vm Tue May 19 12:37:54 2015
@@ -1,6 +1,6 @@
 #if(!$model.permalink)
 <div class="daybox">
-    <h4 class="dayTitle">$utils.formatDate($day, "EEEE MMM dd, yyyy")</h4>
+    <h4 class="dayTitle">$utils.formatDate($day, $text.get("macro.weblog.date.toStringFormat"))</h4>
 #end
 
     #foreach( $entry in $entries )
@@ -25,7 +25,7 @@
             $entry.creator.screenName in <span class="category">$entry.category.name</span>
 
             <a class="permalink" href="$url.entry($entry.anchor)">
-                $utils.formatDate($entry.pubTime, "hh:mma MMM dd, yyyy")</a>
+                $utils.formatDate($entry.pubTime, $text.get("macro.weblog.datetime.toStringFormat"))</a>
 
             #set($commentCount = $entry.commentCount)
             #if($entry.commentsStillAllowed || $commentCount > 0)

Modified: roller/trunk/app/src/main/webapp/themes/gaurav/day.vm
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/themes/gaurav/day.vm?rev=1680272&r1=1680271&r2=1680272&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/themes/gaurav/day.vm (original)
+++ roller/trunk/app/src/main/webapp/themes/gaurav/day.vm Tue May 19 12:37:54 2015
@@ -15,7 +15,7 @@
 			<p class="lead">by <span style="text-transform: capitalize;">$entry.creator.screenName</span></p>
 		    
 			<hr>
-			<p><i class="icon-time"></i> Posted on $utils.formatDate($day, "EEEE
MMM dd, yyyy") at $utils.formatDate($entry.pubTime, "hh:mma") in <span class="category">$entry.category.name</span>
</p>
+			<p><i class="icon-time"></i> Posted on $utils.formatDate($day, $text.get("macro.weblog.date.toStringFormat"))
at $utils.formatDate($entry.pubTime, $text.get("macro.weblog.time.toStringFormat")) in <span
class="category">$entry.category.name</span> </p>
 			<hr>
 	
 		    <div class="entryContent">



Mime
View raw message