How to shows popup before admin login in Active Admin gem

2 Answers

0
Sandip Bhowmick On Best Solutions
My page is look like this 
<head>  
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<div id="login">
  <h2><%= title "#{render_or_call_method_or_proc_on(self, active_admin_application.site_title)} #{t('active_admin.devise.login.title')}" %></h2>

  <% scope = Devise::Mapping.find_scope!(resource_name) %>
  <%= active_admin_form_for(resource, as: resource_name, url: send(:"#{scope}_session_path"), html: { id: "session_new" }) do |f|
    f.inputs do
      resource.class.authentication_keys.each_with_index { |key, index|
        f.input key, label: t("active_admin.devise.#{key}.title"), input_html: { autofocus: index.zero? }
      }
      f.input :password, label: t('active_admin.devise.password.title')
      f.input :remember_me, label: t('active_admin.devise.login.remember_me'), as: :boolean if devise_mapping.rememberable?
    end
    f.actions do
      f.action :submit, label: t('active_admin.devise.login.submit'), button_html: { value: t('active_admin.devise.login.submit') }
    end
  end
  %>

  <%= render partial: "active_admin/devise/shared/links" %>

<div class="container"> 
  <!-- Trigger the modal with a button -->


  <!-- Modal -->
  <div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog">

      <!-- Modal content-->
      <div class="modal-content" style= "margin-top: 146px";>
        <div class="modal-header"><strong style="font-size: 20px;">Notice</strong>
          <button type="button" class="close" data-dismiss="modal">&times;</button>

        </div>
        <div class="modal-body">
          <p><strong style="font-size: 14px;">This website is under copyright  Pvt. Ltd.</strong><br>
          <strong style="font-size: 14px;">Illegal access is not permitted,<br>
          Please contact us at below contact options for any enquiry.<br></strong></p>
          <i class="fa fa-phone-square" aria-hidden="true" style ="font-size: 20px;"></i>&nbsp;<strong style="font-size: 14px;"><br>
          <i class="fa fa-whatsapp" aria-hidden="true" style ="font-size: 20px;" ></i>&nbsp;<br>
          <%= image_tag "favicon.ico", :class => "byicon" %> </strong>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        </div>
      </div>

    </div>
  </div>

</div>
</div>
1
Piers C On

If you just have static content then you can copy and customize app/views/active_admin/devise/sessions/new.erb. If the content is dynamic you may need to override ActiveAdmin::Devise::SessionsController or use a client side workaround like AJAX or an iframe.