Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/views/application/forbidden.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% content_for(:page_title, 'Forbidden') %>
<% provide :title, 'Forbidden' %>

<h1>Forbidden</h1>
<h1><%= yield :title %></h1>

<p><%= exception.message %></p>
3 changes: 2 additions & 1 deletion app/views/application/standard_error.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<%= stylesheet_link_tag 'application', media: 'all' %>
<% provide :title, 'Internal Server Error' %>

<h1>Internal Server Error</h1>
<h1><%= yield :title %></h1>

<p>An internal error occurred.</p>
4 changes: 3 additions & 1 deletion app/views/forms/insert_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h1>Add a lost item</h1>
<% provide :title, 'Add a Lost Item' %>

<h1><%= yield :title %></h1>
<p style="color: #ee0000">* Required</p>

<div style="width: 100%;">
Expand Down
4 changes: 3 additions & 1 deletion app/views/forms/search_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h1>Search for lost items</h1>
<% provide :title, 'Search for Lost Items' %>

<h1><%= yield :title %></h1>
<div style="width: 100%;">
<%= form_with(url: items_path, method: :get, local: true) do |form| %>

Expand Down
6 changes: 4 additions & 2 deletions app/views/home/admin.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<h1>Lost & Found - Administration</h1>
<%# TODO: use link_to %>
<% provide :title, 'Administration' %>

<h1><%= yield :title %></h1>

<div class="nav-link"><%= link_to('Add/Edit Users', admin_users_path) %></div>
<div class="nav-link"><%= link_to('Locations', admin_locations_path) %></div>
<div class="nav-link"><%= link_to('Item Types', admin_item_types_path) %></div>
Expand Down
3 changes: 2 additions & 1 deletion app/views/home/admin_item_types.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<% provide :title, 'Add/Edit Item Types' %>

<h1>Add/Edit Lost & Found Item Types</h1>
<h1><%= yield :title %></h1>
<p style="color: #ee0000">* Required</p>
<div class="mb-4 form-group">
<h2>Add a new Item Type</h2>
Expand Down
3 changes: 2 additions & 1 deletion app/views/home/admin_locations.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<% provide :title, 'Add/Edit Locations' %>

<h1>Add/Edit Lost & Found Locations</h1>
<h1><%= yield :title %></h1>
<p style="color: #ee0000">* Required</p>
<div class="mb-4 form-group">
<h2>Add a new location</h2>
Expand Down
14 changes: 9 additions & 5 deletions app/views/home/admin_purge.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<h1>Enter date (all items found before this date will be deleted)</h1>
<% provide :title, 'Purge Old Items' %>

<h1><%= yield :title %></h1>
<div style="width: 100%;">
<%= form_with(url: purge_items_path, local: true) do |form| %>

<div class="form-group required" style="padding-top: 8px; padding-bottom: 8px;">
<%= form.label(:purge_date, 'Purge date:') %>
<%= form.date_field(:purge_date, required: true) %>
</div>
<fieldset>
<legend>Enter date (all items found before this date will be deleted)</legend>
<div class="form-group required" style="padding-top: 8px; padding-bottom: 8px;">
<%= form.label(:purge_date, 'Purge date:') %>
<%= form.date_field(:purge_date, required: true) %>
</div>
</fieldset>

<div>
<label for="updated_by">Updated by:</label>
Expand Down
3 changes: 2 additions & 1 deletion app/views/home/admin_users.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<% provide :title, 'Add/Edit Users' %>

<h1><%= yield :title %></h1>
<div class="mb-4 form-group">
<h1>Add/Edit Lost & Found Users</h1>
<p style="color: #ee0000">* Required</p>
<h2>Add a new user</h2>
<%= form_with(url: user_insert_path, local: true) do |form| %>
Expand Down
4 changes: 3 additions & 1 deletion app/views/item_types/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h1>Edit item type</h1>
<% provide :title, 'Edit Item Type' %>

<h1><%= yield :title %></h1>
<div class="table mt-5">
<%= form_with(url: item_type_path, method: :put, local: true) do |form| %>
<%# TODO: enforce case-insensitive uniqueness w/o mangling user-entered names %>
Expand Down
2 changes: 2 additions & 0 deletions app/views/item_types/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<% provide :title, 'Item Type Details' %>

<p id="notice"><%= notice %></p>

<p>
Expand Down
3 changes: 2 additions & 1 deletion app/views/items/admin_items.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<% provide :title, 'View All Items' %>

<h1>View all items</h1>
<h1><%= yield :title %></h1>
<%= render template: 'items/index' %>

<%= render template: 'items/claimed_items' %>
2 changes: 2 additions & 0 deletions app/views/items/claimed_items.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<% provide :title, "Claimed#{' and Purged' if @purged} Items" %>

<h1 id="claimed_items_header">Claimed<%= ' and purged' if @purged %> items</h1>

