parent
15ecf1db0d
commit
504bf8bc57
@ -0,0 +1,44 @@
|
||||
class SqmApplicationController < ActionController::Base
|
||||
protect_from_forgery with: :exception, prepend: true
|
||||
layout "sqm/application"
|
||||
before_action :authenticate_district
|
||||
before_action :set_schools_and_districts
|
||||
|
||||
private
|
||||
|
||||
attr_reader :academic_year
|
||||
|
||||
def authenticate_district
|
||||
authenticate(district.name.downcase, "#{district.name.downcase}!")
|
||||
end
|
||||
|
||||
def set_schools_and_districts
|
||||
@schools = School.where(district: district).sort_by(&:name)
|
||||
@districts = District.all.sort_by(&:name)
|
||||
@academic_year ||= AcademicYear.find_by_range params[:year]
|
||||
end
|
||||
|
||||
def district
|
||||
@district ||= District.find_by_slug district_slug
|
||||
end
|
||||
|
||||
def school
|
||||
@school ||= School.find_by_slug school_slug
|
||||
end
|
||||
|
||||
def district_slug
|
||||
params[:district_id]
|
||||
end
|
||||
|
||||
def school_slug
|
||||
params[:school_id]
|
||||
end
|
||||
|
||||
def authenticate(username, password)
|
||||
return true if username == "boston"
|
||||
authenticate_or_request_with_http_basic do |u, p|
|
||||
u == username && p == password
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@ -1,35 +1,14 @@
|
||||
<div class="fdr fjb fac">
|
||||
<h2 class="h1">Areas Of Interest</h2>
|
||||
<div class="fdr">
|
||||
<select class="ml-3 custom-select-lg" name="academic-year">
|
||||
<option value="<%= @academic_year %>" selected><%= format_academic_year(@academic_year) %></option>
|
||||
</select>
|
||||
<% content_for :navigation do %>
|
||||
<h2 class="h1 color-white">Areas Of Interest</h2>
|
||||
<% end %>
|
||||
|
||||
<select id="select-district" class="ml-3 custom-select-lg" name="district">
|
||||
<% @districts.each do |district| %>
|
||||
<option class="district-options" value="<%= district.slug %>" <%= @district.slug == district.slug ? "selected" : nil %>>
|
||||
<%= district.name %>
|
||||
</option>
|
||||
<% end %>
|
||||
</select>
|
||||
|
||||
<select id="select-school" class="ml-3 custom-select-lg" name="school">
|
||||
<% @schools.each do |school| %>
|
||||
<option class="school-options" value="<%= school.slug %>" <%= @school.slug == school.slug ? "selected" : nil %> >
|
||||
<%= school.name %>
|
||||
</option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-beige mt-4 p-5">
|
||||
<div class="bg-color-beige mt-4 p-5">
|
||||
|
||||
<div>
|
||||
<h2 class="h1 color-red">Distance from benchmark</h2>
|
||||
<p class="body-large">This graph shows how much a score is above or below the benchmark of any given scale.</p>
|
||||
</div>
|
||||
|
||||
<%= render partial: "variance_graph", locals: { presenters: @measure_graph_row_presenters } %>
|
||||
<%= render partial: "variance_graph", locals: { presenters: @presenters } %>
|
||||
|
||||
</div>
|
||||
|
||||
@ -1,7 +1,47 @@
|
||||
<header class="row py-4 align-items-center">
|
||||
<div class="col">
|
||||
<%= link_to image_tag('logo.png', class: 'height-56'), root_path %>
|
||||
<a class="h3" href="/districts/<%= @district.slug %>/schools/<%= @school.slug %>/dashboard?year=2020-21">Dashboard</a>
|
||||
<a class="h3" href="/districts/<%= @district.slug %>/schools/<%= @school.slug %>/browse/teachers-and-leadership?year=2020-21">Browse</a>
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="row py-4 justify-content-between align-items-center">
|
||||
<div class="col d-flex justify-content-start align-items-center">
|
||||
<p class="me-6"><%= link_to image_tag('logo.png', class: 'height-56'), root_path %></p>
|
||||
<p class="me-4"><a class="h3" href="/districts/<%= @district.slug %>/schools/<%= @school.slug %>/dashboard?year=2020-21">Dashboard</a></p>
|
||||
<p><a class="h3" href="/districts/<%= @district.slug %>/schools/<%= @school.slug %>/browse/teachers-and-leadership?year=2020-21">Browse</a></p>
|
||||
</div>
|
||||
|
||||
<div class="col d-flex justify-content-end">
|
||||
<select id="select-district" class="form-select" name="district">
|
||||
<% @districts.each do |district| %>
|
||||
<option class="district-options" value="<%= district.slug %>" <%= @district.slug == district.slug ? "selected" : nil %>>
|
||||
<%= district.name %>
|
||||
</option>
|
||||
<% end %>
|
||||
</select>
|
||||
|
||||
<select id="select-school" class="ms-3 form-select" name="school">
|
||||
<% @schools.each do |school| %>
|
||||
<option class="school-options" value="<%= school.slug %>" <%= @school.slug == school.slug ? "selected" : nil %> >
|
||||
<%= school.name %>
|
||||
</option>
|
||||
<% end %>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-color-blue">
|
||||
<div class="container">
|
||||
<div class="row py-4 justify-content-between align-items-center">
|
||||
<div class="col">
|
||||
<% if content_for?(:navigation) %>
|
||||
<%= yield(:navigation) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<select class="form-select" name="academic-year">
|
||||
<option value="<%= @academic_year %>" selected><%= format_academic_year(@academic_year) %></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Loading…
Reference in new issue