Hi all,
I've created a small ruby gem to render taskjuggler files as ERB views.
It's a very simple gem at the moment, all it does is
1. pass a *.html.tjp view into the ERB parser.
2. pass the result into tj3
3. takes the resulting css, javascript, and icons (as base64) and inserts them into the final html document.
4. then simply returns it as an html file
Here's an example:
# app/controllers/gantt_controller.rb
```
class GanttController < ApplicationController
def show
@project_name = "My Awesome Project"
@effort = 160 # hours
@developer = "alice"
end
end```
# app/views/gantt/show.html.tjp
```
project demo "<%= @project_name %>" "1.0" 2025-01-01 +3m
resource <%= @developer %> "Alice"
task planning "Planning" {
effort 40h
allocate <%= @developer %>
}
task development "Development" {
effort <%= @effort %>h
allocate <%= @developer %>
depends planning
}
taskreport "Gantt" {
formats html
headline "Simple Gantt – Generated <%= Time.now.strftime('%Y-%m-%d') %>"
}```
You can find the repo here:
https://github.com/n-at-han-k/taskjuggler-railsI've no doubt that there will be edge cases that I'm unaware off where it falls short, but in terms of generating gantt charts from my personal database it does the job great.
Pull requests are welcome if anyone has finds this useful. There's a github issue on the taskjuggler repo asking about translating the v2 gui to v3, perhaps this would enable someone to create a webbased UI.
regards
Nathan