Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add standalone screen for changing library systems. Add logout. Style…

…/layout tweaks.
  • Loading branch information...
commit 546565499cc046bc3f7023362bff7399038f6ce2 1 parent f17551d
Thomas Mayfield authored
View
4 TODO.txt
@@ -1,10 +1,6 @@
== For Release ==
-Pick branches
-Styling on system picker
Better logout / session expiration
-Tests for syncing between two systems
Don't use User#updated_at for last sync time
-BPL seachbot
== Later ==
Pick custom shelves (but default to to-read)
View
7 app/assets/stylesheets/style.sass
@@ -118,6 +118,8 @@ h5
.branches-part
width: 210px
float: left
+ label
+ margin-top: 3px
.login
input
@@ -163,3 +165,8 @@ h5
margin:
left: 15px
bottom: 8px
+.nav
+ .divider
+ margin:
+ left: 6px
+ right: 6px
View
8 app/controllers/users_controller.rb
@@ -40,6 +40,14 @@ def login
end
end
+ def logout
+ session[:user_id] = nil
+ redirect_to '/'
+ end
+
+ def library_systems
+ end
+
def save_library_systems
@user.library_systems.clear
if params[:systems]
View
28 app/views/books/_books_header.html.haml
@@ -1,12 +1,18 @@
- at = @location ? "available now at #{@location.name}" : "available system-wide"
-%p Showing books from your to-read list #{at}. This list was last updated by the gruff-but-friendly robot army #{time_ago_in_words @user.updated_at} ago.
-.pagination
- = will_paginate @books
-%p
- Pick a branch to filter by:
- %select#locations
- %option{:value => books_url, :selected => (!@location) } All Locations
- - @locations.each do |loc|
- %option{:value => location_url(loc), :selected => (@location ? @location.id == loc.id : false) }= loc.name
- %p
- %a{:href => user_locations_url} Change which branches to show by default
+.book
+ %p Showing books from your to-read list #{at}. This list was last updated by the gruff-but-friendly robot army #{time_ago_in_words @user.updated_at} ago.
+ %p.nav
+ = link_to 'Change which branches to show by default', user_locations_url
+ %span.divider= " | "
+ = link_to "Change Library Systems", user_library_systems_url
+ %span.divider= " | "
+ = link_to 'Logout', logout_url
+.book
+ .pagination
+ = will_paginate @books
+ .location-filter
+ Pick a branch to filter by:
+ %select#locations
+ %option{:value => books_url, :selected => (!@location) } All Locations
+ - @locations.each do |loc|
+ %option{:value => location_url(loc), :selected => (@location ? @location.id == loc.id : false) }= loc.name
View
3  app/views/books/index.html.haml
@@ -6,8 +6,7 @@
%h2 Thanks for signing up!
%p Our army of gruff-but-friendly robots is checking your to-read list against your library's records. Check back in a few minutes!
- else
- .book
- = render :partial => 'books_header'
+ = render :partial => 'books_header'
- @books.each do |book|
.book.book-result
%h2
View
3  app/views/locations/show.html.haml
@@ -1,5 +1,4 @@
-.book
- = render :partial => 'books/books_header'
+= render :partial => 'books/books_header'
- @books.each do |book|
.book.book-result
%h2
View
2  app/views/users/_choose_library_system.html.haml
@@ -4,6 +4,6 @@
= form_tag :controller => :users, :action => :save_library_systems do
- LibrarySystem.all.each do |system|
.check-box-container
- = check_box_tag("systems[#{system.id}]")
+ = check_box_tag "systems[#{system.id}]", 1, @user.library_systems.member?(system)
= label_tag "systems[#{system.id}]", system.name
= submit_tag "Save"
View
2  config/routes.rb
@@ -1,7 +1,9 @@
Minuteman::Application.routes.draw do
match '/' => 'welcome#index', :as => :welcome
match 'login' => 'users#login', :as => :login
+ match 'logout' => 'users#logout', :as => :logout
match 'signup' => 'users#signup', :as => :signup
+ match 'library_systems' => 'users#library_systems', :as => :user_library_systems
match 'save_library_systems' => 'users#save_library_systems', :as => :save_library_systems
match '/user/locations' => 'users#locations', :as => :user_locations
match 'save_locations' => 'users#save_locations', :as => :save_locations
Please sign in to comment.
Something went wrong with that request. Please try again.