Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
More JSF page fixes.
Browse files Browse the repository at this point in the history
Upgrade to Richfaces 4.3.0
Move jsf skin css to its own file.
  • Loading branch information
Carlos Munoz committed Feb 7, 2013
1 parent 261a9b1 commit d70f3ca
Show file tree
Hide file tree
Showing 11 changed files with 305 additions and 313 deletions.
22 changes: 12 additions & 10 deletions pom.xml
Expand Up @@ -35,7 +35,7 @@
<zanata.api.version>2.1.1-SNAPSHOT</zanata.api.version>
<zanata.client.version>2.0.2-SNAPSHOT</zanata.client.version>
<zanata.common.version>2.1.2-SNAPSHOT</zanata.common.version>
<richfaces.version>3.3.3.Final</richfaces.version>
<richfaces.version>4.3.0.Final</richfaces.version>

<!-- see http://community.jboss.org/wiki/HibernateCompatibilityMatrix?decorator=print -->
<!-- see also the jboss7 profile below -->
Expand Down Expand Up @@ -244,7 +244,17 @@
<scope>import</scope>
</dependency>

<dependency>
<!-- make sure the richfaces version is not provided by the seam bom -->
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<version>${richfaces.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>


<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>bom</artifactId>
<version>${seam.version}</version>
Expand All @@ -271,14 +281,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-bom</artifactId>
<version>4.2.3.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>

<!-- Solr dependencies -->
<dependency>
<groupId>org.apache.solr</groupId>
Expand Down
Expand Up @@ -169,13 +169,11 @@ public HLocale getLocale()
return localeDAO.findByLocaleId(new LocaleId(localeId));
}

