Tags, powered by ActsAsTaggableOn

Posted by Denny at 22:40 on Thu, 30 Jan 2020

Partial view of a tag cloudAdded tags to blog posts, and a Tags controller to view all tags. This was pretty straight-forward, as I'm using ActsAsTaggableOn to do all the hard work. And most of the easy work too ;)

There's obvious scope for abstracting this more at some point, but for now I justed wanted to get the basic functionality working and merged in.

Thematic

Posted by Denny at 22:40 on Thu, 23 Jan 2020

I've been refactoring how themes work, and I'm much happier with it now. With the new set-up it's easy to just override just one or two partials if you want, or maybe just override the layout, but still keep using most of the default partials if they suit your needs. If I can keep the HTML in the default views clean and flexible enough, I think this is going to make theming the hosted site quite low-lift for most normal use cases.

I'm still optimistically hoping that at some point this project will attract some people who just love making and sharing themes :) Design and front-end development has never been my strongest skill, so instead I'm trying to make it as easy as possible for people who do have those skills to come and join in one day!

This PR introduces a Theme model (POR, not AR) which can collect any useful theme-related functionality going forward - utility methods to find out if there's a theme in effect currently, what it's called, where its files are located, what other themes are available, etc etc.

Inserts (refactored and renamed 'shared content')

Posted by Denny at 23:44 on Mon, 13 Jan 2020

I merged the refactor and rename of shared content today; the feature is called Inserts now (which is a much better name, imho!) and I got rid of the slightly complicated form model thingy that was holding them together, creating an otherwise pointless InsertSet model to do it instead. This makes a lot of the surrounding code much more standard, which I think is an overall win.

Smart Menus

Posted by Denny at 02:29 on Sat, 11 Jan 2020

Cropped screenshot of a two-level menuI've added the jQuery Smart Menus plugin to drive the menus on the main site, allowing themeable nested menus and so on.

It works okay, although I noticed after adding it that the project isn't very lively, so maybe it wasn't the best choice :-\ I don't really know where to hunt out advice on the best options for JavaScript/front-end stuff like this.

Answers on a postcard in a comment please...

Bump Ruby (2.6.5 to 2.7.0) and gems

Posted by Denny at 17:53 on Thu, 02 Jan 2020

Appropriately, the first merged PR of the year brings us a whole new Ruby - from 2.6.5 to 2.7.0 - as well as updating various gems. :)

Happy New Feature/Year!

Posted by Denny at 22:41 on Tue, 31 Dec 2019

Just before I run out of 2019, I've merged one last PR for the year; this adds the blog post 'teaser' method (and some other odds and ends for the blog).

This project has been running for 3 months now; I think it's going okay, although sometimes when I look at the size of the to-do list, and compare it to the 'done' list, I'm a bit daunted. The original really did acquire a lot of features over the years! Still, it's good to have goals right? ;) And I'm definitely getting more comfortable hacking on Ruby now, which was my original objective for this project.

So, bring on 2020, and hopefully many more CMS features :) I hope to have reached feature parity with the Perl version before the next NYE is upon us, although of course that does depend on the rest of life behaving itself. Wish me luck!

Boxing Day is Blogging Day

Posted by Denny at 18:41 on Thu, 26 Dec 2019

As is traditional (for me anyway, I don't know about the rest of you) I spent a fair chunk of last few days coding, and today I'm merging a WIP milestone of the blog features. There's quite a lot of tidying up to do yet, but I'm taking a 'merge early, merge often' approach with WIP code on this project - so long as it passes tests, it's allowed in!

Rails that goes bump twice in one week

Posted by Denny at 12:54 on Thu, 19 Dec 2019

The last Rails bump didn't last very long! Two days later, time to bump rails from 6.0.2 to 6.0.2.1 (also hassle free, thankfully)

Rails that goes bump in the night

Posted by Denny at 01:16 on Tue, 17 Dec 2019

I am pleased to say that bumping rails from 6.0.1 to 6.0.2 was much less hassle than the bump from 6.0.0 to 6.0.1 :)

Refactoring authorisation and related code

Posted by Denny at 20:13 on Sun, 15 Dec 2019

Refactor capabilities and Pundit auth has got a few different pieces of work in it. The first chunk is intended to make it a bit lower-lift to set up authorisatino when adding new features (there's some inheritance stuff going on in the Pundit policies now which is either clever or 'clever', I haven't quite decided).

There are also some changes which almost certainly make the authorisation code more secure. I'm no longer using translation strings as keys for auth values in the database. I initially thought it would be nice to have the database content be localised for non-English speakers - but it added an extra layer of potentially easily attackable code (just have to futz with the translation strings) in the authorisation subsystem, which is pretty clearly suboptimal. I'm now using symbols most places in the code instead, and only translating those to local strings at the point of displaying on a view, which feels like a smarter choice overall.

This PR fixed a few tests that I had to comment out when I first introduced Pundit, and re-enabling those tests means that I'm back up to 100% coverage :D There are a couple of initializers with :nocov: cheating in them, as well as pretty much all the code in the rake tasks, but everything else is genuinely covered for at least its golden path - mostly by request specs, so there's scope for getting into the details a bit more with the model specs at some point, but I'm still pretty pleased by the current test suite.