Skip to content

Commit

Permalink
Feature: Update login page design (#142)
Browse files Browse the repository at this point in the history
* add new login style

* import the new login style

* update login template

* put colors variables in one globale file

* convert login file from .erb to .haml

* Remove the replaceable classes by bootstrap classes & use css variables instead of fixed values

* import variables file

* Update application.css.scss.erb

* Update application.css.scss.erb

* Update application.css.scss.erb

* Update and rename variables_stage.scss to variables.scss.erb

* Update bioportal.scss

* Update login.scss

* Rename variables.scss.erb to theme-variables.scss.erb

* Update application.css.scss.erb

---------

Co-authored-by: Syphax Bouazzouni <[email protected]>
  • Loading branch information
Bilelkihal and syphax-bouazzouni authored Jan 31, 2023
1 parent bd78633 commit eb9bb78
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 36 deletions.
3 changes: 2 additions & 1 deletion app/assets/stylesheets/application.css.scss.erb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*= require thickbox
*= require select2
*= require trumbowyg
*
*= require theme-variables
*/

/* BioPortal */
Expand All @@ -44,6 +44,7 @@
@import "file_uploader";
@import "browse";
@import "flatpickr/dist/themes/light";
@import "login";

/* Bootstrap and Font Awesome */
@import "bootstrap";
Expand Down
28 changes: 27 additions & 1 deletion app/assets/stylesheets/bioportal.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
*{
font-family: poppins;
margin: 0;
padding: 0;
}
.alignright {
float:right;
}
Expand Down Expand Up @@ -49,7 +54,7 @@
#bd {
background: #fff;
}
#bd hr {
#bd > hr {
border:0;
height:1px;
color:#e9eaeb;
Expand Down Expand Up @@ -511,6 +516,27 @@ li.ac_over > .obsolete_class {
cursor: inherit; /*override the help cursor for selection menus*/
}

.concept_details p {
margin-bottom: .5em;
}

.concept_details .label {
vertical-align: top;
width: 180px;
max-width: 200px;
}

.concept_details tbody td {
padding: 0.6em 0.8em 0 !important;
white-space: normal; /* css-3 */
white-space: -moz-normal; /* Mozilla, since 1999 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}

.concept_details td:nth-child(1) {
white-space: nowrap;
}

#format_specific_options td {
border-top: 1px solid #C1DAD7;
}
Expand Down
64 changes: 64 additions & 0 deletions app/assets/stylesheets/login.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.login-form{
margin-top: 30px;
padding: 37px 41px;
box-shadow: rgba(0, 0, 0, 0.08) 0px 20px 50px;
border-radius: 14px;
}

.login-input{
box-sizing: border-box;
outline: none;
padding: 19px;
font-size: 16px;
border: 1px solid #BDBDBD;
border-radius: 9px;
width: 357px;
}

.login-input:focus{
border: 1px solid var(--primary-color);
}
.login-input::placeholder{
font-weight: 300;
color: #C1C1C1;
}

.login-input-title{
font-size: 13px;
margin-bottom: 5px;
font-weight: 600;
color: #666666;
}
.email-input{
margin-bottom: 20px;
}
.password-input{
margin-bottom: 8px;
}
.login-forgot-password{
font-weight: 500 ;
text-align: end;
text-decoration:none;
font-size: 13px;
}
.login-button{
margin-top: 10px;
width: 357px;
font-size: 16px;
color: white;
padding: 17px;
background-color: var(--primary-color);
border: none;
border-radius: 9px;
margin-bottom: 20px;
}
.login-button:hover{
background-color: var(--hover-color);
cursor: pointer;
}

.dont-have-account{
font-size: 15px;
font-weight: 600;
text-align: center;
}
30 changes: 30 additions & 0 deletions app/assets/stylesheets/theme-variables.scss.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<%# This file contains all the color themes of ontoportal alliance%>
<% if (ui_theme = $UI_THEME.to_s.parameterize).present? && File.exists?(Rails.root.join('app', 'assets', 'stylesheets', 'themes', ui_theme))
case ui_theme
when "agroportal" %>
:root{
--primary-color: #31B404;
--hover-color: #40C811;
--secondary-color: #ffc107;
}
<% when "stageportal" %>
:root{
--primary-color: #76A7CC;
--hover-color: #6B96B7;
--secondary-color: #ffc107;
}
<% when "bioportal" %>
:root{
--primary-color: #76A7CC;
--hover-color: #31B404;
--secondary-color: #ffc107;
}
<% when "ontoportal" %>
:root{
--primary-color: #6E98A2;
--hover-color: #7BABB6;
--secondary-color: #ffc107;
}
<%# Here to add a new theme ... %>
<% end %>
<% end %>
34 changes: 0 additions & 34 deletions app/views/login/index.html.erb

This file was deleted.

20 changes: 20 additions & 0 deletions app/views/login/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- @title = "Login"
= form_for(:user, :url => {:controller => 'login',:action=>'create'}) do |f|
- unless @errors.nil?
%div{:style => "color:red;"}
Errors On Form
%ul
- for error in @errors
%li= error
.d-flex.justify-content-center
.login-form
%p.login-input-title Username or Email
= text_field 'user', 'username', class: "login-input email-input", placeholder: "Enter your password"
%p.login-input-title Password
= password_field 'user','password', :autocomplete => "off", class: "login-input password-input", placeholder: "Enter your password"
%a.login-forgot-password{:href => "/lost_pass"}
%p Forgot password?
%input.login-button{"data-disable-with" => "Login", :name => "commit", :type => "submit", :value => "Login"}/
%p.dont-have-account
Don't have an account?
%a.text-decoration-none{:href => new_user_path} Register

0 comments on commit eb9bb78

Please sign in to comment.