tags: implement tag folding and refactor code
commitcdb317fcf976d653bd605a8a70d83d97b7a43cc5
authorKyle J. McKay <mackyle@gmail.com>
Sun, 13 Nov 2016 03:01:11 +0000 (12 19:01 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Sun, 13 Nov 2016 03:01:11 +0000 (12 19:01 -0800)
tree9ea3da1c41beafc7917a2a2f04fb9c6ee3b2a4a2
parent9f5511ba45326e6e4cc623830f8a66c53634b23d
tags: implement tag folding and refactor code

The tag cloud is most useful if tags are counted in a
case-insensitive fashion.

Arrange to automatically lower-case tags by default.

However, any explicitly white-listed tags will have
the case of the white-listed entry used instead.

For example, if the tag "Git" was explicitly whitelisted
and tag folding (the new $Girocco::Config::foldtags option)
is enabled (it is by default) then adding any of the tag
names "git", "giT", "gIt", "gIT", "Git", "GiT", "GIt" or "GIT"
will all result in incrementing the same tag named "Git".

If tag folding is enabled and "Git" is NOT explicitly
whitelisted (the default) then any of those same eight tags
would end up incrementing the tag named "git" instead.

If tag folding is disabled then adding those eight different
tags will end up incrementing eight different tags (unless the
file system is case-insensitive).

As part of this change, the tag incrementing logic has been
moved from tagproj.cgi into a new Girocco::Project::add_ctag
member function to match the already existing delete_ctag
member function.  Now tagproj.cgi calls add_ctag to add tags.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Girocco/Config.pm
Girocco/Project.pm
Girocco/Util.pm
cgi/tagproj.cgi