"Mostly" because I did this in a hurry and I am pretty sure I missed
some stuff and there is probably a bunch of dead code that I can still
remove as a result of this. Will follow up later.
Actually, this should be a one-way ticket. Previously,
I've resisted cluttering the Rails routes file with this
kind of redirect, as nginx can handle this kind of thing
faster, but I want to keep things simple and self-contained.
And for comparison, this is the sans-serif version of my websafe font
challenge.
It is clearly less readable than the serif one, but it looks so much
better. I think the difference is particularly strong for buttons and
nav. If I could style those independently then I might wind up with a
best of both worlds kind of situation.
Sick of seeing the unstyled flash. I've _always_ found sans-serif fonts
to be more visually pleasing, even though I think serif fonts are more
readable. But as far as "websafe" fonts go, I think most of the
sans-serif ones look a bit weak, so let's go with serif fonts for now.
According to http://www.cssfontstack.com/, the "safety" levels here are:
Note: In the "Heavy" family, Trebuchet MS is technically a sans-serif
font, but it fits well.
I'm not super happy with the way buttons look with a serif font, not the
nav, really. Other options I considered (sans-serif) were:
- Arial (99.8%, 98.74%): a workhorse font, but very common/tired
- Arial Black (98.1%, 96.2%): might be ok for titles
- Trebuchet MS (already mentioned above)
- Verdana (99.8%, 99.1%): I find it lacks personality...
- Tahoma (100%, 91.7%): might be a decent body font, and it's not Arial
Fix some minor issues along the way:
- unwanted padding in tag autocomplete
- unwanted padding at start of navbar links (thanks, Apple)
Greg Hurrell [Tue, 5 May 2015 14:55:58 +0000 (07:55 -0700)]
Cure issue search form of ugliness and amnesia
Switch to using our custom form builder (which we can easily do thanks
to the fact that we already had a model sticking around).
This gives us a pretty form, and means that form values get remembered
across page loads when you hit "search again".
Note that I had to do a bit of hackery to make sure the desired behavior
came across:
- no pollution of GET URL with snowman bullshit
- no pollution of GET URL with submit button name
- no pollution of GET URL with my spam honeypot param (required me to
pass a new option to the custom form builder)
The only place where I couldn't get parity is the unwanted "new_class"
id and class added to the form, which apparently can't be suppressed.
Greg Hurrell [Tue, 5 May 2015 14:02:43 +0000 (07:02 -0700)]
Revamp pagination
- if at top, move to bottom
- if at top and bottom, get rid of top
- for tables, remove bottom border (looks better with pagination
immediately underneath)
We mostly follow GitHub's lead for how it should look (eg. see
https://github.com/blog):
- always at least two at start of range (1, 2)
- always at least two at end of range (N-1, N)
- show at least two before and after current page
- have "Previous" and "Next" buttons as book-ends; no icons
- ellipsize gaps at start and/or end
- hover behavior, disabled styling, current styling etc
Differences:
- normal font-weight, to keep it lighter
So, this is strictly more powerful than what I had because it means you
can jump to multiple pages directly. It also looks more "modern", until
fashions change, in a year or two...
Greg Hurrell [Tue, 5 May 2015 01:37:43 +0000 (18:37 -0700)]
Commit TODOs
I've had a (massively) dirty worktree for literally years now and am
rather sick of it. I'm going to suppress my aversion to committed TODO
comments (which I think should really be in an issue tracker) and start
getting the worktree cleaner.
Greg Hurrell [Mon, 4 May 2015 06:13:48 +0000 (23:13 -0700)]
Add initial version of TagMapping
Currently implemented:
- TagMapping.alias, for setting up new mappings
- TagMapping.mapping, for getting mappings in convenient, cached form
- parse_tag_list uses TagMapping to canonicalize tag names at creation
time
Not yet implemented:
- TagMapping.canonicalize
- automated testing
- manual testing (eg. how does the tag widget behave when
canonicalization is performed? I am guessing it will just show
something stale)
Notes:
- Rails uses a dumb file system cache in the local development
environment for Rails.cache (heck, it might even do that in the
production environment); this means that development environment
mappings map pollute the test environment (via the cache, even if the
database records are different)
- As a result, I stub out `TagMapping.mappings` in the test suite, but
note that I had to move a few top-level `describe` blocks into the
`Tag` block just to keep this DRY; it probably should have been like
this all along
Greg Hurrell [Sun, 3 May 2015 03:10:15 +0000 (20:10 -0700)]
Remove never-used bootstrap
Bootstrap is hard to borrow from piecemeal. Let's just ditch it. I would
rather take inspiration from it than tie myself to it forever,
especially given a likely React rewrite in the future.
In the meantime, I think I might look at more lightweight alternatives.