<table id="claimed_items_table" class="table mt-5">
Expand Down
4 changes: 3 additions & 1 deletion app/views/items/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h1>Edit item</h1>
<% provide :title, 'Edit Item' %>

<h1><%= yield :title %></h1>
<p style="color: #ee0000">* Required</p>

<div style="width: 100%;">
Expand Down
4 changes: 3 additions & 1 deletion app/views/items/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h2>Found Items</h2>
<% provide :title, 'Found Items' %>

<h2><%= yield :title %></h2>

<table id="unclaimed_items_table" class="table mt-5">
<thead class="thead-light">
Expand Down
4 changes: 3 additions & 1 deletion app/views/items/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<% provide :title, 'Item Added' %>

<%# TODO: This should be items#show, not items#new %>
<h1>New item added to Lost and Found </h1>
<h1><%= yield :title %> to Lost and Found</h1>
<table class="table mt-5">
<thead class="thead-light">
<tr>
Expand Down
4 changes: 3 additions & 1 deletion app/views/items/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h1>Item history</h1>
<% provide :title, 'Item History' %>

<h1><%= yield :title %></h1>

<h2>Current values</h2>

Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>LostAndFound</title>
<title><%= yield :title %> - Berkeley Library Lost and Found</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all' %>
Expand Down
4 changes: 3 additions & 1 deletion app/views/locations/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h1>Edit location</h1>
<% provide :title, 'Edit Location' %>

<h1><%= yield :title %></h1>
<div class="table mt-5">
<%= form_with(url: location_path, method: :put, local: true) do |form| %>
<%# TODO: enforce case-insensitive uniqueness w/o mangling user-entered names %>
Expand Down
2 changes: 2 additions & 0 deletions app/views/locations/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<% provide :title, 'Location Details' %>

<p id="notice"><%= notice %></p>

<p>
Expand Down
4 changes: 3 additions & 1 deletion app/views/users/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h1>Edit user</h1>
<% provide :title, 'Edit User' %>

<h1><%= yield :title %></h1>
<div class="table mt-5">
<%= form_with(url: user_path, method: :put, local: true) do |form| %>

Expand Down
2 changes: 2 additions & 0 deletions app/views/users/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<% provide :title, 'User Details' %>

<p id="notice"><%= notice %></p>

<p>
Expand Down
8 changes: 4 additions & 4 deletions spec/system/admin_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

describe 'login' do
it 'redirects to the item search page' do
expect(page).to have_content('Search for lost items')
expect(page).to have_content('Search for Lost Items')
end
end

Expand All @@ -23,7 +23,7 @@
end

it 'displays the admin page' do
expect(page).to have_content('Lost & Found - Administration')
expect(page).to have_content('Administration')
admin_links = [
admin_users_path,
admin_locations_path,
Expand All @@ -45,7 +45,7 @@
end

it 'lists users' do
expect(page).to have_content('Add/Edit Lost & Found Users')
expect(page).to have_content('Add/Edit Users')
User.find_each do |u|
row = page.find('tr', text: u.uid)
expect(row).to have_content(u.user_name)
Expand Down Expand Up @@ -203,7 +203,7 @@
edit_link = row.find_link(href: edit_path)
edit_link.click

expect(page).to have_content('Edit user')
expect(page).to have_content('Edit User')

role = 'Staff'
uid = u.uid * 2
Expand Down
4 changes: 2 additions & 2 deletions spec/system/read_only_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

describe 'login' do
it 'redirects to the item search page' do
expect(page).to have_content('Search for lost items')
expect(page).to have_content('Search for Lost Items')
end

# TODO: fix tests so they don't actually redirect to CalNet logout
Expand All @@ -30,7 +30,7 @@
allow_any_instance_of(ApplicationController).to receive(:session_expiration_time).and_return(expiration_time)

visit(search_form_path)
expect(page).not_to have_content('Search for lost items')
expect(page).not_to have_content('Search for Lost Items')
expect(page).to have_content(/logout.*successful/i)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/system/staff_system_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

describe 'login' do
it 'redirects to the item search page' do
expect(page).to have_content('Search for lost items')
expect(page).to have_content('Search for Lost Items')
end
end

Expand Down Expand Up @@ -125,7 +125,7 @@

page.click_link_or_button('Add item')
expect(page).not_to have_content('Internal Server Error')
expect(page).to have_content('item added')
expect(page).to have_content('Item Added')

row = page.find('tr', text: description)
[
Expand Down
2 changes: 1 addition & 1 deletion spec/views/items/edit.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

it 'renders without error' do
render
expect(rendered).to have_content 'Edit item'
expect(rendered).to have_content 'Edit Item'
end

context 'when an item is claimed' do
Expand Down
2 changes: 1 addition & 1 deletion spec/views/items/show.html.erb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

it 'renders without error' do
render
expect(rendered).to have_content 'Item history'
expect(rendered).to have_content 'Item History'
end

context 'without a value for found_by' do
Expand Down