Code Monkey home page Code Monkey logo

redmine_tagging's Introduction

Tagging

Simple tagging for redmine. Features:

  • Tag cloud in the sidebar

  • Tag suggestion/autocomplete

  • Redmine search integration (search for #tag to find wikis/issues)

  • Filter issues on tags

Spaces or commas will act as a separator when editing tags

{{tagcloud}} will render a tag cloud. Most likely use would be in an wiki sidebar. The tagcloud will automatically be rendered in the issues list sidebar.

This plugin needs acts-as-taggable-on from rymai (github.com/rymai/acts-as-taggable-on) to be installed. The original plugin from github.com/mbleigh/acts-as-taggable-on needs patches to make it compatible with rails 2.3.5, which Redmine uses.

The plugin also needs rails_sql_views. It might install automatically by just doing ‘gem install rails_sql_views’. If not (it didn’t for me when 0.7.0 was available), try:

$ git clone http://github.com/woodchuck/rails_sql_views.git
$ cd rails_sql_views
$ rake gem
$ sudo gem install --local pkg/rails_sql_views-0.*.gem

Installation

While patches to acts-as-taggable-on are not merged to upstream, you should use a fork of it. Installation is performed with:

$ script/plugin install http://github.com/rymai/acts-as-taggable-on.git
$ script/plugin install http://github.com/friflaj/redmine_tagging.git

You need to set up database for acts-as-taggable-on:

1a) for Rails 2 (which Redmine currently uses):

$ env RAILS_ENV=production script/generate acts_as_taggable_on_migration

1b) for Rails 3:

$ rails generation acts_as_taggable_on:migration

2)

$ rake db:migrate RAILS_ENV=production
$ rake db:migrate_plugins RAILS_ENV=production

See the README of acts-as-taggable-on for details.

I’ve added a switch so you can choose between in-line tag editing with {{tag(some tags here-or-there)}} or editing the tags in a separate edit field. After you’ve changed the setting in Administration -> Plugins -> Configure -> Tagging, run

$ rake redmine:tagging:reconfigure RAILS_ENV=production

to put tags in the body or remove them, depending on what you configured for your installation. Not doing so will cause data (tag) loss when moving from non-inline to inline.

Inline tagging

Inline tagging using {{tag(bla bla)}} saves your tags when the body is rendered. A nasty side-effect of this is that if you want to remove all tags from an object, you must add {{tag}} to the body to actually clear the tags. After it’s been rendered once, you can remove it from the body.

Errors during migration

If you’re getting “Mysql::Error: Specified key was too long; max key length is 1000 bytes: CREATE INDEX ‘index_taggings_on_taggable_id_and_taggable_type_and_context` ON `taggings` (`taggable_id`, `taggable_type`, `context`)”, that’s a known problem in mysql, triggered by acts-as-taggable-on. You can work around it by changing

add_index :taggings, :tag_id
add_index :taggings, [:taggable_id, :taggable_type, :context]

into

add_index :taggings, :tag_id
add_index :taggings, :taggable_id
add_index :taggings, :taggable_type
add_index :taggings, :context

in the migration of acts-as-taggable-on

redmine_tagging's People

Contributors

avit avatar bbigras avatar ciaranj avatar iteman avatar jdnavarro avatar whitequark avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.