Skip to content

Commit

Permalink
Added search form for user details + documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
multiscan committed Aug 23, 2013
1 parent f79966a commit ca65679
Show file tree
Hide file tree
Showing 15 changed files with 176 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ gem "rolify", ">= 3.2.0"
# --- app configuration: config/application.yml
gem "figaro", ">= 0.6.0"

# --- static pages
gem 'high_voltage'

# TODO: re-enable autocomplete when a rails4 compatible version is out
# gem 'rails3-jquery-autocomplete', github: 'francisd/rails3-jquery-autocomplete'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ GEM
haml (>= 3.1, < 4.1)
railties (>= 3.1, < 4.1)
hashery (2.1.0)
high_voltage (1.2.4)
highline (1.6.19)
hike (1.2.3)
i18n (0.6.4)
Expand Down Expand Up @@ -239,6 +240,7 @@ DEPENDENCIES
figaro (>= 0.6.0)
gon
haml-rails (~> 0.4)
high_voltage
jquery-rails
jquery-ui-rails
memoist
Expand Down
6 changes: 6 additions & 0 deletions NOTES
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
- sort labels by call number or shelf
-




document ready: just define a function when_ready() wherever is needed. It will be called from the main application.js


Expand Down
Binary file added app/assets/images/docs/home_full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/docs/quick_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/docs/user_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/docs/user_view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
//= require jquery.ui.selectable
//= require bootstrap
//= require bootstrap-datepicker
//= require bootstrap-affix
//= require jquery.tablesorter
//= require thot
//= require barcode_scanner
Expand Down
74 changes: 74 additions & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,77 @@ ul.goods {
background-color: #ddd;
}
}


#introcarousel {
background-color: #333;
}



/* docs */
.bs-docs-sidenav {
width: 228px;
margin: 30px 0 0;
padding: 0;
background-color: #fff;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 1px 4px rgba(0,0,0,.065);
-moz-box-shadow: 0 1px 4px rgba(0,0,0,.065);
box-shadow: 0 1px 4px rgba(0,0,0,.065);
}
.bs-docs-sidenav > li > a {
display: block;
width: 190px \9;
margin: 0 0 -1px;
padding: 8px 14px;
border: 1px solid #e5e5e5;
}
.bs-docs-sidenav > li:first-child > a {
-webkit-border-radius: 6px 6px 0 0;
-moz-border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
}
.bs-docs-sidenav > li:last-child > a {
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
}
.bs-docs-sidenav > .active > a {
position: relative;
z-index: 2;
padding: 9px 15px;
border: 0;
text-shadow: 0 1px 0 rgba(0,0,0,.15);
-webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
-moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
}
/* Chevrons */
.bs-docs-sidenav .icon-chevron-right {
float: right;
margin-top: 2px;
margin-right: -6px;
opacity: .25;
}
.bs-docs-sidenav > li > a:hover {
background-color: #f5f5f5;
}
.bs-docs-sidenav a:hover .icon-chevron-right {
opacity: .5;
}
.bs-docs-sidenav .active .icon-chevron-right,
.bs-docs-sidenav .active a:hover .icon-chevron-right {
background-image: url(../img/glyphicons-halflings-white.png);
opacity: 1;
}
.bs-docs-sidenav.affix {
top: 40px;
}
.bs-docs-sidenav.affix-bottom {
position: absolute;
top: auto;
bottom: 270px;
}
9 changes: 9 additions & 0 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ def show
end
end

# GET /[email protected]
def index
if params[:email] && u=User.where(:email => params[:email]).first
redirect_to nebis_path(u.nebis)
else
redirect_to root_path
end
end

# # GET /users
# # GET /users.json
# def index
Expand Down
68 changes: 68 additions & 0 deletions app/views/docs/user_intro.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.container
%row
.span3
%ul{class: "nav nav-list bs-docs-sidenav affix-bottom", data: {spy: "affix"}}
%li.nav-header List Header
%li
%a{href: '#byImages'}
%i.icon-shevron-right
Gallery
%li
%a{href: '#newUser'}
%i.icon-shevron-right
Profile
.span8
%section{id: "byImages"}
.page-header
%h2 Thot by images
#introcarousel{class: "carousel slide", data: {interval: ""}}
%ol{class: "carousel-indicators"}
%li{:data => {"target" => "#introcarousel", "slide-to" => "0"}, :class => "active" }
%li{:data => {"target" => "#introcarousel", "slide-to" => "1"} }
%div{:class => "carousel-inner"}
.item.active
=image_tag image_path("docs/home_full.png") #, size: "367x143"
.carousel-caption
%h4 The main search form
%p
Fill the form fields with informations about the book your are looking for and click on the
%em Go Search! button
.item
=image_tag image_path("docs/quick_search.png")
.carousel-caption
%h4 Quick search form
%p Use the quick search field that is always visible for searching books by author, editor, or title.
.item
=image_tag image_path("docs/user_login.png")
.carousel-caption
%h4 Searching a user by email
%p
Click the
%em User
link and enter you e-mail address in the field for obtaining the
%b user details view.
In alternative, you can scan your NEBIS code with the barcode scanner.

.item
=image_tag image_path("docs/user_view.png")
.carousel-caption
%h4 User Details View
%p
To borrow another book just enter its inventory number in the field on the top right of the page,
or scan the book's barcode.
To return a book, click on the
%em return
link, or scann the book's barcode.


%a{class: "carousel-control left", href: "#introcarousel", data: {slide: "prev"}} &lsaquo;
%a{class: "carousel-control right", href: "#introcarousel", data: {slide: "next"}} &rsaquo;

%section{id: "newUser"}
.page-header
%h2 New user?
%p If you have never used thot, please ask the library manager to create an account for you.
.alert
Please
%strong do not take any book out of the library
without #{link_to "checking it out", "#checkout"} first.
6 changes: 5 additions & 1 deletion app/views/layouts/_navigation.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
-else
%li= link_to('Admin login', new_admin_session_path)
-#%li= link_to('Sign up', new_admin_registration_path)

%li=link_to("|", "#")
%li
%a{href: "#", class: "on_loan_popover", data: {html: "true", placement: "bottom", title: "Enter e-mail for user page", content: '<div><form action="/users" class="form-inline" method="get"><input id="email_login" class="input-large" name="email" type="text" placeholder="[email protected]"/></form></div>'}}
%i.icon-user
User
=form_tag books_path, method: :get, :class=>"navbar-search pull-right" do
=text_field_tag :search, params[:search], :class=>"search-query", :placeholder=> "Quick Search"
Expand Down
3 changes: 3 additions & 0 deletions app/views/layouts/_user_by_email.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
= form_tag(users_path, method: :get, class: "form-inline", placeholder: "e-mail") do
=text_field_tag :search, html: {class: "search-query", placeholder: "[email protected]"}
%button{type: "submit", class: "btn"} search user
5 changes: 5 additions & 0 deletions config/initializers/high_voltage.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# HighVoltage.route_drawer = HighVoltage::RouteDrawers::Root
# HighVoltage.routes = false
# HighVoltage.action_caching = true
# HighVoltage.page_caching = true
HighVoltage.content_path = 'docs/'
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
end

# devise_for :users
resources :users, :only => [:show]
resources :users, :only => [:show, :index]
namespace :nebis do
get 'extend'
end
Expand Down

0 comments on commit ca65679

Please sign in to comment.