├── log └── .gitkeep ├── lib ├── tasks │ ├── .gitkeep │ ├── resque.rake │ └── ebook.rake ├── assets │ └── .gitkeep ├── templates │ └── haml │ │ └── scaffold │ │ └── _form.html.haml ├── devise │ └── custom_failure.rb └── tea_api_config.rb ├── public ├── favicon.ico ├── network_status ├── font-icon │ └── fonts │ │ ├── IcoMoon.eot │ │ ├── IcoMoon.ttf │ │ └── IcoMoon.woff ├── fallback │ └── cover │ │ ├── detail_default.png │ │ └── library_default.png ├── robots.txt ├── 500.html ├── 422.html └── 404.html ├── tmp └── pids │ └── .gitkeep ├── .rspec ├── app ├── mailers │ └── .gitkeep ├── models │ ├── .gitkeep │ ├── bookmark.rb │ ├── bookseller.rb │ ├── synchronizers │ │ └── reading_position.rb │ ├── annotation.rb │ └── admin.rb ├── assets │ ├── images │ │ ├── icon.png │ │ ├── rails.png │ │ ├── shelf.png │ │ ├── ajax-loader.gif │ │ └── default │ │ │ ├── paper.jpg │ │ │ ├── paper.png │ │ │ ├── custom │ │ │ └── logo.png │ │ │ ├── nav │ │ │ ├── bt-home.png │ │ │ ├── bt-catalog.png │ │ │ ├── bt-library.png │ │ │ ├── bt-library-reader.png │ │ │ └── bt-library-reader_hover.png │ │ │ └── stripe_left.png │ ├── fonts │ │ ├── IcoMoon.eot │ │ ├── IcoMoon.ttf │ │ ├── IcoMoon.woff │ │ ├── museo300.otf │ │ ├── museo500.otf │ │ ├── museo700.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ └── fontawesome-webfont.woff │ ├── javascripts │ │ ├── admin │ │ │ ├── boot.js.coffee │ │ │ └── lib.js │ │ ├── misc │ │ │ ├── keycodes.js.coffee │ │ │ ├── gcf.js.coffee │ │ │ ├── appcache_loader.js.coffee │ │ │ └── network_status.js.coffee │ │ ├── models │ │ │ ├── user.js.coffee │ │ │ └── chapter.coffee │ │ ├── backbone_stuff.js.coffee │ │ ├── admin.js │ │ ├── application.js │ │ ├── reader.js │ │ ├── reader_sandbox.js │ │ ├── app_namespace.js.coffee │ │ ├── views │ │ │ ├── ebook_reader_menu.js.coffee │ │ │ ├── help_generic.js.coffee │ │ │ ├── help_library.js.coffee │ │ │ └── ebook_preview.js.coffee │ │ ├── reader │ │ │ └── lib.js │ │ ├── reader_sandbox │ │ │ └── boot.js.coffee │ │ ├── lib.js │ │ └── monocle │ │ │ └── panels │ │ │ └── arrows.js.coffee │ └── stylesheets │ │ ├── _sprites.sass │ │ ├── _init.sass │ │ ├── application.css.sass │ │ ├── reader_sandbox.css.sass │ │ ├── reader.css.sass │ │ ├── _common.sass │ │ └── _main.sass ├── views │ ├── admin │ │ ├── home │ │ │ └── index.html.haml │ │ └── booksellers │ │ │ ├── new.html.haml │ │ │ ├── edit.html.haml │ │ │ ├── _form.html.haml │ │ │ └── show.html.haml │ ├── kaminari │ │ ├── _gap.html.haml │ │ ├── _last_page.html.haml │ │ ├── _first_page.html.haml │ │ ├── _next_page.html.haml │ │ ├── _prev_page.html.haml │ │ ├── _page.html.haml │ │ └── _paginator.html.haml │ ├── ebook │ │ └── epubs │ │ │ ├── new.html.haml │ │ │ ├── edit.html.haml │ │ │ ├── index.html.haml │ │ │ ├── show.html.haml │ │ │ ├── _form.html.haml │ │ │ ├── reader_sandbox.html.haml │ │ │ └── reader.html.haml │ ├── bookmarks │ │ ├── new.html.haml │ │ ├── edit.html.haml │ │ ├── _form.html.haml │ │ ├── show.html.haml │ │ └── index.html.haml │ ├── manifests │ │ ├── loader.html.haml │ │ └── reader.text.haml │ ├── layouts │ │ └── _header.haml │ └── tea_sessions │ │ ├── _links.html.haml │ │ └── new.html.haml ├── controllers │ ├── admin │ │ └── home_controller.rb │ ├── admin_controller.rb │ ├── manifests_controller.rb │ └── ebook │ │ └── epub │ │ ├── chapters_controller.rb │ │ └── components_controller.rb ├── workers │ ├── epub_to_html_worker.rb │ ├── download_ebook_worker.rb │ ├── import_books_worker.rb │ └── extract_epub_worker.rb ├── helpers │ └── application_helper.rb └── uploaders │ └── ebook_uploader.rb ├── vendor ├── plugins │ └── .gitkeep └── assets │ ├── javascripts │ ├── .gitkeep │ └── jquery.hammer.js │ └── stylesheets │ ├── .gitkeep │ └── dragdealer.css ├── examples └── ebooks │ └── .gitkeep ├── config ├── mock_api │ ├── 2 │ │ ├── authentication.json │ │ └── publications.json │ ├── 24 │ │ └── authentication.json │ ├── forbidden.json │ ├── epubs │ │ ├── 123.epub │ │ ├── 124.epub │ │ ├── 125.epub │ │ └── example.epub │ ├── authentication.json │ └── config.yml ├── mongoid │ ├── dev.yml │ ├── jenkins.yml │ ├── staging.yml │ └── development.yml ├── resque-pool.yml ├── fake_api.yml ├── initializers │ ├── _gaston.rb │ ├── redis.rb │ ├── check_session_secret.rb │ ├── mime_types.rb │ ├── wrap_parameters.rb │ ├── session_store.rb │ ├── backtrace_silencers.rb │ └── inflections.rb ├── locales │ ├── activemodel.fr.yml │ └── views.fr.yml ├── environment.rb ├── boot.rb ├── redis.yml ├── thin │ ├── dev.yml │ └── staging.yml └── gaston │ ├── synchronizers.yml │ ├── api.yml │ └── security.yml ├── spec ├── fixtures │ ├── api │ │ ├── authentication_error.json │ │ ├── example.epub │ │ ├── authentication.json │ │ └── publications.json │ └── Dictionnaire des idées reçues.epub ├── fabricators │ ├── admin_fabricator.rb │ ├── ebook_epub_chapter_fabricator.rb │ ├── ebook_epub_component_fabricator.rb │ ├── bookseller_fabricator.rb │ ├── user_fabricator.rb │ └── book_location_fabricator.rb ├── models │ ├── admin_spec.rb │ ├── bookmark_spec.rb │ ├── annotation_spec.rb │ └── ebook │ │ └── epub │ │ ├── component_spec.rb │ │ └── chapter_spec.rb ├── support │ └── controller_macros.rb ├── routing │ ├── manifests_routing_spec.rb │ ├── ebook │ │ └── epub │ │ │ ├── chapters_routing_spec.rb │ │ │ └── components_routing_spec.rb │ └── reading_position_routing_spec.rb ├── javascripts │ ├── helpers │ │ └── jasmine-sinon.js │ ├── spec.js │ ├── support │ │ └── jasmine.yml │ └── factories.js ├── mocks │ ├── user.rb │ └── tea_api_session.rb └── workers │ ├── epub_to_html_worker_spec.rb │ └── extract_epub_worker_spec.rb ├── config.ru ├── tea_api.ru ├── Rakefile ├── script ├── rails ├── vagrant │ ├── addExample.sh │ ├── start.sh │ ├── install.sh │ ├── Vagrantfile_precise.dist │ ├── Vagrantfile_squeeze.dist │ └── install_vagrant_squeeze.sh └── go ├── .go.screenrc ├── LICENSE ├── GPL-3-EXCEPTION ├── .gitignore ├── db └── seeds.rb ├── Gemfile └── Guardfile /log/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/tasks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tmp/pids/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --colour 2 | -------------------------------------------------------------------------------- /app/mailers/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/models/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/plugins/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /examples/ebooks/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/network_status: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/mock_api/forbidden.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors": ["forbidden"] 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/api/authentication_error.json: -------------------------------------------------------------------------------- 1 | { 2 | "errors":["AUTH_ERROR : Utilisateur non valide."] 3 | } 4 | -------------------------------------------------------------------------------- /app/assets/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/icon.png -------------------------------------------------------------------------------- /app/assets/fonts/IcoMoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/fonts/IcoMoon.eot -------------------------------------------------------------------------------- /app/assets/fonts/IcoMoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/fonts/IcoMoon.ttf -------------------------------------------------------------------------------- /app/assets/fonts/IcoMoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/fonts/IcoMoon.woff -------------------------------------------------------------------------------- /app/assets/fonts/museo300.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/fonts/museo300.otf -------------------------------------------------------------------------------- /app/assets/fonts/museo500.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/fonts/museo500.otf -------------------------------------------------------------------------------- /app/assets/fonts/museo700.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/fonts/museo700.otf -------------------------------------------------------------------------------- /app/assets/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/rails.png -------------------------------------------------------------------------------- /app/assets/images/shelf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/shelf.png -------------------------------------------------------------------------------- /config/mock_api/epubs/123.epub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/config/mock_api/epubs/123.epub -------------------------------------------------------------------------------- /config/mock_api/epubs/124.epub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/config/mock_api/epubs/124.epub -------------------------------------------------------------------------------- /config/mock_api/epubs/125.epub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/config/mock_api/epubs/125.epub -------------------------------------------------------------------------------- /spec/fixtures/api/example.epub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/spec/fixtures/api/example.epub -------------------------------------------------------------------------------- /app/assets/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/ajax-loader.gif -------------------------------------------------------------------------------- /config/mock_api/epubs/example.epub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/config/mock_api/epubs/example.epub -------------------------------------------------------------------------------- /public/font-icon/fonts/IcoMoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/public/font-icon/fonts/IcoMoon.eot -------------------------------------------------------------------------------- /public/font-icon/fonts/IcoMoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/public/font-icon/fonts/IcoMoon.ttf -------------------------------------------------------------------------------- /app/assets/images/default/paper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/default/paper.jpg -------------------------------------------------------------------------------- /app/assets/images/default/paper.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/default/paper.png -------------------------------------------------------------------------------- /public/font-icon/fonts/IcoMoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/public/font-icon/fonts/IcoMoon.woff -------------------------------------------------------------------------------- /app/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /app/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /app/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /app/assets/images/default/custom/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/default/custom/logo.png -------------------------------------------------------------------------------- /app/assets/images/default/nav/bt-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/default/nav/bt-home.png -------------------------------------------------------------------------------- /app/assets/images/default/stripe_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/default/stripe_left.png -------------------------------------------------------------------------------- /public/fallback/cover/detail_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/public/fallback/cover/detail_default.png -------------------------------------------------------------------------------- /public/fallback/cover/library_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/public/fallback/cover/library_default.png -------------------------------------------------------------------------------- /app/assets/images/default/nav/bt-catalog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/default/nav/bt-catalog.png -------------------------------------------------------------------------------- /app/assets/images/default/nav/bt-library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/default/nav/bt-library.png -------------------------------------------------------------------------------- /spec/fixtures/Dictionnaire des idées reçues.epub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/spec/fixtures/Dictionnaire des idées reçues.epub -------------------------------------------------------------------------------- /app/assets/images/default/nav/bt-library-reader.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/default/nav/bt-library-reader.png -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Tea::Application 5 | -------------------------------------------------------------------------------- /tea_api.ru: -------------------------------------------------------------------------------- 1 | require 'sinatra' 2 | root = File.dirname(__FILE__) 3 | require File.join(root, 'lib/tea_api') 4 | require File.join(root, 'lib/tea_api_config') 5 | run TeaApi.new 6 | -------------------------------------------------------------------------------- /app/assets/images/default/nav/bt-library-reader_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TEA-ebook/teabook-open-reader/HEAD/app/assets/images/default/nav/bt-library-reader_hover.png -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-Agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env rake 2 | # Add your own tasks in files placed in lib/tasks ending in .rake, 3 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 4 | 5 | require File.expand_path('../config/application', __FILE__) 6 | 7 | Tea::Application.load_tasks 8 | -------------------------------------------------------------------------------- /script/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. 3 | 4 | APP_PATH = File.expand_path('../../config/application', __FILE__) 5 | require File.expand_path('../../config/boot', __FILE__) 6 | require 'rails/commands' 7 | -------------------------------------------------------------------------------- /script/vagrant/addExample.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd teabook 4 | 5 | # import epubs from examples/ebooks 6 | wget -q -O examples/ebooks/progit.epub https://github.s3.amazonaws.com/media/progit.epub 7 | bundle exec rake ebook:import:epub 8 | 9 | cat <:3000 12 | 13 | Enjoy! 14 | EOF 15 | -------------------------------------------------------------------------------- /spec/fixtures/api/authentication.json: -------------------------------------------------------------------------------- 1 | { 2 | "user": { 3 | "id": "johndoe@tea-ebook.com", 4 | "firstname": "John", 5 | "lastname": "Doe", 6 | "birthdate": "1980-07-30T01:00:00+01:00", 7 | "country": "FR", 8 | "bookstore": "tea" 9 | }, 10 | "session":{ 11 | "id": "ec115cd99c07e710413b01bc2799e026", 12 | "expire": 1374329344 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /config/mock_api/2/authentication.json: -------------------------------------------------------------------------------- 1 | { 2 | "user": { 3 | "id": "2", 4 | "email": "test2@example.com", 5 | "firstname": "John", 6 | "lastname": "Doe", 7 | "birthdate": "1980-07-30T01:00:00+01:00", 8 | "country": "FR", 9 | "bookstore": "tea" 10 | }, 11 | "session":{ 12 | "id": "ac115cd99c07e710413b01bc2799e026", 13 | "expire": 1374329344 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /config/mock_api/authentication.json: -------------------------------------------------------------------------------- 1 | { 2 | "user": { 3 | "id": "24", 4 | "email": "johndoe@example.com", 5 | "firstname": "John", 6 | "lastname": "Doe", 7 | "birthdate": "1980-07-30T01:00:00+01:00", 8 | "country": "FR", 9 | "bookstore": "tea" 10 | }, 11 | "session":{ 12 | "id": "ec115cd99c07e710413b01bc2799e026", 13 | "expire": 1374329344 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /config/mock_api/24/authentication.json: -------------------------------------------------------------------------------- 1 | { 2 | "user": { 3 | "id": "24", 4 | "email": "johndoe@example.com", 5 | "firstname": "John", 6 | "lastname": "Doe", 7 | "birthdate": "1980-07-30T01:00:00+01:00", 8 | "country": "FR", 9 | "bookstore": "tea" 10 | }, 11 | "session":{ 12 | "id": "bc115cd99c07e710413b01bc2799e026", 13 | "expire": 1374329344 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /script/vagrant/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd teabook 4 | 5 | # start resque 6 | bundle exec rake resque:pool:start 7 | 8 | # start thin 9 | bundle exec thin start & 10 | 11 | # start fake tea_api 12 | bundle exec shotgun tea_api.ru -p 4567 & 13 | 14 | cat <:3000 21 | 22 | Enjoy! 23 | EOF 24 | -------------------------------------------------------------------------------- /script/vagrant/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd ~ 4 | 5 | gem install bundle 6 | 7 | cd teabook 8 | 9 | bundle install 10 | 11 | # copy default development configuration 12 | cp config/mongoid/development.yml config/mongoid.yml 13 | 14 | # create the default bookseller 15 | bundle exec rake db:seed 16 | 17 | cat <:3000 26 | 27 | Enjoy! 28 | EOF 29 | -------------------------------------------------------------------------------- /script/vagrant/Vagrantfile_precise.dist: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant::Config.run do |config| 5 | config.vm.box = "precise64" 6 | config.vm.box_url = "http://files.vagrantup.com/precise64.box" 7 | # update the ip 8 | config.vm.network :hostonly, "192.168.2.200" 9 | # you can customize the vm configuration, like memory or cpus 10 | config.vm.customize ["modifyvm", :id, "--memory", 1024] 11 | config.vm.share_folder("v-root", "/vagrant", "../../", :nfs => true) 12 | config.vm.provision :shell, :path => "./install_vagrant_precise.sh" 13 | end 14 | -------------------------------------------------------------------------------- /script/vagrant/Vagrantfile_squeeze.dist: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | Vagrant::Config.run do |config| 5 | config.vm.box = "squeeze64" 6 | config.vm.box_url = "http://dl.dropbox.com/u/937870/VMs/squeeze64.box" 7 | # update the ip 8 | config.vm.network :hostonly, "192.168.2.200" 9 | # you can customize the vm configuration, like memory or cpus 10 | config.vm.customize ["modifyvm", :id, "--memory", 1024] 11 | config.vm.share_folder("v-root", "/vagrant", "../../", :nfs => true) 12 | config.vm.provision :shell, :path => "./install_vagrant_squeeze.sh" 13 | end 14 | -------------------------------------------------------------------------------- /vendor/assets/stylesheets/dragdealer.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Dragdealer JS v0.9.5 3 | * http://code.ovidiu.ch/dragdealer-js 4 | * 5 | * Copyright (c) 2010, Ovidiu Chereches 6 | * MIT License 7 | * http://legal.ovidiu.ch/licenses/MIT 8 | */ 9 | 10 | .dragdealer { 11 | position: relative; 12 | height: 30px; 13 | background: #EEE; 14 | } 15 | .dragdealer .handle { 16 | position: absolute; 17 | cursor: pointer; 18 | } 19 | .dragdealer .red-bar { 20 | width: 100px; 21 | height: 30px; 22 | background: #CC0000; 23 | color: #FFF; 24 | line-height: 30px; 25 | text-align: center; 26 | } 27 | .dragdealer .disabled { 28 | background: #898989; 29 | } 30 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

