official_module/app/views/admin/official_module/set_master_key.html.erb

37 lines
1.9 KiB
Plaintext

<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/wrap-nav"%>
<%= stylesheet_link_tag "lib/main-forms"%>
<%= stylesheet_link_tag "lib/fileupload"%>
<%= stylesheet_link_tag "lib/togglebox"%>
<% end %>
<%= form_for @master_password, :url => {:action => "update_master_password"}, :method => "patch", :html => {:class => "form-horizontal main-forms"} do |f| %>
<fieldset>
<!-- Input Area -->
<div class="input-area">
<div class="control-group">
<div class="controls">
<% if @master_password.password_digest.nil? %>
<div class="alert alert-error" style="display:inline;"><strong>No Password has been set. Please set a new password immediately!!!</strong></div>
<% else %>
<% days = @master_password.changed_days_ago %>
<% if days > 15 %>
<div class="alert alert-error" style="display:inline;"><strong>Its been <%= days %> days since the master password has been changed. Please set a new password immediately!!!</strong></div>
<% else %>
<div class="alert alert-success" style="display:inline;"><strong>Its been <%= days %> day<%= days > 1 ? "s" : "" %> since the master password has been changed.</strong></div>
<% end %>
<% end %>
</div>
</div>
<div class="control-group">
<label class="control-label muted"><%= t 'master_key' %></label>
<div class="controls">
<%= f.password_field :password, :class=>"input-large", :autocomplete=>"off" %>
</div>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions" style="background: none;">
<%= f.submit "Update", :class => "btn btn-primary" %>
</div>
</fieldset>
<% end %>