Commit Graph
62 Commits
Author SHA1 Message Date
Jonathan Rehm 56c71dd4bf Disable bookmarking when anonymous users are reading 2017-09-30 10:51:20 -07:00
Jonathan Rehm 29f21b148b Translate 10-based rating to 5-based 2017-09-11 09:58:39 -07:00
Jonathan Rehm e806494b54 Ensure variables exist before they're used 2017-09-11 09:24:20 -07:00
Jonathan Rehm a4f81dd812 Do not include empty strings in list of bookmarks 2017-09-10 15:38:24 -07:00
Jonathan Rehm 58abc1d024 Fuzzy match book titles to eliminate duplicates
Titles with a Levenshtein ratio of 70% or greater are considered duplicates.
2017-08-29 07:15:33 -07:00
Jonathan Rehm 53c687251e Show "More by" on author page
Uses Goodread's list of author's books, filtering out the books that are already in the user's library.

Requires the Goodreads dependency and API information.
2017-08-29 07:15:33 -07:00
Jonathan Rehm 6b8de017ab Use SQLAlchemy boolean
Seems to make a difference sometimes.

Ref #300
2017-08-29 07:14:57 -07:00
Jonathan Rehm 282837c7c5 Use ES5 syntax 2017-08-29 07:14:32 -07:00
Jonathan Rehm 8e1cfa1cbf Re-apply db_filter
Accidentally removed when the language and content filters were moved to `common_filters`.
2017-08-29 07:13:31 -07:00
Jonathan Rehm 3213bf50b3 Move common filters into function
Instead of duplicating functionality across lots of functions, combine it into one common function. It makes reading and modifying it much easier.
2017-08-26 08:12:16 -07:00
Jonathan Rehm 374b5f4c6e Save ePub bookmarks to database
Save ePub bookmark to database. Also use library's built-in restore feature to restore all information from localStorage.
2017-08-23 08:55:40 -07:00
Jonathan Rehm b494b6b62a Remove vendor directory from git
Directory will automatically get created when it's used as pip's target.
2017-08-21 09:23:49 -07:00
Jonathan Rehm a682c95ec1 Show "More by" on author page
Uses Goodread's list of author's books, filtering out the books that are already in the user's library.

Requires the Goodreads dependency and API information.
2017-08-21 08:56:08 -07:00
Jonathan Rehm cda733f4a4 Escape special characters in file names
Follows Calibre's convention of using underscores as replacements
2017-08-19 11:56:29 -07:00
Jonathan Rehm 8cbd6a8431 Do not append query string if file_hash is not found 2017-08-19 09:09:12 -07:00
Jonathan Rehm 13c2a53c0f Fix issues with Windows path separators 2017-08-19 08:32:00 -07:00
Jonathan Rehm 866f7944eb Meta data improvements
* Add buttons to show/hide results from Douban & Google
* Trigger search with "Enter" key
* Use Underscore.js template instead of build HTML strings in JavaScript
* Keep click event handler in JavaScript instead of using HTML's `onclick`
* Normalize Douban & Google results
* Update cover image & add cover URL to the form input
2017-08-15 22:11:01 -07:00
Jonathan Rehm a27848b351 Add static asset cache busting
Calculates MD5 hash of static assets on server start. These are appended to the file name's when url_for is used, telling browsers to download the latest version of the files, e.g. style.css?q=81cf0ee.

