Commit 0e34458e authored by Administrator's avatar Administrator

Adds Bootstrap as a Maven dependency

The Bootstrap libraries (CSS and JavaScript libraries) were inserted in
the web pages (JSF module) through a CDN. Now, these libraries are added
as Maven dependencies, using the Webjars project packages.

In addition, the link and script tags used in the JSF template have been
replaced by the h:outputStylesheet and h:outputScript tags from JSF, as
this tags make consistent the use of relative paths though the different
pages of the application.

Finally, a minor error has been solved in the pets.xhtml file, as the
placeholder text for the birth field was assigned to the animal type
field.
parent e06cd56a
......@@ -24,6 +24,10 @@
<artifactId>service</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
</dependency>
<!-- Testing -->
<dependency>
......
......@@ -5,7 +5,7 @@
<h:head>
<title>Pet Store</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" />
<h:outputStylesheet name="webjars/bootstrap/3.3.7-1/css/bootstrap.min.css" />
</h:head>
<h:body>
<div class="container">
......@@ -41,7 +41,7 @@
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<h:outputScript name="webjars/jquery/1.11.1/jquery.min.js" />
<h:outputScript name="webjars/bootstrap/3.3.7-1/js/bootstrap.min.js" />
</h:body>
</html>
\ No newline at end of file
......@@ -15,10 +15,10 @@
<h:panelGroup class="row">
<h:form>
<h:inputText class="form-control" a:placeholder="Pet name" value="#{pet.name}"></h:inputText>
<h:inputText value="#{pet.birth}" size="20" required="true" label="Receipt Date" class="form-control">
<h:inputText value="#{pet.birth}" size="20" required="true" label="Receipt Date" class="form-control" a:placeholder="Birth (YYYY-MM-DD hh:mm:ss)">
<f:convertDateTime pattern="yyyy-M-d hh:mm:ss" />
</h:inputText>
<h:selectOneMenu value="#{pet.animal}" class="form-control" a:placeholder="Birth (YYYY-MM-DD hh:mm:ss)">
<h:selectOneMenu value="#{pet.animal}" class="form-control">
<f:selectItem itemValue="BIRD" itemLabel="Bird" />
<f:selectItem itemValue="CAT" itemLabel="Cat" />
<f:selectItem itemValue="DOG" itemLabel="Dog" />
......
......@@ -47,6 +47,7 @@
<!-- Dependencies versions -->
<wildfly.version>8.2.1.Final</wildfly.version>
<commons.lang3.version>3.4</commons.lang3.version>
<bootstrap.version>3.3.7-1</bootstrap.version>
<!-- Testing dependecies versions -->
<junit.version>4.12</junit.version>
......@@ -131,6 +132,11 @@
<artifactId>commons-lang3</artifactId>
<version>${commons.lang3.version}</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>${bootstrap.version}</version>
</dependency>
<!-- Testing -->
<dependency>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment