Author: shane.bryzak(a)jboss.com
Date: 2010-06-18 07:35:05 -0400 (Fri, 18 Jun 2010)
New Revision: 6483
Modified:
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/Paginator.java
examples/trunk/jsf/pastecode/src/main/webapp/display.xhtml
examples/trunk/jsf/pastecode/src/main/webapp/history.xhtml
examples/trunk/jsf/pastecode/src/main/webapp/pagination.xhtml
examples/trunk/jsf/pastecode/src/main/webapp/style/style.css
Log:
updated history and pagination styles
Modified:
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/Paginator.java
===================================================================
---
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/Paginator.java 2010-06-18
09:57:12 UTC (rev 6482)
+++
examples/trunk/jsf/pastecode/src/main/java/org/jboss/weld/examples/pastecode/session/Paginator.java 2010-06-18
11:35:05 UTC (rev 6483)
@@ -97,7 +97,7 @@
public void setBoundedIndexes(int startIndex, int endIndex)
{
this.indexes = new ArrayList<Integer>(endIndex - startIndex);
- for (int i = startIndex; i <= endIndex; i++)
+ for (int i = startIndex; i < endIndex; i++)
{
this.indexes.add(new Integer(i));
}
Modified: examples/trunk/jsf/pastecode/src/main/webapp/display.xhtml
===================================================================
--- examples/trunk/jsf/pastecode/src/main/webapp/display.xhtml 2010-06-18 09:57:12 UTC
(rev 6482)
+++ examples/trunk/jsf/pastecode/src/main/webapp/display.xhtml 2010-06-18 11:35:05 UTC
(rev 6483)
@@ -49,7 +49,7 @@
<!--h:outputLabel for="unwrap" value="Unwrap code: "/>
<h:selectBooleanCheckbox id="unwrap"
onchange="unwrap('codearea');"/-->
- <div id="codearea" style="width:99%; border: 1px solid #7F7F7F;
height:450px; overflow:scroll;">
+ <div class="displayCode">
<pre class="brush:
#{pasteWindow.codeFragment.language.brush}">#{pasteWindow.codeFragment.text}</pre>
</div>
Modified: examples/trunk/jsf/pastecode/src/main/webapp/history.xhtml
===================================================================
--- examples/trunk/jsf/pastecode/src/main/webapp/history.xhtml 2010-06-18 09:57:12 UTC
(rev 6482)
+++ examples/trunk/jsf/pastecode/src/main/webapp/history.xhtml 2010-06-18 11:35:05 UTC
(rev 6483)
@@ -13,52 +13,46 @@
</f:metadata>
</ui:define>
- <ui:define name="themes">
- </ui:define>
+ <ui:define name="themes"/>
<ui:define name="mainarea">
- <div style="width: 100%; padding: 7px;">
+
+ <div class="paging">
+ <ui:include src="pagination.xhtml"/>
+ </div>
+
+ <ui:repeat value="#{history.codes}" var="codeFragment">
+ <div class="contentHeader">
+ <span>Posted by </span>
+ <h:outputLink id="user" value="#{codeFragment.id}">
+ <!-- display.jsf?id= -->
+ <h:outputText value="#{codeFragment.user}"></h:outputText>
+ </h:outputLink>
+ <span> on </span>
+ <h:outputText id="datetime"
value="#{codeFragment.datetime}">
+ <f:convertDateTime type="both" pattern="d MMM yyyy
'at' h:mma" />
+ </h:outputText>
- <div id="paging"
- style="width: 98%; border-width: 0px; background-color: #C1C1E8;">
- <!-- height: 40px; --> <ui:include
src="pagination.xhtml"></ui:include>
+ <div style="float:right">
+ Language: #{codeFragment.language.name}
+ </div>
+ </div>
+
+ <h:outputText value="Code (truncated): " />
+
+ <div class="historyCode">
+ <pre>
+ <h:outputText value="#{codeFragment.text}">
+ <f:converter converterId="truncatingConverter"/>
+ </h:outputText>
+ </pre>
+ </div>
+
+ </ui:repeat>
+
+ <div class="paging">
+ <ui:include src="pagination.xhtml"/>
</div>
- <br />
- <h:dataTable value="#{history.codes}" var="codeFragment"
width="99%">
- <h:column>
- <div id="searched"><h:panelGroup>
- <h:outputLabel for="user" value="User: " />
- <h:outputLink id="user" value="#{codeFragment.id}">
- <!-- display.jsf?id= -->
- <h:outputText value="#{codeFragment.user}"></h:outputText>
- </h:outputLink>
- </h:panelGroup> <h:panelGroup>
- <h:outputLabel for="language" value="Language: " />
- <h:outputText id="language"
value="#{codeFragment.language.name}"></h:outputText>
- </h:panelGroup> <h:panelGroup>
- <h:outputLabel for="datetime" value="Date: " />
- <h:outputText id="datetime"
value="#{codeFragment.datetime}">
- <f:convertDateTime type="both" pattern="yyyy-MM-dd HH:mm:ss"
/>
- </h:outputText>
- </h:panelGroup></div>
- <br />
- <h:outputText value="Code (truncated): " />
- <div
- style="height: 100px; width: 99%; border: 1px solid #7F7F7F; overflow: auto;
padding: 1px;">
- <pre>
- <h:outputText value="#{codeFragment.text}">
- <f:converter converterId="truncatingConverter"/>
- </h:outputText>
- </pre></div>
- <br />
- <br />
- </h:column>
- </h:dataTable> <br />
- <div id="paging"
- style="width: 98%; border-width: 0px; background-color: #C1C1E8;">
- <!-- height: 40px; --> <ui:include
src="pagination.xhtml"></ui:include>
- </div>
- </div>
</ui:define>
Modified: examples/trunk/jsf/pastecode/src/main/webapp/pagination.xhtml
===================================================================
--- examples/trunk/jsf/pastecode/src/main/webapp/pagination.xhtml 2010-06-18 09:57:12 UTC
(rev 6482)
+++ examples/trunk/jsf/pastecode/src/main/webapp/pagination.xhtml 2010-06-18 11:35:05 UTC
(rev 6483)
@@ -6,28 +6,33 @@
<ui:composition>
- <h:panelGroup rendered="#{history.paginator.pagesCount gt 1}">
- <div id="paging" style="width:99%;text-align:center;">
+ <ui:fragment rendered="#{history.paginator.pagesCount gt 1}">
+
+ <span>Page #{history.paginator.page + 1} of
#{history.paginator.pagesCount}</span>
+
+ <div style="float:right">
+ <ui:fragment rendered="#{history.paginator.page ge 1}">
+ <a href="history.jsf?page=#{(history.paginator.page-1)}"
class="pagination">Prev</a>
+ </ui:fragment>
- <a
href="history.jsf?page=#{(history.paginator.page-1)>=0?(history.paginator.page-1):0}"
style="text-decoration:none;">
- <span id="edgelink"><<</span>
- </a>
-
-
<ui:repeat var="page"
value="#{history.paginator.indexes}">
- <a href="history.jsf?page=#{page}"
style="text-decoration:none;">
- <span id="normallink" style="width:23px;display:
inline-block;}">#{(history.paginator.page eq
page)?'(':''}#{page+1}#{(history.paginator.page eq
page)?')':''}</span>
- </a>
+ <ui:fragment rendered="#{history.paginator.page eq page}">
+ <span class="currentPage">#{page+1}</span>
+ </ui:fragment>
+ <ui:fragment rendered="#{history.paginator.page ne page}">
+ <a href="history.jsf?page=#{page}"
class="pagination">#{page+1}</a>
+ </ui:fragment>
+
</ui:repeat>
-
- <a
href="history.jsf?page=#{(history.paginator.page+1)>history.paginator.pagesCount?history.paginator.pagesCount:(history.paginator.page+1)}"
style="text-decoration:none;">
- <span id="edgelink">>></span>
- </a>
+ <ui:fragment rendered="#{history.paginator.page lt
(history.paginator.pagesCount-1)}">
+ <a href="history.jsf?page=#{(history.paginator.page+1)}"
class="pagination">Next</a>
+ </ui:fragment>
- </div>
- </h:panelGroup>
+ </div>
+
+ </ui:fragment>
</ui:composition>
-</html>
\ No newline at end of file
+</html>
Modified: examples/trunk/jsf/pastecode/src/main/webapp/style/style.css
===================================================================
--- examples/trunk/jsf/pastecode/src/main/webapp/style/style.css 2010-06-18 09:57:12 UTC
(rev 6482)
+++ examples/trunk/jsf/pastecode/src/main/webapp/style/style.css 2010-06-18 11:35:05 UTC
(rev 6483)
@@ -149,7 +149,7 @@
color: #ff0000;
}
-/** Recent pastes styles */
+/* Recent pastes styles */
div.recentPastes {
width: 230px;
@@ -190,7 +190,7 @@
color: #000000;
}
-/** Search params styles */
+/* Search params styles */
div.searchParams {
width: 230px;
@@ -243,3 +243,44 @@
padding: 4px 8px 16px 2px;
}
+/* Code listing styles */
+
+div.displayCode {
+ width: 99%;
+ border: 1px solid #7f7f7f;
+ height: 450px;
+ overflow: scroll;
+ padding: 1px;
+}
+
+div.historyCode {
+ width: 99%;
+ border: 1px solid #7f7f7f;
+ height: 120px;
+ overflow: auto;
+ padding: 1px;
+ margin-bottom: 22px;
+}
+
+/* Pagination styles */
+
+div.paging {
+ font-size: 12px;
+ margin-bottom: 4px;
+}
+
+.currentPage {
+ text-decoration: underline;
+ margin-left: 2px;
+ margin-right: 2px;
+}
+
+a.pagination, a.pagination:visited {
+ color: #aaaaaa;
+ text-decoration: none;
+}
+
+a.pagination:hover {
+ color: #777777;
+ text-decoration: none;
+}
Show replies by date