Browse Source

Merge branch 'master' of
https://gitlab.univ-artois.fr/ili-2019-2020/microfolielens into
refonte-css

# Conflicts:
# WebContent/index.jsp
# WebContent/inscription.jsp

Arthur Brandao 5 years ago
parent
commit
da829d5d0f

+ 9 - 2
WebContent/index.html → WebContent/index.jsp

@@ -1,3 +1,7 @@
+<%@ page language="java" contentType="text/html; charset=utf-8"
+	pageEncoding="utf-8"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
+
 <!DOCTYPE html>
 <html>
 
@@ -11,7 +15,10 @@
     <title>Accueil - Microfolie Lens</title>
 </head>
 
+<<<<<<< HEAD:WebContent/index.html
 <body class="grey lighten-3">
+	<s:url var="inscriptionurl" action="gotoinscription"/>
+
     <!-- Header -->
     <header class="navbar-fixed">
         <nav class="red">
@@ -27,7 +34,7 @@
                 </div>
                 <ul class="right mright-2 hide-on-med-and-down">
                     <li><a href="#abonne">Abonn&eacute;s</a></li>
-                    <li><a href="inscription.jsp">Inscription</a></li>
+                    <li><a href="${inscriptionurl}">Inscription</a></li>
                     <li><a href="settings">Param&eacute;trage espace</a></li>
                 </ul>
             </div>
@@ -43,7 +50,7 @@
             <hr />
         </li>
         <li><a href="#abonne">Abonn&eacute;s</a></li>
-        <li><a href="inscription.jsp">Inscription</a></li>
+        <li><a href="${inscriptionurl}">Inscription</a></li>
         <li><a href="settings">Param&eacute;trage espace</a></li>
     </ul>
     <div class="mtop-5 hide-on-med-and-down"></div>

+ 75 - 1
WebContent/inscription.jsp

@@ -1,5 +1,6 @@
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
 	pageEncoding="UTF-8"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
 
 <!DOCTYPE html>
 <html>
@@ -12,6 +13,7 @@
     <link type="text/css" rel="stylesheet" href="css/style.min.css" media="screen,projection" />
     <link rel="icon" href="img/favicon.ico" />
     <title>Inscription - Microfolie Lens</title>
+    <s:head />
 </head>
 
 <body class="grey lighten-3">
@@ -69,7 +71,7 @@
                     <div class="input-field col m6 s12">
                         <i class="material-icons prefix">account_circle</i>
                         <input id="nom" type="text" class="validate">
-                        <label for="nom">Nom*</label>
+                        <s:textfield name="nom" label="Nom*" class="validate" />
                     </div>
                 </div>
                 <div class="row">
@@ -139,6 +141,78 @@
         </div>
     </main>
 
+<!--
+	
+			<div class="content">
+				<header>
+					<h4>Inscription à l'espace microfolies</h4>
+				</header>
+				<main>
+					<s:debug />
+					<s:form action="inscription" validate="true">
+						<div class="form-group row">
+							<div class="col-10">
+								<s:textfield name="nom" label="Nom*" class="form-control" />
+							</div>
+						</div>
+						<div class="form-group row">
+							<div class="col-10">
+								<s:textfield name="prenom" label="Prenom*" class="form-control" />
+							</div>
+						</div>
+						<div class="form-group row">
+							<div class="col-3">
+								<s:select nom="genre" label="Genre*" list="getGenres()" />
+							</div>
+						</div>
+						<div class="form-group row">
+							<label class="col-2 col-form-label">Date de naissance*</label>
+							<div class="col-10">
+								<input class="form-control" type="date">
+							</div>
+						</div>
+						<div class="form-group row">
+							<label class="col-2 col-form-label">Ville*</label>
+							<div class="col-10">
+								<input class="form-control" type="text">
+							</div>
+						</div>
+						<div class="form-group row">
+							<label class="col-2 col-form-label">Situation*</label>
+							<div class="col-10">
+								<input class="form-control" type="text">
+							</div>
+						</div>
+						<div class="form-group row">
+							<label class="col-2 col-form-label">Email*</label>
+							<div class="col-10">
+								<input class="form-control" type="text">
+							</div>
+						</div>
+						<div class="form-group row">
+							<label class="col-2 col-form-label">Téléphone *</label>
+							<div class="col-10">
+								<input class="form-control" type="text">
+							</div>
+						</div>
+						<div class="form-group row">
+							<label class="col-2 col-form-label">Contact d'urgence* </label>
+							<div class="col-10">
+								<input class="form-control" type="text">
+							</div>
+						</div>
+						<div class="form-group row" type="text">
+							<label class="col-2 col-form-label">Pièce jointe</label>
+							<div class="col-10">
+								<input class="form-control" type="file" />
+							</div>
+						</div>
+						<s:submit class="btn btn-primary">Valider</s:submit>
+					</s:form>
+				</main>
+			</div>
+-->
+
     <!-- Footer -->
     <footer class="page-footer red">
         <div class="container">

+ 17 - 0
src/microfolie/Inscription-execute-validation.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+    <!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
+        "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
+    <validators>
+        <field name="nom">
+            <field-validator type="requiredstring">
+                <param name="trim">true</param>
+                <message>Vous devez fournir votre nom</message>
+            </field-validator>
+        </field>
+        <field name="prenom">
+            <field-validator type="requiredstring">
+                <param name="trim">true</param>
+                <message>Vous devez fournir votre prénom</message>
+            </field-validator>
+        </field>
+    </validators>

+ 37 - 2
src/microfolie/Inscription.java

@@ -4,7 +4,38 @@ import com.opensymphony.xwork2.ActionSupport;
 
 public class Inscription extends ActionSupport {
 
-	
+	private String nom;
+	private String prenom;
+	private String genre;
+
+	public String getNom() {
+		return nom;
+	}
+
+	public void setNom(String nom) {
+		this.nom = nom;
+	}
+
+	public String getPrenom() {
+		return prenom;
+	}
+
+	public void setPrenom(String prenom) {
+		this.prenom = prenom;
+	}
+
+	public String[] getGenres() {
+		return new String[] { "", "Homme", "Femme", "Autre" };
+	}
+
+	public String getGenre() {
+		return genre;
+	}
+
+	public void setGenre(String genre) {
+		this.genre = genre;
+	}
+
 	/**
 	 * 
 	 */
@@ -12,7 +43,11 @@ public class Inscription extends ActionSupport {
 
 	@Override
 	public String execute() throws Exception {
-		System.out.println("Vu!");
+		System.out.println(nom + " " + prenom);
+		return SUCCESS;
+	}
+
+	public String before() throws Exception {
 		return SUCCESS;
 	}
 

+ 3 - 0
src/struts.xml

@@ -12,5 +12,8 @@
             <result name="success">/index.jsp</result>
             <result name="input">/inscription.jsp</result>
         </action>
+        <action name="gotoinscription" class="microfolie.Inscription" method="before">
+            <result>/inscription.jsp</result>
+        </action>
     </package>
 </struts>