public boolean filterDocumentByName(Object docObject)
public boolean filterDocumentByName(String docName)
{
final HDocument document = (HDocument) docObject;

if (this.documentNameFilter != null && this.documentNameFilter.length() > 0)
{
return document.getName().toLowerCase().contains(this.documentNameFilter.toLowerCase());
return docName.toLowerCase().contains(this.documentNameFilter.toLowerCase());
}
else
{
Expand Down
Expand Up @@ -102,11 +102,13 @@ public void setProjectSlug(String projectSlug)

public String editVersion(String versionSlug)
{
// TODO Avoid this type of redirection
return "/iteration/edit/" + projectSlug + "/" + versionSlug;
}

public String sourceDocs(String versionSlug)
{
return "/iteration/source_files/" + projectSlug + "/" + versionSlug;
// TODO Avoid this type of redirection
return "";
}
}
Expand Up @@ -42,21 +42,21 @@
if( showUsername )
{
jQuery('#identityLabel').html( usernameLabel );
jQuery('#' + usernamefieldSelector).show();
jQuery(usernamefieldSelector).show();
}
else
{
jQuery('#' + usernamefieldSelector).hide();
jQuery(usernamefieldSelector).hide();
}

var passwordfieldSelector = "[id='#{rich:clientId('providerPasswordField')}']";
if( showPassword )
{
jQuery('#' + passwordfieldSelector).show();
jQuery(passwordfieldSelector).show();
}
else
{
jQuery('#' + passwordfieldSelector).hide();
jQuery(passwordfieldSelector).hide();
}

${onProviderChange}
Expand Down
1 change: 1 addition & 0 deletions zanata-war/src/main/webapp/WEB-INF/layout/template.xhtml
Expand Up @@ -17,6 +17,7 @@
href="#{request.contextPath}/images/favicon.ico" type="image/x-icon" />
<h:outputStylesheet library="css" name="zanata.css" />
<h:outputStylesheet library="css" name="menu.css" />
<h:outputStylesheet library="css" name="jsf-skin.css" />
<link type="text/css" rel="stylesheet" href="#{request.contextPath}/resources/fontello/css/fontello.css"/>
<ui:insert name="head" />
</h:head>
Expand Down
7 changes: 7 additions & 0 deletions zanata-war/src/main/webapp/WEB-INF/pages.xml
Expand Up @@ -520,6 +520,13 @@
<action execute="#{breadcrumbs.clear}"/>
<action execute="#{breadcrumbs.addLocation('/project/list', messages['jsf.Projects'])}"/>
<action execute="#{breadcrumbs.addLocation('', projectHome.instance.slug)}"/>

<navigation from-action="#{versionDetailsAction.sourceDocs(_version.slug)}">
<redirect view-id="/iteration/source_files.xhtml">
<param name="project" value="#{projectHome.instance.slug}"/>
<param name="iteration" value="#{_version.slug}"/>
</redirect>
</navigation>
</page>

<page view-id="/project/create_project.xhtml">
Expand Down
32 changes: 17 additions & 15 deletions zanata-war/src/main/webapp/iteration/source_files.xhtml
Expand Up @@ -43,29 +43,32 @@
<ui:define name="center_content">
<h:form>
<s:token allowMultiplePosts="true"/>
<rich:dataScroller id="data_table_scroller" align="center" for="data_table"
rendered="#{projectIterationFilesAction.iterationDocuments.size() > 20}">
<f:facet name="next">
<h:outputText value="next" style="font-size: 0.8em"/>
</f:facet>
<f:facet name="previous">
<h:outputText value="prev" style="font-size: 0.8em"/>
</f:facet>
</rich:dataScroller>
<richext:spacer height="20"/>
<richext:spacer height="10"/>
<s:div style="text-align:center">
<rich:dataScroller id="data_table_scroller" for="data_table"
rendered="#{projectIterationFilesAction.iterationDocuments.size() > 20}">
<f:facet name="next">
<h:outputText value="next" style="font-size: 0.8em"/>
</f:facet>
<f:facet name="previous">
<h:outputText value="prev" style="font-size: 0.8em"/>
</f:facet>
</rich:dataScroller>
</s:div>
<richext:spacer height="15"/>
<h:outputText value="#{messages['jsf.iteration.files.NoFiles']}"
rendered="#{projectIterationFilesAction.iterationDocuments.size() == 0}"/>
<rich:dataTable id="data_table" width="100%" value="#{projectIterationFilesAction.iterationDocuments}"
var="doc"
styleClass="iteration_inline_tribes"
rows="20"
rendered="#{projectIterationFilesAction.iterationDocuments.size() gt 0}">
<rich:column sortOrder="ASCENDING"
<rich:column sortOrder="ascending"
styleClass="wrapped">
<f:facet name="header">#{messages['jsf.iteration.files.Path']}</f:facet>
#{doc.path}
</rich:column>
<rich:column filterMethod="#{projectIterationFilesAction.filterDocumentByName}"
<rich:column filterExpression="#{projectIterationFilesAction.filterDocumentByName(doc.name)}"
styleClass="wrapped">
<f:facet name="header">
<h:panelGroup>
Expand All @@ -74,15 +77,14 @@
<h:inputText value="#{projectIterationFilesAction.documentNameFilter}"
id="name_filter_input">
<a4j:ajax event="keyup" render="data_table,data_table_scroller"
execute="@this"
oncomplete="focusNameFilterInput()">
<a4j:attachQueue ignoreDupResponses="true" requestDelay="700" />
</a4j:ajax>
</h:inputText>
</h:panelGroup>
</f:facet>
<h:outputText>
#{doc.name}
</h:outputText>
<h:outputText value="#{doc.name}"/>
</rich:column>

<rich:column>
Expand Down
131 changes: 68 additions & 63 deletions zanata-war/src/main/webapp/project/home.xhtml
Expand Up @@ -30,42 +30,44 @@
</s:fragment>
<s:fragment rendered="#{!projectAction.getEmpty()}" id="projectList">
<h:form id="form">

<rich:dataScroller align="center" for="projectList" maxPages="10"
page="#{projectAction.scrollerPage}" id="scroller" reRender="sc2"
fastControls="hide">
<f:facet name="first">
<h:outputText value="" styleClass="icon-to-start"/>
</f:facet>
<f:facet name="previous">
<h:outputText value="" styleClass="icon-left-open"/>
</f:facet>
<f:facet name="next">
<h:outputText value="" styleClass="icon-right-open-1"/>
</f:facet>
<f:facet name="fastforward">
<h:outputText value="" styleClass="icon-fast-fw-1"/>
</f:facet>
<f:facet name="last">
<h:outputText value="" styleClass="icon-to-end"/>
</f:facet>

<f:facet name="first_disabled">
<h:outputText value="" styleClass="icon-to-start"/>
</f:facet>
<f:facet name="previous_disabled">
<h:outputText value="" styleClass="icon-left-open"/>
</f:facet>
<f:facet name="next_disabled">
<h:outputText value="" styleClass="icon-right-open-1"/>
</f:facet>
<f:facet name="fastforward_disabled">
<h:outputText value="" styleClass="icon-fast-fw-1"/>
</f:facet>
<f:facet name="last_disabled">
<h:outputText value="" styleClass="icon-to-end"/>
</f:facet>
</rich:dataScroller>
<div style="text-align: center">
<rich:dataScroller renderIfSinglePage="false" for="projectList" maxPages="10"
page="#{projectAction.scrollerPage}" id="scroller" reRender="sc2"
fastControls="hide">
<f:facet name="first">
<h:outputText value="" styleClass="icon-to-start"/>
</f:facet>
<f:facet name="previous">
<h:outputText value="" styleClass="icon-left-open"/>
</f:facet>
<f:facet name="next">
<h:outputText value="" styleClass="icon-right-open-1"/>
</f:facet>
<f:facet name="fastforward">
<h:outputText value="" styleClass="icon-fast-fw-1"/>
</f:facet>
<f:facet name="last">
<h:outputText value="" styleClass="icon-to-end"/>
</f:facet>

<f:facet name="first_disabled">
<h:outputText value="" styleClass="icon-to-start"/>
</f:facet>
<f:facet name="previous_disabled">
<h:outputText value="" styleClass="icon-left-open"/>
</f:facet>
<f:facet name="next_disabled">
<h:outputText value="" styleClass="icon-right-open-1"/>
</f:facet>
<f:facet name="fastforward_disabled">
<h:outputText value="" styleClass="icon-fast-fw-1"/>
</f:facet>
<f:facet name="last_disabled">
<h:outputText value="" styleClass="icon-to-end"/>
</f:facet>
</rich:dataScroller>
</div>
<richext:spacer height="15" />

<s:div styleClass="float-right">
Expand Down Expand Up @@ -128,35 +130,38 @@
</rich:dataTable>

<richext:spacer height="15" />
<rich:dataScroller align="center" for="projectList" maxPages="10"
page="#{projectAction.scrollerPage}" id="sc2" reRender="scroller"
fastControls="hide">
<f:facet name="first">
<h:outputText value="" styleClass="icon-to-start"/>
</f:facet>
<f:facet name="previous">
<h:outputText value="" styleClass="icon-left-open"/>
</f:facet>
<f:facet name="next">
<h:outputText value="" styleClass="icon-right-open-1"/>
</f:facet>
<f:facet name="last">
<h:outputText value="" styleClass="icon-to-end"/>
</f:facet>
<div style="text-align: center">
<rich:dataScroller align="center" for="projectList" maxPages="10"
page="#{projectAction.scrollerPage}" id="sc2" reRender="scroller"
fastControls="hide"
renderIfSinglePage="false">
<f:facet name="first">
<h:outputText value="" styleClass="icon-to-start"/>
</f:facet>
<f:facet name="previous">
<h:outputText value="" styleClass="icon-left-open"/>
</f:facet>
<f:facet name="next">
<h:outputText value="" styleClass="icon-right-open-1"/>
</f:facet>
<f:facet name="last">
<h:outputText value="" styleClass="icon-to-end"/>
</f:facet>

<f:facet name="first_disabled">
<h:outputText value="" styleClass="icon-to-start"/>
</f:facet>
<f:facet name="previous_disabled">
<h:outputText value="" styleClass="icon-left-open"/>
</f:facet>
<f:facet name="next_disabled">
<h:outputText value="" styleClass="icon-right-open-1"/>
</f:facet>
<f:facet name="last_disabled">
<h:outputText value="" styleClass="icon-to-end"/>
</f:facet>
</rich:dataScroller>
<f:facet name="first_disabled">
<h:outputText value="" styleClass="icon-to-start"/>
</f:facet>
<f:facet name="previous_disabled">
<h:outputText value="" styleClass="icon-left-open"/>
</f:facet>
<f:facet name="next_disabled">
<h:outputText value="" styleClass="icon-right-open-1"/>
</f:facet>
<f:facet name="last_disabled">
<h:outputText value="" styleClass="icon-to-end"/>
</f:facet>
</rich:dataScroller>
</div>
</h:form>
</s:fragment>
</s:decorate>
Expand Down

0 comments on commit d70f3ca

Please sign in to comment.