Просмотр исходного кода

Добавил стили на все оставшиеся страницы.
Остался злочастный список студентов при авторизации исполнителя.
Плюс. поправить футер на странице регистрации Администратора.

ilysk лет назад: 7
Родитель
Сommit
f305ef8ecc

+ 6 - 0
src/EntitiesDao/StudentDao.java

@@ -22,6 +22,12 @@ public class StudentDao {
         session.close();
         return res;
     }
+    /*
+    public ArrayList<String> getStudentsList() {
+        Session session = getSession();
+
+    }
+    */
     public static void createNewStudent(StudentsEntity student) {
         Session session = getSession();
         Query query = session.createQuery("Select max(studentsId) FROM StudentsEntity ");

+ 19 - 3
web/WEB-INF/views/cssforpr.css

@@ -40,7 +40,6 @@ html {
     position: absolute;
     bottom: 0;
     width: 100%;
-    /* Set the fixed height of the footer here */
     height: 25px;
     background-color: #f5f5f5;
     text-align: center;
@@ -57,6 +56,8 @@ html {
     font-family: 'Roboto', sans-serif;
     padding: 0 20px 0 50px;
     outline: none;
+    background: #fff url('http://i.imgur.com/u0XmBmv.png') 20px top no-repeat;
+    background-size: 16px 80px;
 }
 
 .login-block input#password {
@@ -68,7 +69,7 @@ html {
     border: 1px solid #063971;
 }
 
-.login-block form select{
+.login-block form select {
     width: 100%;
     height: 42px;
     box-sizing: border-box;
@@ -85,7 +86,6 @@ html {
 
 .login-block form select option {
     align-items: center;
-    box-sizing: inherit;
     color: #111;
     display: flex;
     font-family: 'Roboto', sans-serif;
@@ -178,6 +178,22 @@ a:hover {
     font-size: xx-large;
 }
 
+.container{
+    text-align: center;
+    font-size: 14px;
+    font-family: 'Roboto', sans-serif;
+    margin-top: 150px;
+}
+
+.container h1 {
+    text-align: center;
+    color: #000;
+    font-size: 18px;
+    text-transform: uppercase;
+    margin-top: 0;
+    margin-bottom: 20px;
+}
+
 .nav-masthead .nav-link {
     padding: .25rem 0;
     font-weight: bold;

+ 32 - 8
web/WEB-INF/views/loginViews/adminBar.jsp

@@ -10,18 +10,42 @@
 <html>
 <head>
     <title>Страница администратора</title>
+    <style type="text/css">
+        <%@include file="../cssforpr.css" %>
+        <%@include file="../bootstrap.min.css" %>
+    </style>
 </head>
 <body>
 <%--
     Все сообщения ${<название сообщения} буду ошибками в случае неправильного заполнения/ не заполнения поля, около которого появляется
 --%>
-<h1>Страница админа</h1>
-<form:form method="post" modelAttribute="adminLogin" action="checkAdmin">
-    <form:select path="name" type="text" value="" placeholder="Логин" id="adminName">
-        <form:options items="${adminList}"/>
-    </form:select><br/>
-    <form:input path="password" type="password" value="" placeholder="Пароль" id="password"/>${passMessage}<br/>
-    <form:button>Войти</form:button>
-</form:form>
+
+<div class="inner">
+    <h3 class="masthead-brand">Mephorce</h3>
+    <nav class="nav nav-masthead">
+        <a class="nav-link active" href="/">Войти</a>
+        <a class="nav-link" href="/aboutUs">О проекте</a>
+        <a class="nav-link" href="/registrate">Создать аккаунт</a>
+        <a class="nav-link" href="/contacts">Контакты</a>
+    </nav>
+</div>
+
+<div class="logo"></div>
+<div class="login-block">
+
+<h1>Вход как Администратор</h1>
+    <form:form method="post" modelAttribute="adminLogin" action="checkAdmin">
+        <form:select path="name" type="text" value="" placeholder="Логин" id="adminName">
+            <form:options items="${adminList}"/>
+        </form:select><br/>
+        <form:input path="password" type="password" value="" placeholder="Пароль" id="password"/>${passMessage}<br/>
+        <form:button>Войти</form:button>
+    </form:form>
+</div>
+
+<footer class="main-footer">
+    <span>&copy;2017 Mephorce</span>
+</footer>
+
 </body>
 </html>

+ 2 - 2
web/WEB-INF/views/loginViews/index.jsp

@@ -32,8 +32,8 @@
     </nav>
 </div>
 
-<div class="logo"></div>
-<div class="login-block">
+    <div class="logo"></div>
+    <div class="login-block">
   <h1>Вход в систему</h1>
   <spring:form method="post"  modelAttribute="userJSP" action="check-user">
      <spring:select path="name" type="text" value="" placeholder="Логин" id="username">

+ 31 - 8
web/WEB-INF/views/loginViews/ownerBar.jsp

@@ -10,19 +10,42 @@
 <html>
 <head>
     <title>Страница заказчика</title>
+    <style type="text/css">
+        <%@include file="../cssforpr.css" %>
+        <%@include file="../bootstrap.min.css" %>
+    </style>
 </head>
 <body>
 <%--
     Все сообщения ${<название сообщения} буду ошибками в случае неправильного заполнения/ не заполнения поля, около которого появляется
 --%>
-<h1>Страница заказчика</h1>
-<form:form method="post" modelAttribute="clientLogin" action="checkClient">
-    <form:select path="name" type="text" value="" placeholder="Логин" id="clientName">
-        <form:options items="${clientList}"/>
-    </form:select><br/>
-    <form:input path="password" type="password" value="" placeholder="Пароль" id="password"/>${passMessage}<br/>
-    <form:button>Войти</form:button>
-</form:form>
+
+<div class="inner">
+    <h3 class="masthead-brand">Mephorce</h3>
+    <nav class="nav nav-masthead">
+        <a class="nav-link active" href="/">Войти</a>
+        <a class="nav-link" href="/aboutUs">О проекте</a>
+        <a class="nav-link" href="/registrate">Создать аккаунт</a>
+        <a class="nav-link" href="/contacts">Контакты</a>
+    </nav>
+</div>
+
+<div class="logo"></div>
+<div class="login-block">
+
+<h1>Вход как заказчик</h1>
+    <form:form method="post" modelAttribute="clientLogin" action="checkClient">
+        <form:select path="name" type="text" value="" placeholder="Логин" id="clientName">
+            <form:options items="${clientList}"/>
+        </form:select><br/>
+        <form:input path="password" type="password" value="" placeholder="Пароль" id="password"/>${passMessage}<br/>
+        <form:button>Войти</form:button>
+    </form:form>
+</div>
+
+<footer class="main-footer">
+    <span>&copy;2017 Mephorce</span>
+</footer>
 
 </body>
 </html>

+ 47 - 9
web/WEB-INF/views/loginViews/studentBar.jsp

@@ -14,7 +14,11 @@
 <html>
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <title>JSP Page</title>
+    <title>Страница студента</title>
+    <style type="text/css">
+        <%@include file="../cssforpr.css" %>
+        <%@include file="../bootstrap.min.css" %>
+    </style>
 </head>
 <script type="text/javascript" charset="utf-8">
     $("select#groupId").change(function(){
@@ -26,18 +30,52 @@
             $("select#studentId").html(options);
         });
     });
+
+    $("select#groupId").change(function(){
+        $.getJSON("/loadStudents",{groupId: $(this).val()}, function(j){
+            var options = '';
+            for (var i = 0; i < j.length; i++) {
+                options += '<option value="' + j[i].stFamily + '">' + j[i].stFamily + '</option>';
+            }
+            $("select#studentId").html(options);
+        });
+    });
 </script>
 
 <body>
-<form:form method="post" modelAttribute="studentLogin" action="checkStudent">
-    <form:select id="groupId" path="">
-        <c:forEach items="${groupList}" var="group">
+
+<div class="inner">
+    <h3 class="masthead-brand">Mephorce</h3>
+    <nav class="nav nav-masthead">
+        <a class="nav-link active" href="/">Войти</a>
+        <a class="nav-link" href="/aboutUs">О проекте</a>
+        <a class="nav-link" href="/registrate">Создать аккаунт</a>
+        <a class="nav-link" href="/contacts">Контакты</a>
+    </nav>
+</div>
+
+<div class="logo"></div>
+<div class="login-block">
+
+    <h1>Вход как Исполнитель</h1>
+    <form:form method="post" modelAttribute="studentLogin" action="checkStudent">
+        <form:select id="groupId" path="">
+            <c:forEach items="${groupList}" var="group">
+                <form:option value="${group.groupId}" >${group.groupName}</form:option>
+            </c:forEach><br/>
+        </form:select>
+        <form:select id="studentId" path="name">
             <form:option value="${group.groupId}" >${group.groupName}</form:option>
-        </c:forEach><br/>
-    </form:select>
-    <form:select id="studentId" path="name">
-    </form:select>
-</form:form>
+        </form:select>
+        <form:input path="password" type="password" value="" placeholder="Пароль" id="password"/>${passMessage}<br/>
+        <form:button>Войти</form:button>
+    </form:form>
+</div>
+
+<footer class="main-footer">
+    <span>&copy;2017 Mephorce</span>
+</footer>
+
 </body>
 </html>
 

+ 38 - 13
web/WEB-INF/views/registrationViews/regAdminPage.jsp

@@ -9,23 +9,48 @@
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <html>
 <head>
-    <title>reg admin</title>
+    <title>Регистрация Администратора</title>
+    <style type="text/css">
+        <%@include file="../cssforpr.css" %>
+        <%@include file="../bootstrap.min.css" %>
+    </style>
 </head>
 <body>
 <%--
     Все сообщения ${<название сообщения} буду ошибками в случае неправильного заполнения/ не заполнения поля, около которого появляется
 --%>
-<spring:form method="post"  modelAttribute="admin" action="regAdminAction">
-    <spring:input path="modFamily" type="text" placeholder="Фамилия"/>${famMessage}   <br/>
-    <spring:input path="modFirstName" type="text" placeholder="Имя"/>${nameMessage}   <br/>
-    <spring:input path="modSecName" type="text" placeholder="Отчество"/>${secNameMessage}   <br/>
-    <spring:input path="modEmail" type="text" placeholder="E-mail"/>${emailMessage}   <br/>
-    <spring:input path="modHometown" type="text" placeholder="Город"/>${hometownMessage}   <br/>
-    <spring:input path="modPhone" type="text" placeholder="Телефон"/>${phoneMessage}   <br/>
-    <spring:input path="modBirthdate" type="date" placeholder="День рождения"/>${birthMessage} <br/>
-    <spring:input path="modPassword" type="password" placeholder="Пароль"/>${passMessage}   <br/>
-    ${errorMessage}<br/>
-    <spring:button>Зарегистрироваться</spring:button>
-</spring:form>
+
+<div class="inner">
+    <h3 class="masthead-brand">Mephorce</h3>
+    <nav class="nav nav-masthead">
+        <a class="nav-link active" href="/">Войти</a>
+        <a class="nav-link" href="/aboutUs">О проекте</a>
+        <a class="nav-link" href="/registrate">Создать аккаунт</a>
+        <a class="nav-link" href="/contacts">Контакты</a>
+    </nav>
+</div>
+
+<div class="logo"></div>
+<div class="login-block">
+
+    <spring:form method="post"  modelAttribute="admin" action="regAdminAction">
+        <h1>Регистрация Администратора</h1>
+        <spring:input path="modFamily" type="text" placeholder="Фамилия"/>${famMessage}   <br/>
+        <spring:input path="modFirstName" type="text" placeholder="Имя"/>${nameMessage}   <br/>
+        <spring:input path="modSecName" type="text" placeholder="Отчество"/>${secNameMessage}   <br/>
+        <spring:input path="modEmail" type="text" placeholder="E-mail"/>${emailMessage}   <br/>
+        <spring:input path="modHometown" type="text" placeholder="Город"/>${hometownMessage}   <br/>
+        <spring:input path="modPhone" type="text" placeholder="Телефон"/>${phoneMessage}   <br/>
+        <spring:input path="modBirthdate" type="date" placeholder="День рождения"/>${birthMessage} <br/>
+        <spring:input path="modPassword" type="password" placeholder="Пароль"/>${passMessage}   <br/>
+        ${errorMessage}<br/>
+        <spring:button>Зарегистрироваться</spring:button>
+    </spring:form>
+</div>
+
+<footer class="main-footer">
+    <span>&copy;2017 Mephorce</span>
+</footer>
+
 </body>
 </html>

+ 36 - 11
web/WEB-INF/views/registrationViews/regClientPage.jsp

@@ -9,21 +9,46 @@
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <html>
 <head>
-    <title>reg client</title>
+    <title>Регистрация Клиента</title>
+    <style type="text/css">
+        <%@include file="../cssforpr.css" %>
+        <%@include file="../bootstrap.min.css" %>
+    </style>
 </head>
 <body>
-<body>
 <%--
     Все сообщения ${<название сообщения} буду ошибками в случае неправильного заполнения/ не заполнения поля, около которого появляется
 --%>
-<spring:form method="post"  modelAttribute="client" action="regClientAction">
-    <spring:input path="clFamily" type="text" placeholder="Фамилия"/>${famMessage}   <br/>
-    <spring:input path="clFirstName" type="text" placeholder="Имя"/>${nameMessage}   <br/>
-    <spring:input path="clSecName" type="text" placeholder="Отчество"/>${secNameMessage}   <br/>
-    <spring:input path="clPassword" type="password" placeholder="Пароль"/>${passMessage}   <br/>
-    ${errMessage}<br/>
-    <spring:button>Зарегистрироваться</spring:button>
-</spring:form>
-</body>
+
+<div class="inner">
+    <h3 class="masthead-brand">Mephorce</h3>
+    <nav class="nav nav-masthead">
+        <a class="nav-link active" href="/">Войти</a>
+        <a class="nav-link" href="/aboutUs">О проекте</a>
+        <a class="nav-link" href="/registrate">Создать аккаунт</a>
+        <a class="nav-link" href="/contacts">Контакты</a>
+    </nav>
+</div>
+
+<div class="logo"></div>
+<div class="login-block">
+
+    <spring:form method="post"  modelAttribute="client" action="regClientAction">
+        <h1>Регистрация Заказчика</h1>
+        <spring:input path="clFamily" type="text" placeholder="Фамилия"/>${famMessage}   <br/>
+        <spring:input path="clFirstName" type="text" placeholder="Имя"/>${nameMessage}   <br/>
+        <spring:input path="clSecName" type="text" placeholder="Отчество"/>${secNameMessage}   <br/>
+        <spring:input path="clPassword" type="password" placeholder="Пароль"/>${passMessage}   <br/>
+        ${errMessage}<br/>
+        <spring:button>Зарегистрироваться</spring:button>
+    </spring:form>
+</div>
+
+<footer class="main-footer">
+    <div class="container">
+        <span>&copy;2017 Mephorce</span>
+    </div>
+</footer>
+
 </body>
 </html>

+ 36 - 11
web/WEB-INF/views/registrationViews/regStudentPage.jsp

@@ -11,24 +11,49 @@
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <html>
 <head>
-    <title>student form</title>
+    <title>Регистрация Исполнителя</title>
+    <style type="text/css">
+        <%@include file="../cssforpr.css" %>
+        <%@include file="../bootstrap.min.css" %>
+    </style>
 </head>
 <%--
     Все сообщения ${<название сообщения} буду ошибками в случае неправильного заполнения/ не заполнения поля, около которого появляется
 --%>
 <body>
-<spring:form method="post"  modelAttribute="student" action="regStudentAction">
-    <spring:input path="stFamily" type="text" placeholder="Фамилия"/> ${famMessage}  <br/>
-    <spring:input path="stFirstName" type="text" placeholder="Имя"/>${nameMessage}   <br/>
-    <spring:input path="stSecName" type="text" placeholder="Отчество"/>${secNameMessage}   <br/>
-    <spring:input path="stPkNumber" type="password" placeholder="Пароль"/>${passMessage}   <br/>
-    <form:select id="groupId" path="stGroup">
+
+<div class="inner">
+    <h3 class="masthead-brand">Mephorce</h3>
+    <nav class="nav nav-masthead">
+        <a class="nav-link active" href="/">Войти</a>
+        <a class="nav-link" href="/aboutUs">О проекте</a>
+        <a class="nav-link" href="/registrate">Создать аккаунт</a>
+        <a class="nav-link" href="/contacts">Контакты</a>
+    </nav>
+</div>
+
+<div class="logo"></div>
+<div class="login-block">
+
+    <spring:form method="post"  modelAttribute="student" action="regStudentAction">
+        <h1>Регистрация Исполнителя</h1>
+            <spring:input path="stFamily" type="text" placeholder="Фамилия"/> ${famMessage}  <br/>
+            <spring:input path="stFirstName" type="text" placeholder="Имя"/>${nameMessage}   <br/>
+            <spring:input path="stSecName" type="text" placeholder="Отчество"/>${secNameMessage}   <br/>
+            <spring:input path="stPkNumber" type="password" placeholder="Пароль"/>${passMessage}   <br/>
+        <form:select id="groupId" path="stGroup">
         <c:forEach items="${groupList}" var="group">
             <form:option value="${group.groupId}" >${group.groupName}</form:option>
         </c:forEach><br/>
-    </form:select>
-    ${errMessage}<br/>
-    <spring:button>Зарегистрироваться</spring:button>
-</spring:form>
+        </form:select>
+            ${errMessage}<br/>
+        <spring:button>Зарегистрироваться</spring:button>
+        </spring:form>
+</div>
+
+<footer class="main-footer">
+    <span>&copy;2017 Mephorce</span>
+</footer>
+
 </body>
 </html>

+ 35 - 4
web/WEB-INF/views/registrationViews/registration.jsp

@@ -9,11 +9,42 @@
 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
 <html>
 <head>
-    <title>First step regit page</title>
+    <title>Регистрация</title>
+    <style type="text/css">
+        <%@include file="../cssforpr.css" %>
+        <%@include file="../bootstrap.min.css" %>
+    </style>
 </head>
 <body>
-    <a href="/regStudent">Исполнитель</a>
-    <a href="/regAdmin">Администратор</a>
-    <a href="/regClient">Заказчик</a>
+
+<div class="inner">
+    <h3 class="masthead-brand">Mephorce</h3>
+    <nav class="nav nav-masthead">
+        <a class="nav-link active" href="/">Войти</a>
+        <a class="nav-link" href="/aboutUs">О проекте</a>
+        <a class="nav-link" href="/registrate">Создать аккаунт</a>
+        <a class="nav-link" href="/contacts">Контакты</a>
+    </nav>
+</div>
+    <div class="container">
+    <h1>Выбор типа создаваемого пользователя</h1>
+    <div class="btn-group-vertical" role="group" aria-label="Vertical button group">
+
+        <button type="button" class="btn btn-secondary">
+            <a href="/regStudent">Исполнитель</a>
+        </button>
+        <button type="button" class="btn btn-secondary">
+            <a href="/regAdmin">Администратор</a>
+        </button>
+        <button type="button" class="btn btn-secondary">
+            <a href="/regClient">Заказчик</a>
+        </button>
+
+    </div>
+    </div>
+<footer class="main-footer">
+    <span>&copy;2017 Mephorce</span>
+</footer>
+
 </body>
 </html>