We're sorry, but something went wrong.

23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The change you wanted was rejected.

23 |

Maybe you tried to change something you didn't have access to.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The page you were looking for doesn't exist.

23 |

You may have mistyped the address or the page may have moved.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /vendor/assets/javascripts/jquery.hammer.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Hammer.JS jQuery plugin 3 | * version 0.3 4 | * author: Eight Media 5 | * https://github.com/EightMedia/hammer.js 6 | */ 7 | jQuery.fn.hammer = function(options) 8 | { 9 | return this.each(function() 10 | { 11 | var hammer = new Hammer(this, options); 12 | 13 | var $el = jQuery(this); 14 | $el.data("hammer", hammer); 15 | 16 | var events = ['hold','tap','doubletap','transformstart','transform','transformend','dragstart','drag','dragend','swipe','release']; 17 | 18 | for(var e=0; e 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, version 3.0 of the License. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program. If not, see . 15 | 16 | An additional permission has been granted as a special exception 17 | to the GNU General Public Licence. 18 | You should have received a copy of this exception. If not, see 19 | . -------------------------------------------------------------------------------- /GPL-3-EXCEPTION: -------------------------------------------------------------------------------- 1 | As a special exception to the GNU General Public License (GPL), if you 2 | link or add digital rights managements (DRM) features to the Program, 3 | these features do not by themselves cause the resulting program to be 4 | covered by the GNU General Public License provided that you also meet 5 | all of these conditions: 6 | 7 | a) The DRM features are built in the only purpose of complying with 8 | the requirements of the copyright holders for the external copyrighted 9 | contents wich are shown within The Program. 10 | 11 | b) Either the part of the Program covered by the GNU General Public 12 | License is sufficient to run all the features of the Program or you 13 | propose a such version at no further charge when you convey the 14 | Program. 15 | 16 | You are not required to agree and comply to the two preceding 17 | conditions ; however, only this two conditions allow you to benefit 18 | from the special exception and the additional permission. If part or 19 | all of these conditions is removed as a requirement, the whole 20 | additional permission becomes void and inapplicable. -------------------------------------------------------------------------------- /app/assets/javascripts/admin/boot.js.coffee: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | $(document).ready -> 25 | -------------------------------------------------------------------------------- /spec/fabricators/admin_fabricator.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | Fabricator(:admin) do 25 | end 26 | -------------------------------------------------------------------------------- /config/mongoid/dev.yml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | dev: 25 | host: localhost 26 | database: tea_dev 27 | -------------------------------------------------------------------------------- /config/mongoid/jenkins.yml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | test: 25 | host: localhost 26 | database: tea_test 27 | -------------------------------------------------------------------------------- /app/assets/javascripts/misc/keycodes.js.coffee: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | App.Misc.KeyCodes = 23 | 37: "left" 24 | 39: "right" 25 | -------------------------------------------------------------------------------- /app/assets/javascripts/models/user.js.coffee: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | class App.Models.User extends Backbone.Model 25 | -------------------------------------------------------------------------------- /config/mongoid/staging.yml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | staging: 25 | host: localhost 26 | database: tea_staging 27 | -------------------------------------------------------------------------------- /app/assets/javascripts/backbone_stuff.js.coffee: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | Backbone.Model.prototype.idAttribute = "_id" 25 | -------------------------------------------------------------------------------- /app/assets/javascripts/admin.js: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2012 TEA, the ebook alternative 2 | // 3 | // This file is part of TeaBook Open Reader 4 | // 5 | // This program is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, version 3.0 of the License. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | // 17 | // An additional permission has been granted as a special exception 18 | // to the GNU General Public Licence. 19 | // You should have received a copy of this exception. If not, see 20 | // . 21 | 22 | 23 | 24 | //= require admin/lib 25 | //= require admin/boot 26 | -------------------------------------------------------------------------------- /app/views/admin/home/index.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %h3 Welcome on TEA administration section 25 | -------------------------------------------------------------------------------- /app/assets/javascripts/admin/lib.js: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2012 TEA, the ebook alternative 2 | // 3 | // This file is part of TeaBook Open Reader 4 | // 5 | // This program is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, version 3.0 of the License. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | // 17 | // An additional permission has been granted as a special exception 18 | // to the GNU General Public Licence. 19 | // You should have received a copy of this exception. If not, see 20 | // . 21 | 22 | 23 | 24 | //= require jquery 25 | //= require jquery_ujs 26 | -------------------------------------------------------------------------------- /config/resque-pool.yml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | extract_epub: 1 25 | epub_to_html: 2 26 | download_ebook: 1 27 | import_books: 1 28 | -------------------------------------------------------------------------------- /config/fake_api.yml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | development: 25 | port: 4567 26 | dev: 27 | port: 4567 28 | staging: 29 | port: 5678 30 | -------------------------------------------------------------------------------- /app/views/kaminari/_gap.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %li.disabled 25 | = link_to raw(t 'views.pagination.truncate'), "#" -------------------------------------------------------------------------------- /app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2012 TEA, the ebook alternative 2 | // 3 | // This file is part of TeaBook Open Reader 4 | // 5 | // This program is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, version 3.0 of the License. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | // 17 | // An additional permission has been granted as a special exception 18 | // to the GNU General Public Licence. 19 | // You should have received a copy of this exception. If not, see 20 | // . 21 | 22 | 23 | 24 | //= require app_namespace 25 | //= require lib 26 | //= require boot 27 | -------------------------------------------------------------------------------- /app/assets/javascripts/reader.js: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2012 TEA, the ebook alternative 2 | // 3 | // This file is part of TeaBook Open Reader 4 | // 5 | // This program is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, version 3.0 of the License. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | // 17 | // An additional permission has been granted as a special exception 18 | // to the GNU General Public Licence. 19 | // You should have received a copy of this exception. If not, see 20 | // . 21 | 22 | 23 | 24 | //= require app_namespace 25 | //= require reader/lib 26 | //= require reader/boot 27 | -------------------------------------------------------------------------------- /app/views/ebook/epubs/new.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %h1 New ebook 25 | 26 | = render 'form' 27 | 28 | = link_to 'Back', ebook_epubs_path 29 | -------------------------------------------------------------------------------- /spec/models/admin_spec.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | require 'spec_helper' 25 | 26 | describe Admin do 27 | pending "add some examples to (or delete) #{__FILE__}" 28 | end 29 | -------------------------------------------------------------------------------- /app/assets/javascripts/reader_sandbox.js: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2012 TEA, the ebook alternative 2 | // 3 | // This file is part of TeaBook Open Reader 4 | // 5 | // This program is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, version 3.0 of the License. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | // 17 | // An additional permission has been granted as a special exception 18 | // to the GNU General Public Licence. 19 | // You should have received a copy of this exception. If not, see 20 | // . 21 | 22 | 23 | 24 | //= require app_namespace 25 | //= require reader_sandbox/lib 26 | //= require reader_sandbox/boot 27 | -------------------------------------------------------------------------------- /app/controllers/admin/home_controller.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | class Admin::HomeController < AdminController 26 | 27 | def index 28 | end 29 | 30 | end 31 | -------------------------------------------------------------------------------- /app/views/admin/booksellers/new.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %h1 New bookseller 25 | 26 | = render 'form' 27 | 28 | = link_to 'Back', admin_booksellers_path 29 | -------------------------------------------------------------------------------- /config/mongoid/development.yml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | development: 25 | host: localhost 26 | database: tea_dev 27 | 28 | test: 29 | host: localhost 30 | database: tea_test 31 | -------------------------------------------------------------------------------- /spec/fabricators/ebook_epub_chapter_fabricator.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | Fabricator(:ebook_chapter_component, class_name: 'Ebook::Epub::Chapter') do 26 | end 27 | -------------------------------------------------------------------------------- /app/models/bookmark.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | class Bookmark < BookLocation 26 | attr_accessible :book, :component_name, :start_xpath, :device, :epub_cfi 27 | end 28 | -------------------------------------------------------------------------------- /app/views/bookmarks/new.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %h1 New bookmark 25 | 26 | = render 'form' 27 | 28 | = link_to 'Back', book_bookmarks_path(@bookmark.book) 29 | -------------------------------------------------------------------------------- /lib/tasks/resque.rake: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | require 'resque/pool/tasks' 26 | 27 | namespace :resque do 28 | task :setup => :environment do 29 | end 30 | end 31 | -------------------------------------------------------------------------------- /config/initializers/_gaston.rb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | Gaston.configure do |gaston| 25 | gaston.env = Rails.env 26 | gaston.files = Dir[Rails.root.join("config/gaston/**/*.yml")] 27 | end 28 | -------------------------------------------------------------------------------- /app/assets/stylesheets/_sprites.sass: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2012 TEA, the ebook alternative 2 | // 3 | // This file is part of TeaBook Open Reader 4 | // 5 | // This program is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, version 3.0 of the License. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | // 17 | // An additional permission has been granted as a special exception 18 | // to the GNU General Public Licence. 19 | // You should have received a copy of this exception. If not, see 20 | // . 21 | 22 | 23 | 24 | @import 'default/custom/*.png' 25 | +all-custom-sprites 26 | 27 | @import 'default/nav/*.png' 28 | +all-nav-sprites 29 | -------------------------------------------------------------------------------- /app/assets/stylesheets/_init.sass: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2012 TEA, the ebook alternative 2 | // 3 | // This file is part of TeaBook Open Reader 4 | // 5 | // This program is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, version 3.0 of the License. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | // 17 | // An additional permission has been granted as a special exception 18 | // to the GNU General Public Licence. 19 | // You should have received a copy of this exception. If not, see 20 | // . 21 | 22 | 23 | 24 | // Compass 25 | @import compass/reset 26 | @import compass/css3 27 | @import compass/utilities 28 | @import compass/typography 29 | -------------------------------------------------------------------------------- /app/assets/javascripts/app_namespace.js.coffee: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | @App = 25 | Models: {} 26 | Views: {} 27 | Collections: {} 28 | Controls: {} 29 | Flippers: {} 30 | Panels: {} 31 | Misc: {} 32 | -------------------------------------------------------------------------------- /app/views/ebook/epubs/edit.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %h1 Editing ebook 25 | 26 | = render 'form' 27 | 28 | = link_to 'Show', @ebook 29 | \| 30 | = link_to 'Back', ebook_epubs_path 31 | -------------------------------------------------------------------------------- /app/views/ebook/epubs/index.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | -#%header 25 | %p= link_to 'New Ebook', new_ebook_epub_path, class: 'btn btn-primary onlyOnline' 26 | 27 | %section.content 28 | -------------------------------------------------------------------------------- /app/views/ebook/epubs/show.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %p#notice= notice 25 | 26 | 27 | = link_to 'Edit', edit_ebook_epub_path(@ebook) 28 | \| 29 | = link_to 'Back', ebook_epubs_path 30 | -------------------------------------------------------------------------------- /app/views/kaminari/_last_page.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %li.last{ :class => current_page.last? && 'disabled' } 25 | = link_to raw(t 'views.pagination.last'), url, :remote => remote 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile ~/.gitignore_global 6 | 7 | /REVISION 8 | 9 | # Ignore bundler config 10 | /.bundle 11 | 12 | # Ignore the default SQLite database. 13 | /db/*.sqlite3 14 | 15 | # Ignore all logfiles and tempfiles. 16 | /log/*.log 17 | /tmp 18 | 19 | # Ignore rvmrc 20 | .rvmrc 21 | 22 | # Ignore assets compiled and cache folders 23 | /public/assets 24 | /.sass-cache 25 | 26 | # Ignore uploaded files 27 | public/cover 28 | public/cover_spec 29 | db/epub 30 | db_spec/epub 31 | uploads 32 | 33 | # Ignore ebooks examples 34 | examples/ebooks 35 | 36 | # Ignore mongoid config 37 | config/mongoid.yml 38 | 39 | # Ignore simplecov report 40 | coverage 41 | 42 | .jhw-cache 43 | 44 | # Ignore user-specific files 45 | .pry* 46 | .ackrc 47 | 48 | # Ignore sprites 49 | app/assets/images/*-*.png 50 | app/assets/images/*/*-*.png 51 | 52 | # Secret token 53 | config/initializers/secret_token.rb 54 | 55 | # Vagrant file 56 | script/vagrant/Vagrantfile 57 | script/vagrant/.vagrant 58 | -------------------------------------------------------------------------------- /app/views/kaminari/_first_page.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %li.first{ :class => current_page.first? && 'disabled' } 25 | = link_to raw(t 'views.pagination.first'), url, :remote => remote 26 | -------------------------------------------------------------------------------- /app/assets/javascripts/misc/gcf.js.coffee: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | $(document).ready -> 25 | if CFInstall? 26 | CFInstall.check 27 | mode: "overlay" 28 | destination: "http://www.mozilla.org/firefox/" 29 | -------------------------------------------------------------------------------- /config/initializers/redis.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | config = YAML.load_file File.expand_path("../../redis.yml", __FILE__) 26 | $redis = Redis.connect config[Rails.env] 27 | Resque.redis = $redis 28 | -------------------------------------------------------------------------------- /config/locales/activemodel.fr.yml: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | fr: 25 | activemodel: 26 | attributes: 27 | tea_api/session: 28 | email: Email 29 | password: Mot de passe 30 | bookstore: Libraire 31 | -------------------------------------------------------------------------------- /app/assets/javascripts/models/chapter.coffee: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | class App.Models.Chapter extends Backbone.RelationalModel 25 | 26 | class App.Collections.Chapters extends Backbone.Collection 27 | model: App.Models.Chapter 28 | -------------------------------------------------------------------------------- /app/assets/javascripts/views/ebook_reader_menu.js.coffee: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | class App.Views.EbookReaderMenu extends Backbone.View 25 | tagName: 'nav' 26 | 27 | render: -> 28 | @$el.html SMT['ebook/menu'] 29 | @ 30 | -------------------------------------------------------------------------------- /app/views/kaminari/_next_page.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %li.next{ :class => current_page.last? && 'disabled' } 25 | = link_to raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote 26 | -------------------------------------------------------------------------------- /spec/fabricators/ebook_epub_component_fabricator.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | Fabricator(:ebook_epub_component, class_name: 'Ebook::Epub::Component') do 26 | src { "#{Faker::Lorem.word }.html" } 27 | end 28 | -------------------------------------------------------------------------------- /app/views/kaminari/_prev_page.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %li.prev{ :class => current_page.first? && 'disabled' } 25 | = link_to raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote 26 | -------------------------------------------------------------------------------- /app/workers/epub_to_html_worker.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | class EpubToHTMLWorker 26 | @queue = :epub_to_html 27 | 28 | def self.perform(id) 29 | Ebook::Epub.find(id).convert_to_html 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | # Load the rails application 26 | require File.expand_path('../application', __FILE__) 27 | 28 | # Initialize the rails application 29 | Tea::Application.initialize! 30 | -------------------------------------------------------------------------------- /app/views/kaminari/_page.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %li.page{ :class => page.current? && 'active' } 25 | = link_to page, url, opts = { :remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil } 26 | -------------------------------------------------------------------------------- /app/views/manifests/loader.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | !!! 5 25 | %html(lang="en" manifest="/manifests/reader.appcache") 26 | %head 27 | %meta(charset="utf-8") 28 | %body 29 | You shall not see this! 30 | -------------------------------------------------------------------------------- /spec/support/controller_macros.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | module ControllerMacros 26 | 27 | def login_user(user = nil) 28 | before(:each) do 29 | sign_in user || mock_user 30 | end 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /app/controllers/admin_controller.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | 26 | class AdminController < ActionController::Base 27 | protect_from_forgery 28 | before_filter :authenticate_admin! 29 | 30 | layout 'admin' 31 | end 32 | -------------------------------------------------------------------------------- /app/views/admin/booksellers/edit.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %h1 Editing bookseller 25 | 26 | = render 'form' 27 | 28 | = link_to 'Show', [:admin, @bookseller] 29 | \| 30 | = link_to 'Back', admin_booksellers_path 31 | -------------------------------------------------------------------------------- /app/workers/download_ebook_worker.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | class DownloadEbookWorker 26 | @queue = :download_ebook 27 | 28 | def self.perform(id, cookie) 29 | Ebook::Epub.find(id).download! cookie 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /spec/models/bookmark_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | require 'spec_helper' 26 | 27 | describe Bookmark do 28 | 29 | it "has a valid factory" do 30 | Fabricate.build(:bookmark).should be_valid 31 | end 32 | 33 | end 34 | -------------------------------------------------------------------------------- /app/assets/stylesheets/application.css.sass: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2012 TEA, the ebook alternative 2 | // 3 | // This file is part of TeaBook Open Reader 4 | // 5 | // This program is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, version 3.0 of the License. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | // 17 | // An additional permission has been granted as a special exception 18 | // to the GNU General Public Licence. 19 | // You should have received a copy of this exception. If not, see 20 | // . 21 | 22 | 23 | 24 | @import init 25 | 26 | // Variables with radius border, colors 27 | @import variables 28 | 29 | // Sprites 30 | @import sprites 31 | 32 | // Import customisation 33 | @import main 34 | -------------------------------------------------------------------------------- /app/views/bookmarks/edit.html.haml: -------------------------------------------------------------------------------- 1 | -# Copyright (C) 2012 TEA, the ebook alternative 2 | -# 3 | -# This file is part of TeaBook Open Reader 4 | -# 5 | -# This program is free software: you can redistribute it and/or modify 6 | -# it under the terms of the GNU General Public License as published by 7 | -# the Free Software Foundation, version 3.0 of the License. 8 | -# 9 | -# This program is distributed in the hope that it will be useful, 10 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | -# GNU General Public License for more details. 13 | -# 14 | -# You should have received a copy of the GNU General Public License 15 | -# along with this program. If not, see . 16 | -# 17 | -# An additional permission has been granted as a special exception 18 | -# to the GNU General Public Licence. 19 | -# You should have received a copy of this exception. If not, see 20 | -# . 21 | 22 | 23 | 24 | %h1 Editing bookmark 25 | 26 | = render 'form' 27 | 28 | = link_to 'Show', book_bookmark_path(@bookmark.book, @bookmark) 29 | \| 30 | = link_to 'Back', book_bookmarks_path(@bookmark.book) 31 | -------------------------------------------------------------------------------- /app/workers/import_books_worker.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Copyright (C) 2012 TEA, the ebook alternative 4 | # 5 | # This file is part of TeaBook Open Reader 6 | # 7 | # This program is free software: you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation, version 3.0 of the License. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # An additional permission has been granted as a special exception 20 | # to the GNU General Public Licence. 21 | # You should have received a copy of this exception. If not, see 22 | # . 23 | 24 | 25 | class ImportBooksWorker 26 | @queue = :import_books 27 | 28 | def self.perform(id, bookstore_id, cookie) 29 | User.find(id).import_books! cookie, bookstore_id 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /app/assets/javascripts/misc/appcache_loader.js.coffee: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 TEA, the ebook alternative 2 | # 3 | # This file is part of TeaBook Open Reader 4 | # 5 | # This program is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, version 3.0 of the License. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # An additional permission has been granted as a special exception 18 | # to the GNU General Public Licence. 19 | # You should have received a copy of this exception. If not, see 20 | # . 21 | 22 | 23 | 24 | class App.Misc.AppcacheLoader 25 | constructor: -> 26 | setTimeout( -> 27 | $('