Skip to content

Commit

Permalink
mensaje de mantenimiento
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rabade committed Jul 31, 2014
1 parent 5984f9b commit cec2f6d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/global.css
Expand Up @@ -44,7 +44,7 @@ a:hover, a:active {

/* buttons */

.btn-primary, .btn-default {
.btn-primary, .btn-default, .btn[disabled] {
background-color: #268f8d;
border-color: #268f8d;
text-decoration: none;
Expand Down
21 changes: 18 additions & 3 deletions app/views/info/home.html.erb
Expand Up @@ -25,6 +25,9 @@
<% if params[:plate].present? %>
value="<%= params[:plate] %>"
<% end %>
<% if ENV['VERIFICALO_DISABLE_INFO'] == 'true' %>
disabled="true"
<% end %>
class="form-control input-lg text-center
input-home">
</div>
Expand All @@ -34,12 +37,24 @@
col-xs-12">
<button type="submit" class="btn btn-primary btn-lg
btn-wide input-home"
id="btn-home">Consulta</button>
<% if ENV['VERIFICALO_DISABLE_INFO'] == 'true' %>
disabled="true"
<% end %>
id="btn-home">Consulta</button>
</div>
</div>
<% end %>
<div class="row">
<% if @error %>
<% if ENV['VERIFICALO_DISABLE_INFO'] == 'true' %>
<div class="col-lg-10 col-lg-offset-1
col-xs-12">
<%= icon(:warning) %>
<p class="error"><strong>Vuelve más tarde.</strong></p>
<p class="msg">Dado el éxito de Verifícalo estamos
creciendo la capacidad para ofrecer una respuesta más
rápida a todos nuestros usuarios.</p>
</div>
<% elsif @error %>
<!-- si hay error -->
<% if @error == 'INVALID_PLATE' %>
<div class="col-lg-10 col-lg-offset-1
Expand All @@ -48,7 +63,7 @@
<p class="error"><strong>La placa no es de un auto
particular de la Ciudad de México.</strong></p>
</div>
<% elsif @error.match(/API_(VERIFICACIONES|INFRACCIONES|TENENCIAS)_ERROR/i) %>
<% elsif @error == 'API_TRY_LATER' %>
<div class="col-lg-10 col-lg-offset-1
col-xs-12">
<%= icon(:error) %>
Expand Down
3 changes: 3 additions & 0 deletions config/application.yml.sample
Expand Up @@ -23,3 +23,6 @@ elasticsearch_url: http://localhost:9200

# mailgun
mailgun_campaign: id

# maintenance
disable_info: false
6 changes: 5 additions & 1 deletion lib/vehicle_cdmx.rb
Expand Up @@ -64,7 +64,11 @@ def api
return false
end
unless @api['verificaciones'].is_a?(Array)
@status = 'API_VERIFICACIONES_ERROR'
if @api['verificaciones'] == 'intente_mas_tarde'
@status = 'API_TRY_LATER'
else
@status = 'API_VERIFICACIONES_ERROR'
end
return false
end
unless @api['infracciones'].is_a?(Array)
Expand Down

0 comments on commit cec2f6d

Please sign in to comment.