Skip to content
Snippets Groups Projects
Commit 643d8439 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '146-accessing-admin-panel' into 'master'

when invalid credentials are passed during login error message is shown

Closes #146

See merge request !66
parents 0beadc1b 0a66b2a2
No related branches found
No related tags found
1 merge request!66when invalid credentials are passed during login error message is shown
......@@ -381,4 +381,19 @@ table.mapInfoBoxResultsTable, table.mapInfoBoxResultsTable th, table.mapInfoBoxR
table.minerva-publication-table td {
padding: 0px;
}
\ No newline at end of file
}
input.minerva-input-text, input.minerva-input-password {
background-color: #21BDF1;
color: #ffffff;
width: 210px;
box-shadow: none;
-moz-box-shadow: none;
-webkit-box-shadow: none;
font-size: 14px;
font-weight: 900;
padding: 8px;
font-family: Lato;
margin: 0;
border: none
}
......@@ -5,18 +5,32 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
>
<h:head>
<title>#{mapMB.currentProject.name} - Authorization form</title>
<link rel="shortcut icon" href="./resources/images/favicon.png" type="image/png" />
<h:outputStylesheet library="css" name="style.css"/>
<h:outputStylesheet library="css" name="admin.css"/>
<ui:include src="/WEB-INF/components/admin/statistics.xhtml" />
<script src="https://maps.google.com/maps/api/js?libraries=drawing&amp;v=3.26" type="text/javascript"/>
<script src="https://code.jquery.com/jquery-1.12.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"/>
<h:outputScript library="js" name="minerva.js" />
<h:outputStylesheet library="css" name="style.css"/>
<h:outputStylesheet library="css" name="minerva.css" />
<h:outputStylesheet library="css" name="admin.css"/>
<script type="text/javascript">
//<![CDATA[
......@@ -44,6 +58,12 @@ function init() {
return login().then(function(){
loggedIn = true;
$('#login').click();
}, function(error){
if (error.constructor.name=== "InvalidCredentialsError" ) {
minerva.GuiConnector.alert("invalid credentials");
} else {
minerva.GuiConnector.alert(error);
}
});
}
});
......@@ -56,25 +76,22 @@ function init() {
<h:body onload="init();">
<ui:include src="/WEB-INF/components/admin/header.xhtml" />
<ui:include src="/WEB-INF/components/admin/header.xhtml" />
<center>
<h:form name="loginForm" prependId="false" class="loginPanel" style="text-align:left">
<div class="headerFormTitle">AUTHORIZATION FORM</div>
<div style="top:0px; width:410px; display: block;">
<p:messages style="top:0px; width:100%;" id="loginMessages" showDetail="true" autoUpdate="true" closable="true" />
</div>
<h:panelGrid columns="2" styleClass="loginDataPanelGrid" >
<label for="username" class="labelText">LOGIN: </label>
<p:inputText id="username" name="username" value="#{userMB.login}"/>
<h:inputText id="username" name="username" value="#{userMB.login}" class="minerva-input-text"/>
<label for="password" class="labelText">PASSWORD: </label>
<p:password id="password" name="password" value="#{userMB.password}" type="password"/>
<h:inputSecret id="password" name="password" value="#{userMB.password}" type="password" class="minerva-input-password"/>
<label class="labelText"> </label>
<p:commandButton type="submit" id="login" action="#{userMB.doLogin}" ajax="false"
<h:commandButton type="submit" id="login" action="#{userMB.doLogin}" ajax="false"
value="LOGIN" styleClass="labelText" update="loginMessages"/>
</h:panelGrid>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment