Skip to content
This repository has been archived by the owner on Apr 5, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasgaspari committed Oct 19, 2016
2 parents 47b0cc2 + 55ca5b2 commit 0bea211
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 44 deletions.
10 changes: 5 additions & 5 deletions app/assets/javascripts/services/validate_form_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var validateFormService = (function(){

document.getElementById('errorCNPJ').style.display = "";
if(valueCNPJ.value == ""){
document.getElementById('errorCNPJ').innerHTML = "O campo é obrigatório!";
document.getElementById('errorCNPJ').innerHTML = "Campo obrigatório!";
validForm[1] = false;
buttonValidForm();
}else if (valueCNPJ.value.length<18) {
Expand All @@ -80,7 +80,7 @@ var validateFormService = (function(){
VMasker(valuePhone).maskPattern("(99)9999-9999");
document.getElementById('errorPhone').style.display = "";
if(valuePhone.value == ""){
document.getElementById('errorPhone').innerHTML = "O campo é obrigatório!";
document.getElementById('errorPhone').innerHTML = "Campo obrigatório!";
validForm[2] = false;
buttonValidForm();
}else if (valuePhone.value.length<13) {
Expand All @@ -106,12 +106,12 @@ var validateFormService = (function(){
document.getElementById('errorEmail').style.display = "";

if (valueEmail.value == "") {
document.getElementById('errorEmail').innerHTML = "O campo é obrigatório!";
document.getElementById('errorEmail').innerHTML = "Campo obrigatório!";
validForm[3] = false;
buttonValidForm();
}
if(!emailValidate && valueEmail.value != ""){
document.getElementById('errorEmail').innerHTML = "E-mail inválido!";
document.getElementById('errorEmail').innerHTML = "e-mail inválido!";
validForm[3] = false;
buttonValidForm();
}else if(emailValidate){
Expand Down Expand Up @@ -165,7 +165,7 @@ var validateFormService = (function(){
validForm[6] = false;
buttonValidForm();
}else if(valuePassword.value.length == 0){
document.getElementById('errorPassword').innerHTML = "O campo senha é obrigatório!";
document.getElementById('errorPassword').innerHTML = "Campo obrigatório!";
validForm[6] = false;
buttonValidForm();
}else{
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/hospitals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.container{
width:1000px;
}
.errorMessage{
.red-text{
color:red;
font-size:8pt;
}
2 changes: 1 addition & 1 deletion app/views/components/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<h2>Modal</h2>

<div class="Button" onclick="Modal.open()">
<div class="Button" onclick="Modal.open('.js-modalConfirmRequest')">
Abrir modal
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/sessions/_new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="Modal js-modal">
<div class="Modal js-modal js-modalLogin">
<div class="Modal-content js-modalContent">
<div class="Modal-header">
<div class="Grid">
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<li>
<%= link_to "Registrar Doador", new_user_blood_donator_registration_path, :class => 'Button Button--small' %>
<%= link_to "Registrar Banco de Sangue", new_user_blood_bank_registration_path, :class => 'Button Button--small' %>
<div class="Button Button--small" onclick="Modal.open()">Login</div>

<div class="Button Button--small" onclick="Modal.open('.js-modalLogin')">Login</div>
</li>
<% end %>
</li>
Expand Down
48 changes: 24 additions & 24 deletions app/views/user_blood_banks/registrations/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<div class="Grid-cell u-desktop-size6of12 u-tablet-size6of12 u-mobile-sizeFull">
<div class="Form-group">

<span class="Form-inputLabel u-size2of12">Nome: </span>
<%= f.text_field :name, class: "js-validateName Form-inputValue u-size10of12" %>
<span id="errorName" style="display:none;" class="errorMessage">O campo é obrigatório!</span>
<span class="Form-inputLabel u-size2of12">Nome<span class="red-text">*</span></span>
<%= f.text_field :name, class: "js-validateName Form-inputValue u-size10of12", placeholder: "Ex: Hospital Carlos Schallenberger" %>
<span id="errorName" style="display:none;" class="red-text">Campo obrigatório!</span>

</div>
</div>
Expand All @@ -40,9 +40,9 @@
<div class="Grid-cell u-desktop-size6of12 u-tablet-size6of12 u-mobile-sizeFull">
<div class="Form-group">

<span class="Form-inputLabel u-size2of12">CPNJ: </span>
<%= f.text_field :cnpj, class: "Form-inputValue u-size10of12 js-validateCNPJ",:maxlength => 18 %>
<span id="errorCNPJ" style="display:none;" class="errorMessage"></span>
<span class="Form-inputLabel u-size2of12">CNPJ<span class="red-text">*</span></span>
<%= f.text_field :cnpj, class: "Form-inputValue u-size10of12 js-validateCNPJ",:maxlength => 18, placeholder: "Digite apenas números" %>
<span id="errorCNPJ" style="display:none;" class="red-text"></span>

</div>
</div>
Expand All @@ -51,60 +51,60 @@
<div class="Grid-cell u-desktop-size6of12 u-tablet-size6of12 u-mobile-sizeFull">
<div class="Form-group">

<span class="Form-inputLabel u-size2of12">Email:</span>
<%= f.text_field :email, class: "Form-inputValue u-size10of12 js-validateEmail" %>
<span id="errorEmail" style="display:none;" class="errorMessage"></span>
<span class="Form-inputLabel u-size2of12">E-mail<span class="red-text">*</span></span>
<%= f.text_field :email, class: "Form-inputValue u-size10of12 js-validateEmail", placeholder: "Ex: [email protected]" %>
<span id="errorEmail" style="display:none;" class="red-text"></span>

</div>
</div>

<div class="Grid-cell u-desktop-size6of12 u-tablet-size6of12 u-mobile-sizeFull">
<div class="Form-group">

<span class="Form-inputLabel u-size2of12">Telefone:</span>
<%= f.text_field :phone, class: "Form-inputValue u-size10of12 js-validatePhone",:maxlength => 13 %>
<span id="errorPhone" style="display:none;" class="errorMessage"></span>
<span class="Form-inputLabel u-size2of12">Telefone<span class="red-text">*</span></span>
<%= f.text_field :phone, class: "Form-inputValue u-size10of12 js-validatePhone",:maxlength => 13, placeholder: "Ex: (51) 9876-5432" %>
<span id="errorPhone" style="display:none;" class="red-text"></span>

</div>
</div>

<div class="Grid-cell u-desktop-size6of12 u-tablet-size6of12 u-mobile-sizeFull">
<div class="Form-group">

<span class="Form-inputLabel u-size2of12">Ramal:</span>
<%= f.text_field :extension, class: "Form-inputValue u-size10of12 js-validateExtension", :maxlength => 4%>
<span id="errorExtension" style="display:none;" class="errorMessage">O campo é obrigatório!</span>
<span class="Form-inputLabel u-size2of12">Ramal</span>
<%= f.text_field :extension, class: "Form-inputValue u-size10of12 js-validateExtension", :maxlength => 4, placeholder: "Ex: 1234"%>
<span id="errorExtension" style="display:none;" class="red-text">Campo obrigatório!</span>

</div>
</div>

<div class="Grid-cell u-desktop-size6of12 u-tablet-size6of12 u-mobile-sizeFull">
<div class="Form-group">

<span class="Form-inputLabel u-size2of12">Endereço:</span>
<%= f.text_field :adress, class: "Form-inputValue u-size10of12 js-validateAddress" %>
<span id="errorAddress" style="display:none;" class="errorMessage">O campo é obrigatório!</span>
<span class="Form-inputLabel u-size2of12">Endereço<span class="red-text">*</span></span>
<%= f.text_field :adress, class: "Form-inputValue u-size10of12 js-validateAddress", placeholder: "Ex: Av. Ipiranga, 6681"%>
<span id="errorAddress" style="display:none;" class="red-text">Campo obrigatório!</span>

</div>
</div>

<div class="Grid-cell u-desktop-size6of12 u-tablet-size6of12 u-mobile-sizeFull">
<div class="Form-group">

<span class="Form-inputLabel u-size2of12">Senha: </span>
<span class="Form-inputLabel u-size2of12">Senha<span class="red-text">*</span></span>
<% if @minimum_password_length %>
<% end %><br />
<%= f.password_field :password, autocomplete: "off", class:"js-validatePassword Form-inputValue u-size10of12" %>
<span id="errorPassword" style="display:none;" class="errorMessage"></span>
<%= f.password_field :password, autocomplete: "off", class:"js-validatePassword Form-inputValue u-size10of12", placeholder: "Senha" %>
<span id="errorPassword" style="display:none;" class="red-text"></span>
</div>
</div>

<div class="Grid-cell u-desktop-size6of12 u-tablet-size6of12 u-mobile-sizeFull">
<div class="Form-group">

<span class="Form-inputLabel u-size2of12">Confirme a senha: </span>
<%= f.password_field :password_confirmation, autocomplete: "off", class:"js-validatePasswordConfirmation Form-inputValue u-size10of12" %>
<span id="errorPasswordConfirmation" style="display:none;" class="errorMessage"></span>
<span class="Form-inputLabel u-size2of12">Confirmar senha<span class="red-text">*</span></span>
<%= f.password_field :password_confirmation, autocomplete: "off", class:"js-validatePasswordConfirmation Form-inputValue u-size10of12", placeholder: "Confirme sua senha" %>
<span id="errorPasswordConfirmation" style="display:none;" class="red-text"></span>

</div>
</div>
Expand Down
20 changes: 10 additions & 10 deletions app/views/user_blood_donators/registrations/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div class="Form-group">
<span class="Form-inputLabel u-size2of12">Nome: </span>
<%= f.text_field :name, class: "Form-inputValue js-validateName u-size10of12" %>
<span id="errorName" style="display:none;" class="errorMessage">O campo é obrigatório</span>
<span id="errorName" style="display:none;" class="red-text">O campo é obrigatório</span>
</div>
</div>

Expand All @@ -41,7 +41,7 @@
<div class="Form-group">
<span class="Form-inputLabel u-size2of12">CPF: </span>
<%= f.text_field :cpf, class: "Form-inputValue js-validateCPF" %>
<span id="errorCPF" style="display:none;" class="errorMessage"></span>
<span id="errorCPF" style="display:none;" class="red-text"></span>
</div>
</div>

Expand All @@ -51,7 +51,7 @@
<div class="Form-group">
<span class="Form-inputLabel u-size2of12">Email: </span>
<%= f.text_field :email, class: "Form-inputValue js-validateEmail" %>
<span id="errorEmail" style="display:none;" class="errorMessage"></span>
<span id="errorEmail" style="display:none;" class="red-text"></span>
</div>
</div>

Expand All @@ -61,7 +61,7 @@
<div class="Form-group">
<span class="Form-inputLabel u-size2of12">Telefone: </span>
<%= f.text_field :phone, class: "Form-inputValue js-validatePhone" %>
<span id="errorPhone" style="display:none;" class="errorMessage"></span>
<span id="errorPhone" style="display:none;" class="red-text"></span>
</div>
</div>

Expand All @@ -72,7 +72,7 @@
<%= f.date_select :date_birth, {order: [:day, :month, :year],
start_year: Date.today.year-16, end_year: Date.today.year-69},
with_css_classes: true, class: "Form-inputValue js-validateDate" %>
<span id="errorDate" style="display:none;" class="errorMessage"></span>
<span id="errorDate" style="display:none;" class="red-text"></span>
</div>
</div>

Expand All @@ -92,7 +92,7 @@
<div class="Form-group">
<span class="Form-inputLabel u-size2of12">Senha: </span>
<%= f.password_field :password, class: "Form-inputValue js-validatePassword" %>
<span id="errorPassword" style="display:none;" class="errorMessage"></span>
<span id="errorPassword" style="display:none;" class="red-text"></span>
</div>
</div>

Expand All @@ -102,7 +102,7 @@
<div class="Form-group">
<span class="Form-inputLabel u-size2of12">Confirmação de senha: </span>
<%= f.password_field :password, class: "Form-inputValue js-validatePasswordConfirmation" %>
<span id="errorPasswordConfirmation" style="display:none;" class="errorMessage"></span>
<span id="errorPasswordConfirmation" style="display:none;" class="red-text"></span>
</div>
</div>

Expand All @@ -114,7 +114,7 @@
<%= f.date_select :last_donation, {order: [:day, :month, :year],
start_year: Date.today.year, end_year: Date.today.year-53},
with_css_classes: true, class: "Form-inputValue js-validateDate", include_blank: true, include_blank: "Não sei" %>
<span id="errorDate" style="display:none;" class="errorMessage"></span>
<span id="errorDate" style="display:none;" class="red-text"></span>
</div>
<div class="Form-group">
<div class="Checkbox">
Expand All @@ -136,7 +136,7 @@
<%= label_tag(:genre, "Masculino") %>
<%= radio_button_tag :genre, "sexo", false, class: "Radio-label js-validateGenre" %>
<%= label_tag(:genre, "Feminino") %>
<span id="errorGenre" style="display:none;" class="errorMessage"></span>
<span id="errorGenre" style="display:none;" class="red-text"></span>
</div>
</div>
</div>
Expand All @@ -160,7 +160,7 @@
</div>
<div class="Checkbox-label">
<%= label_tag(:accept_terms, "Aceito os termos de uso") %>
<span id="errorTerms" style="display:none;" class="errorMessage"></span>
<span id="errorTerms" style="display:none;" class="red-text"></span>
</div>
</div>
</div>
Expand Down

0 comments on commit 0bea211

Please sign in to comment.