Skip to content

Commit

Permalink
#9 Improving styling
Browse files Browse the repository at this point in the history
  • Loading branch information
tigreped committed Dec 3, 2015
1 parent 8cf27cf commit 045f013
Show file tree
Hide file tree
Showing 17 changed files with 1,639 additions and 1,137 deletions.
Binary file added keystore.p12
Binary file not shown.
37 changes: 21 additions & 16 deletions src/main/java/br/gov/sibbr/api/controller/InterfaceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import br.gov.sibbr.api.model.LoginForm;
import br.gov.sibbr.api.service.AuthService;
Expand All @@ -39,7 +38,7 @@ public class InterfaceController implements ErrorController {
private AuthService authService = new AuthService();

/* POST methods: */

// Method responsible for managing occurrence requests
@RequestMapping(value = "/login", method = RequestMethod.POST)
public String login(LoginForm loginForm, Model model) {
Expand All @@ -48,7 +47,8 @@ public String login(LoginForm loginForm, Model model) {
if (email != null && password != null) {
String message = authService.checkPassword(email, password);
if (message == null) {
// Successful authentication. Valid credentials, fetch user token:
// Successful authentication. Valid credentials, fetch user
// token:
String token = authService.fetchToken(email);
if (token != null) {
model.addAttribute("token", token);
Expand Down Expand Up @@ -120,16 +120,15 @@ public String changePassword(LoginForm loginForm, Model model) {
// Password too small:
else {
model.addAttribute("error",
"Password too small. Password must be at least 5 characters long, with a valid address.");
"Password too small. Password must be at least 8 characters long, with a valid address.");
}
}
// Passwords don't match
else {
model.addAttribute("error",
"The passwords don't match. Try again, and make sure the same password is entered in both password and password verification fields.");
}
}
else {
} else {
model.addAttribute("error", tokenCheck);
}
}
Expand All @@ -145,9 +144,9 @@ public String changePassword(LoginForm loginForm, Model model) {
}
return "password_change";
}

/* GET methods */

// Method responsible for calling the documentation on admin operations
@RequestMapping(value = "/admin", method = RequestMethod.GET)
public String admin() {
Expand All @@ -160,12 +159,18 @@ public String greeting(Model model) {
return "index";
}

// Method responsible for calling the login template
@RequestMapping(value = "/ocorrencia", method = RequestMethod.GET)
public String occurrences() {
return "occurrences";
}

// Method responsible for calling the occurrente documantion template
@RequestMapping(value = "/ocorrencia", method = RequestMethod.GET)
public String occurrence() {
return "occurrences";
}

// Method responsible for calling the resource documantion template
@RequestMapping(value = "/recurso", method = RequestMethod.GET)
public String resource() {
return "resources";
}

// Method responsible for calling the login template
@RequestMapping(value = "/login", method = RequestMethod.GET)
public String login() {
Expand All @@ -184,7 +189,7 @@ public String changePassword() {
return "password_change";
}

// Method responsible for displaying statistics documentation
// Method responsible for displaying statistics documentation template
@RequestMapping(value = "/estatisticas", method = RequestMethod.GET)
public String stats() {
return "stats";
Expand All @@ -199,4 +204,4 @@ public String error() {
public String getErrorPath() {
return ERROR_PATH;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class StatisticsController {
AuthService authService = new AuthService();

// Method responsible for managing occurrence requests
@RequestMapping(value = "/statisticas/totalRegistros", method = RequestMethod.GET)
@RequestMapping(value = "/estatisticas/totalRegistros", method = RequestMethod.GET)
@Cacheable("total_records")
public Object fetchTotalRecords(@RequestParam(value = "token", defaultValue = "null") String token) {
// Check of the user has proper access grant token
Expand Down
1 change: 1 addition & 0 deletions src/main/java/br/gov/sibbr/api/db/DatabaseConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class DatabaseConnection {
public static String dataUrl = "jdbc:postgresql://localhost/dataportal";
public static String dataUser = "dbadmin";
public static String dataPassword = "dbadmin";

// DB Connection configuration for authentication access:
public static String authUrl = "jdbc:postgresql://localhost/dataportal_auth";
public static String authUser = "dbadmin";
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/br/gov/sibbr/api/db/DatabaseQueries.java
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public ResultSet queryTotalSpecies() {
try {
statement = conn.createStatement();
resultSet = statement.executeQuery("SELECT count(distinct(scientificname)) as totalspecies FROM "
+ OCCURRENCE_TABLE + " where taxonrank in ('espécie', 'EspÈcie', 'SPECIES','ESPECIE')");
+ OCCURRENCE_TABLE + " where taxonrank in ('espécie', 'EspÈcie', 'SPECIES','ESPECIE', 'species')");
} catch (SQLException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -501,7 +501,7 @@ public ResultSet queryTotalGenus() {
try {
statement = conn.createStatement();
resultSet = statement.executeQuery("SELECT count(distinct(scientificname)) as totalgenus FROM "
+ OCCURRENCE_TABLE + " where taxonrank in ('GENUS', 'GÍnero', 'gênero')");
+ OCCURRENCE_TABLE + " where taxonrank in ('GENUS', 'GÍnero', 'gênero', 'genus')");
} catch (SQLException e) {
e.printStackTrace();
}
Expand Down
192 changes: 102 additions & 90 deletions src/main/resources/static/stylesheets/style.css
Original file line number Diff line number Diff line change
@@ -1,106 +1,118 @@
@charset "UTF-8";
/* HTML5 ✰ Boilerplate
*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
* Kroc Camen, and the H5BP dev community and team.
*
* Detailed information about this CSS: h5bp.com/css
*
* ==|== normalize ========================================================== */
/* =============================================================================
* HTML5 display definitions
* ========================================================================== */
body {
font-size: 13px;
line-height: 1.231;
font-family: sans-serif;
color: #000000;
background-color: #f1f2f3;
padding: 0 5%;
text-align: justify;
font-size: 13px;
line-height: 1.231;
font-family: sans-serif;
color: #000000;
background-color: #f1f2f3;
padding: 0 5%;
text-align: justify;
}

.loginbox {
position: absolute;
background-color: #9D97B6;
border: 1px thin;
float: center;
border-radius: 10px;
padding: 5% 10%;
margin: 5% 28%;
position: absolute;
min-width: 300px;
max-width: 500px;
background-color: #7DCE8F;
border: 1px thin;
border-radius: 10px;
padding: 1% 1%;
margin: 15% 30%;
}

positive {
color: green;
.fieldcenter {
text-align: right;
}

negative {
color: red;
input:focus, textarea:focus {
outline: 0;
border-color: #468854;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px #c4ae30;
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px #c4ae30;
}

h2 {

input, textarea {
margin: 0 0 0 10px;
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-ms-transition: border linear 0.2s, box-shadow linear 0.2s;
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.container {
display: table;
width: 100%;
border-collapse: collapse;
input {
display: inline-block;
height: 25px;
margin: 4px;
line-height: 18px;
border: 1px solid #cccccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}

.heading {
font-weight: bold;
display: table-row;
background-color: #50D67B;
text-align: center;
line-height: 25px;
font-size: 14px;
font-family: georgia;
color: #fff;
label {
display: inline-block;
padding-right: 3px;
}

.table-row {
display: table-row;
text-align: center;
box2 {
text-align: right;
width: 280px;
}

.col {
display: table-cell;
border: 1px solid #CCC;
padding: 1% 1% 1% 1%;
.title {
padding-right: 22px;
}

input:focus,textarea:focus {
outline: 0;
border-color: #c4ae30;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px #c4ae30;
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px
rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px #c4ae30;
.ui-tabs {
position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
padding: .2em;
}

input,textarea {
margin: 0 0 0 10px;
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
-ms-transition: border linear 0.2s, box-shadow linear 0.2s;
-o-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
.ui-tabs .ui-tabs-nav {
margin: 0;
padding: .2em .2em 0;
}
.ui-tabs .ui-tabs-nav li {
list-style: none;
float: left;
position: relative;
top: 0;
margin: 1px .2em 0 0;
border-bottom-width: 0;
padding: 0;
white-space: nowrap;
}
.ui-tabs .ui-tabs-nav .ui-tabs-anchor {
float: left;
padding: .5em 1em;
text-decoration: none;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active {
margin-bottom: -1px;
padding-bottom: 1px;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
cursor: text;
}
.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
cursor: pointer;
}
.ui-tabs .ui-tabs-panel {
display: block;
border-width: 0;
padding: 1em 1.4em;
background: none;
}
.ui-tooltip {
padding: 8px;
position: absolute;
z-index: 9999;
max-width: 300px;
-webkit-box-shadow: 0 0 5px #aaa;
box-shadow: 0 0 5px #aaa;
}
body .ui-tooltip {
border-width: 2px;
}

input {
display: inline-block;
height: 25px;
margin: 4px;
font-size: 13px;
line-height: 18px;
color: gray;
border: 1px solid #cccccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
a {
color: #075A39;
}
Loading

0 comments on commit 045f013

Please sign in to comment.