Inspired by https://github.com/ChrisTM/Flask-CacheBust but uses query strings instead of rewriting the path because fonts inside CSS files break when the path is rewritten.
2017-08-13 09:32:29 -07:00
Jonathan Rehm 08d0404e9c Add mature_content property to Anonymous class 2017-08-13 07:05:45 -07:00
Jonathan Rehm 8171943b8e Update to ES5 standards
Also fix ESLint issues
2017-08-12 22:46:27 -07:00
Jonathan Rehm 29e2658e53 Add eslint file
Attempts to pattern what has been in use by Codacy. Currently, it eliminates support for IE10 and below, and some aspects of our code eliminate IE11, leaving Edge as the only supported MS browser. I don't think this is intentional.
2017-08-12 22:44:39 -07:00
Jonathan Rehm 6f797ba478 Check if JPEG via response content-type header instead of URL extension
That way we can use dynamic URLs, such as those returned by the "Get Metadata" request.
2017-08-09 10:03:02 -07:00
Jonathan Rehm aee8aad976 Add option to hide mature content from some users
Uses a configurable list of tags to denote what is mature and hides those books from the user
2017-08-08 10:38:28 -07:00
Jonathan Rehm ec118c2254 Move scripts to bottom of body to prevent execution from delaying DOM rendering 2017-07-28 20:07:10 -07:00
Jonathan Rehm dde4f6afe2 Add missing label 2017-07-28 20:03:43 -07:00
Jonathan Rehm 0b47958fad Add lang attribute to html tag 2017-07-28 20:03:23 -07:00
Jonathan Rehm c86fa268c2 Fix/remove duplicate id's 2017-07-28 20:02:53 -07:00
Jonathan Rehm 5162e2eed7 Add img alt attributes 2017-07-28 20:01:31 -07:00
Jonathan Rehm 5465b8e8b7 Add "Previous" pagination button
I imagine these buttons are still in use when JavaScript is disabled or not loading.
2017-07-28 07:38:35 -07:00
Jonathan Rehm 0afc8f94da Use TinyMCE's API to update the description's content 2017-07-25 13:16:12 -07:00
Jonathan Rehm dd124ab356 Make change requested by Codacy 2017-07-23 13:36:21 -07:00
Jonathan Rehm 59afc7eb9f Make changes requested by Codacy 2017-07-23 13:36:21 -07:00
Jonathan Rehm 3258f4fb79 Make changes requested by Codacy 2017-07-23 13:36:21 -07:00
Jonathan Rehm 61e0405f75 Move TinyMCE into edit_books.js 2017-07-23 13:36:21 -07:00
Jonathan Rehm 5715d27c97 Show localized date over top of date input
Also move datepicker logic into edit_books.js and edit_books.js below the datepicker file declaration(s)
2017-07-23 13:36:21 -07:00
Jonathan Rehm 36c2b35588 Use bootstrap-datepicker to add datepicking UI for browsers that do not have one built-in 2017-07-23 13:35:35 -07:00
Jonathan Rehm cc916a4eb4 Add timestamp to default publishing date 2017-07-23 13:35:35 -07:00
Jonathan Rehm a07798b0db Standardize indentation 2017-07-23 13:35:35 -07:00
Jonathan Rehm 04b04e200f Add ability to edit publish date
If a date is not set, default to “0101-01-01”
2017-07-23 13:35:35 -07:00
Jonathan Rehm cf7196ae5e Refactor to remove nested if-statements 2017-07-23 13:35:35 -07:00
Jonathan Rehm a95e6aab6b Do not attempt to create the YAML file when Google Drive is disabled (#246) 2017-07-23 22:26:43 +02:00
Jonathan Rehm 693c26c2b3 Attach events to button toolbar
Since this is closer to the elements, we can be more sure that we won't have events fire when we don't want them to. For example, if we're viewing the page in a modal, we don't want the event handler living longer than the content itself.
2017-07-22 11:24:47 -07:00
Jonathan Rehm d85e0b96dc Prevent jQuery from cache busting static assets
If the HTML that's returned from the `$.get` request contains a `<script src="..."/>` tag it loads the JavaScript file via ajax, and by default it attaches a timestamp to it to bust cache. That means the file loads every time the modal is opened, and the browser treats it as a new file each time. The result is that code fires multiple times and events listeners are added multiple times.
2017-07-22 11:11:14 -07:00
Jonathan Rehm e1a88aa0ab Make change requested by Codacy 2017-07-22 07:34:38 -07:00
Jonathan Rehm 5c3a5b6c39 Use ajax to add/remove books from shelves
Gracefully fall back to standard requests if JavaScript is disabled
2017-07-21 21:15:03 -07:00
Jonathan Rehm 85ce06850c Fix for Python 3 2017-07-13 21:28:00 -07:00
Jonathan Rehm 91ba0f0362 Resolve issues with unicode characters in author's name
I've been unable to reproduce the issue on macOS with Python 2.7/3.6 and Fedora with Python 2.7, but if it happens for others, then it's worth the change.
2017-07-13 21:22:34 -07:00
Jonathan Rehm 51bd2f89df Use dot notation 2017-07-13 18:09:33 -07:00
Jonathan Rehm c9c6529567 Use SECRET_KEY from environment variable (#232) 2017-07-11 18:35:55 +02:00
Jonathan Rehm 9683d50f36 Send mail from the FROM address instead of the login
When SMTP is configured to use a service that doesn't use an email address to log in – e.g. AWS SES or Postmark – the sendmail request fails saying the FROM address is invalid.
2017-07-11 07:16:19 -07:00
Jonathan Rehm 802eb628c8 Split event listener and selector string
Event and selectors appear to have been accidentally combined. The result is that typing in any input triggers a call to the `/get_matching_tags` route. We can probably limit the selector farther to only fire when `#tags` is typed into.
2017-07-10 13:03:58 -07:00
Jonathan Rehm 66231c8737 Associate label with correct input (#228) 2017-07-10 19:26:57 +02:00
Jonathan Rehm fe68c8a7f8 Add support for displaying author information from Goodreads
Requires the "goodread" module (added to optional-requirements.txt) and an API key

Retrieves Goodreads author information and displays their photo and "about" text
2017-07-08 16:07:45 -07:00
Jonathan Rehm d799b859ea Make changes suggested by codacy 2017-07-08 09:15:40 -07:00
Jonathan Rehm 649579eccd Move jquery.form to layout.html
This prevents it from getting loaded each time the details are viewed in a modal dialog.
2017-07-08 09:15:40 -07:00
Jonathan Rehm 675e8dd5cd Show book details in modal dialog
With them shown in a modal, you don't lose your place in the pagination. If the request comes via Ajax, the minimal layout is used. If via a normal request, the full layout is used. That lets you open the details in a new tab and have the full experience, but if you're clicking through the results of a search, you can view many without losing your place.
2017-07-08 09:15:40 -07:00
Jonathan Rehm 623f5c8ef0 Add "magic link" functionality
When using a device that is bothersome to log in on (e.g. a Kindle) you can use a magic link to log in via another device.

Configuration was added and is disabled by default.
2017-07-07 18:29:16 -07:00
Jonathan Rehm b138c9edd5 Show read/unread counts 2017-07-06 22:33:57 -07:00
Jonathan Rehm 7631eea32e Add sort options when viewing books
Default view still shows the most recently added books, but adds ability to sort by newest/oldest books and books sorted alphabetically (ascending & descending).

I did not include translations for the next text, but they are split up for easy translating and are otherwise ready for translating.
2017-07-06 21:14:45 -07:00
Jonathan Rehm 4fe1536b7e Simplify the read functionality's code
* Use block label to toggle the checkbox
* Submit form when checkbox's value changes (regardless of whether mouse is used or not)
* Remove unused code
2017-07-06 10:33:47 -07:00
Jonathan Rehm d25300a7fb Add padding to bottom of buttons on shelf page
This adds some space between the buttons when viewing them on a mobile device.
2017-07-06 07:44:28 -07:00
Jonathan Rehm 7853cb2602 Add TinyMCE to provide rich-text editing for descriptions 2017-06-22 08:59:28 -07:00