Skip to content

Commit

Permalink
specify authentication (#57)
Browse files Browse the repository at this point in the history
as well as some visual styling changes
  • Loading branch information
kristinmerbach authored Oct 28, 2021
1 parent 8504337 commit 1e0958c
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 13 deletions.
11 changes: 11 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$primary: #215d91;
$half: lighten( $primary, 60% );
@import "bootstrap";

kbd {
Expand All @@ -24,3 +26,12 @@ kbd {
width: 100%;
word-wrap: break-word;
}

main {
margin-bottom: 5em;
}

footer {
background: $half;
}

1 change: 1 addition & 0 deletions app/controllers/aces/inbound_transfers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Aces
# Transfers from an outside source coming into Enroll
class InboundTransfersController < ActionController::Base
before_action :authenticate_user!
def show
@transfer = Aces::InboundTransfer.find(params[:id])
@failure_status = @transfer.failure.nil?
Expand Down
1 change: 1 addition & 0 deletions app/controllers/aces/transfers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Aces
# Transfers from Enroll to outside agency
class TransfersController < ActionController::Base
before_action :authenticate_user!
def show
@transfer = Aces::Transfer.find(params[:id])
@failure_status = @transfer.failure.nil?
Expand Down
1 change: 0 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# frozen_string_literal: true

class ApplicationController < ActionController::Base
before_action :authenticate_user!
end
1 change: 1 addition & 0 deletions app/controllers/reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# ReportsController provides API access to reports
class ReportsController < ApplicationController
before_action :authenticate_user!

def events
@start_on = start_on || session[:start] || Date.today
Expand Down
4 changes: 2 additions & 2 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</div>
<% end %>

<div class="actions">
<%= f.submit "Log in" %>
<div class="actions mb-3">
<%= f.submit "Log in", class: 'btn btn-primary mt-3' %>
</div>
<% end %>

Expand Down
16 changes: 7 additions & 9 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</head>

<body>
<header class="navbar navbar-expand-lg navbar-dark bg-dark mb-3">
<header class="navbar navbar-expand-lg navbar-dark bg-primary mb-3">
<nav class="container">
<div class="" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
Expand Down Expand Up @@ -42,7 +42,7 @@
<a class="nav-link" href="/reports/mec_checks">MEC Checks</a>
</li>
<% end %>
<% end %>
<% end %>
</ul>
</div>
</nav>
Expand All @@ -60,12 +60,10 @@
<% end %>
<%= yield %>
</main>

<% if user_signed_in? %>
<footer class="container border-top mt-3 p-1 d-flex justify-content-center">
<%= button_to "logout", destroy_user_session_path, method: :delete, class: 'btn btn-dark' %>
</footer>
<% end %>

<footer class="footer border-top border-primary mt-3 p-2 fixed-bottom">
<div class="container">
<%= button_to "logout", destroy_user_session_path, method: :delete, class: 'btn btn-secondary' if user_signed_in? %>
</div>
</footer>
</body>
</html>
4 changes: 3 additions & 1 deletion app/views/reports/_date_range.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<div class="mt-2 mb-3">
<label for="start_on">Start On:</label>
<input type="date" id="start_on" name="start_on" value="<%= @start_on %>" data-session="<%= session_name %>start" data-controller="report" data-action="report#change_date">
<label for="end_on" class="ms-2">End On:</label>
<input type="date" id="end_on" name="end_on" value="<%= @end_on %>" data-session="<%= session_name %>end" data-controller="report" data-action="report#change_date"></input>
<p class="d-inline ms-1"><%= "as of #{Time.current.to_formatted_s(:time)} UTC" if @end_on.today? %></p>
<p class="d-inline ms-1"><%= "as of #{Time.current.to_formatted_s(:time)} UTC" if @end_on.today? %></p>
</div>

0 comments on commit 1e0958c

Please sign in to comment.