forked from multiscan/thot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
88 changed files
with
1,392 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,6 @@ gem 'thin' | |
# To use debugger | ||
# gem 'debugger' | ||
|
||
gem 'memoist' | ||
gem 'will_paginate', '~> 3.0' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
Namespaces: | ||
|
||
There's no real "Rails way" for admin interfaces, actually - you can find every possible solution in a number of applications. DHH has implied that he prefers namespaces (with HTTP Basic authentication), but that has remained a simple implication and not one of the official Rails Opinions. | ||
|
||
That said, I've found good success with that approach lately (namespacing + HTTP Basic). It looks like this: | ||
|
||
routes.rb: | ||
|
||
map.namespace :admin do |admin| | ||
admin.resources :users | ||
admin.resources :posts | ||
end | ||
admin/users_controller.rb: | ||
|
||
class Admin::UsersController < ApplicationController | ||
before_filter :admin_required | ||
# ... | ||
end | ||
application.rb | ||
|
||
class ApplicationController < ActionController::Base | ||
# ... | ||
|
||
protected | ||
def admin_required | ||
authenticate_or_request_with_http_basic do |user_name, password| | ||
user_name == 'admin' && password == 's3cr3t' | ||
end if RAILS_ENV == 'production' || params[:admin_http] | ||
end | ||
end | ||
|
||
|
||
|
||
|
||
Generations | ||
always appended | ||
rails generate ... --no-controller-specs --no-view-specs --no-helper-specs --skip-stylesheets --skip-javascripts --skip-helpers | ||
resource lab | ||
name:string nick:string | ||
resource location | ||
name:string | ||
resource publisher | ||
name:string | ||
resource book | ||
title:string author:string editor:string call1:string | ||
call2:string call3:string call4:string collation:string | ||
isbn:string edition:string publisher:reference collection:string | ||
language:string abstract:text toc:text idx:text notes:text | ||
publication_year:integer price:float currency:string | ||
resource item | ||
lab:reference room:reference user:reference inv:integer | ||
status:string price:float currency:string inventoriable:reference | ||
inventoriable_type:string | ||
resource borrowing | ||
user:reference item:reference return_date:date | ||
|
||
|
||
|
||
Library of Congress Query | ||
-------------------------- | ||
http://www.loc.gov/standards/sru/specs/search-retrieve.html | ||
http://www.loc.gov/standards/sru/resources/schemas.html | ||
|
||
exemple: | ||
http://z3950.loc.gov:7090/voyager?version=1.1&operation=searchRetrieve&query=bath.isbn%3D<ISBN>&maximumRecords=1&recordSchema=mods | ||
|
||
|
||
|
||
a scuola ai buoni un premio, ai cattivi la punizione | ||
ma in seguito nella vita è meno chiara la divisione | ||
Giorgio Gaber | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
class BooksController < ApplicationController | ||
# GET /books | ||
# GET /books.json | ||
def index | ||
@books = Book.all | ||
|
||
respond_to do |format| | ||
format.html # index.html.erb | ||
format.json { render json: @books } | ||
end | ||
end | ||
|
||
# GET /books/1 | ||
# GET /books/1.json | ||
def show | ||
@book = Book.find(params[:id]) | ||
|
||
respond_to do |format| | ||
format.html # show.html.erb | ||
format.json { render json: @book } | ||
end | ||
end | ||
|
||
# GET /books/new | ||
# GET /books/new.json | ||
def new | ||
@book = Book.new | ||
|
||
respond_to do |format| | ||
format.html # new.html.erb | ||
format.json { render json: @book } | ||
end | ||
end | ||
|
||
# GET /books/1/edit | ||
def edit | ||
@book = Book.find(params[:id]) | ||
end | ||
|
||
# POST /books | ||
# POST /books.json | ||
def create | ||
@book = Book.new(params[:book]) | ||
|
||
respond_to do |format| | ||
if @book.save | ||
format.html { redirect_to @book, notice: 'Book was successfully created.' } | ||
format.json { render json: @book, status: :created, location: @book } | ||
else | ||
format.html { render action: "new" } | ||
format.json { render json: @book.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PUT /books/1 | ||
# PUT /books/1.json | ||
def update | ||
@book = Book.find(params[:id]) | ||
|
||
respond_to do |format| | ||
if @book.update_attributes(params[:book]) | ||
format.html { redirect_to @book, notice: 'Book was successfully updated.' } | ||
format.json { head :no_content } | ||
else | ||
format.html { render action: "edit" } | ||
format.json { render json: @book.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /books/1 | ||
# DELETE /books/1.json | ||
def destroy | ||
@book = Book.find(params[:id]) | ||
@book.destroy | ||
|
||
respond_to do |format| | ||
format.html { redirect_to books_url } | ||
format.json { head :no_content } | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class BorrowingsController < ApplicationController | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class DbController < ApplicationController | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class DegIsbnsController < ApplicationController | ||
def index | ||
@degisbns=DegIsbn.order("count DESC").paginate(:page=>params[:page], :per_page=>50) | ||
end | ||
|
||
# GET /isbn_dedup/1 | ||
def show | ||
@isbn=DegIsbn.find(params["id"]) | ||
@books=@isbn.books | ||
end | ||
|
||
# GET /isbn_dedup/1/edit | ||
def edit | ||
@isbn=DegIsbn.find(params["id"]) | ||
@books=@isbn.books | ||
end | ||
|
||
def update | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class IsbnDedupController < ApplicationController | ||
|
||
def index | ||
@degisbns=DegIsbn.order("count ASC") | ||
end | ||
|
||
# GET /isbn_dedup/1 | ||
def edit | ||
end | ||
|
||
def update | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class ItemsController < ApplicationController | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class LabsController < ApplicationController | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class LocationsController < ApplicationController | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class PublishersController < ApplicationController | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
module ApplicationHelper | ||
def long_text(t) | ||
t.gsub("\n", "<br/>").gsub("\t", "<span class='spacer'> </span>").html_safe; | ||
end | ||
|
||
# def item_status(item) | ||
# item.user? ? | ||
# case item.user.name | ||
# when "Missing " | ||
# "missing" | ||
# when "mistery" | ||
# "mistery" | ||
# end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module BooksHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module BorrowingsHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module DbHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module DegIsbnsHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module IsbnDedupHelper | ||
end |
Oops, something went wrong.