flyboy 0.0.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,12 +52,20 @@ module Flyboy
52
52
 
53
53
  def self.to_csv(options = {})
54
54
  CSV.generate(options) do |csv|
55
- csv << ['Action', 'Titre', 'Echéance']
55
+ csv << [
56
+ "Dossier",
57
+ "Avancement dossier",
58
+ "Tâche",
59
+ "Avancement tâche",
60
+ "Echéance"
61
+ ]
56
62
 
57
63
  all.each do |task|
58
64
  csv << [
59
65
  task.goal.title,
66
+ "#{task.goal.progress} %",
60
67
  task.title,
68
+ "#{task.progress} %",
61
69
  I18n.l(task.term),
62
70
  ]
63
71
  end
@@ -2,6 +2,9 @@
2
2
 
3
3
  module Flyboy
4
4
  class Roadmap < Prawn::Document
5
+ include ActionView::Helpers::NumberHelper
6
+ include Dorsale::TextHelper
7
+
5
8
  attr_accessor :tasks
6
9
 
7
10
  def initialize(tasks)
@@ -17,12 +20,20 @@ module Flyboy
17
20
  end
18
21
 
19
22
  def display_tasks(tasks)
20
- display = [['Action', 'Titre', 'Echéance']]
23
+ display = [[
24
+ "Dossier",
25
+ "Avancement dossier",
26
+ "Tâche",
27
+ "Avancement tâche",
28
+ "Echéance"
29
+ ]]
21
30
 
22
31
  tasks.each do |t|
23
32
  display << [
24
33
  t.goal.title,
34
+ percentage(t.goal.progress),
25
35
  t.title,
36
+ percentage(t.progress),
26
37
  I18n.l(t.term)
27
38
  ]
28
39
  end
@@ -30,5 +41,6 @@ module Flyboy
30
41
  table display
31
42
  move_down(10)
32
43
  end
44
+
33
45
  end
34
46
  end
@@ -1,4 +1,7 @@
1
1
  .actions
2
+ - if can?(:read, @task.goal)
3
+ = dorsale_button goal_path(@task.goal), text: "Retour au dossier", icon: :tasks
4
+
2
5
  - if can?(:update, @task)
3
6
  = update_button edit_task_path(@task)
4
7
 
@@ -7,4 +10,3 @@
7
10
 
8
11
  - if can?(:complete, @task)
9
12
  = complete_button complete_task_path(@task)
10
-
@@ -2,13 +2,13 @@ table.default
2
2
  thead
3
3
  tr
4
4
  - if nested
5
- th = Flyboy::Task.human_attribute_name(:progress)
6
5
  th = Flyboy::Task.model_name.human
6
+ th = Flyboy::Task.human_attribute_name(:progress)
7
7
  th = Flyboy::Task.human_attribute_name(:term)
8
8
  - else
9
9
  th = sortable_column Flyboy::Goal.model_name.human, column: "goal"
10
- th = Flyboy::Task.human_attribute_name(:progress)
11
10
  th = sortable_column Flyboy::Task.model_name.human, column: "title"
11
+ th = Flyboy::Task.human_attribute_name(:progress)
12
12
  th = sortable_column Flyboy::Task.human_attribute_name(:term), column: "term"
13
13
 
14
14
  th = t("actions.label")
@@ -23,15 +23,15 @@ table.default
23
23
  - else
24
24
  = task.goal.title
25
25
 
26
- td.task_progress
27
- = progress_bar percentage: task.progress, label: true
28
-
29
26
  td.title
30
27
  - if can?(:read, task)
31
28
  = link_to task.title, task_path(task)
32
29
  - else
33
30
  = task.title
34
31
 
32
+ td.task_progress
33
+ = progress_bar percentage: task.progress, label: true
34
+
35
35
  td.term
36
36
  = l task.term
37
37
 
@@ -7,14 +7,18 @@
7
7
  <Worksheet ss:Name="Sheet1">
8
8
  <Table>
9
9
  <Row>
10
- <Cell><Data ss:Type="String">Action</Data></Cell>
11
- <Cell><Data ss:Type="String">Titre</Data></Cell>
10
+ <Cell><Data ss:Type="String">Dossier</Data></Cell>
11
+ <Cell><Data ss:Type="String">Avancement dossier</Data></Cell>
12
+ <Cell><Data ss:Type="String">Tâche</Data></Cell>
13
+ <Cell><Data ss:Type="String">Avancement tâche</Data></Cell>
12
14
  <Cell><Data ss:Type="String">Echéance</Data></Cell>
13
15
  </Row>
14
16
  <% @tasks.each do |task| %>
15
17
  <Row>
16
18
  <Cell><Data ss:Type="String"><%= task.goal.title %></Data></Cell>
19
+ <Cell><Data ss:Type="String"><%= percentage(task.goal.progress) %></Data></Cell>
17
20
  <Cell><Data ss:Type="String"><%= task.title %></Data></Cell>
21
+ <Cell><Data ss:Type="String"><%= percentage(task.progress) %></Data></Cell>
18
22
  <Cell><Data ss:Type="String"><%= l task.term %></Data></Cell>
19
23
  </Row>
20
24
  <% end %>
@@ -26,6 +26,7 @@ fr:
26
26
 
27
27
  actions:
28
28
  complete: "Fait"
29
+ label: "Actions"
29
30
 
30
31
  goals:
31
32
  new_task: "Nouvelle Tâche"
@@ -1,3 +1,3 @@
1
1
  module Flyboy
2
- VERSION = "0.0.6"
2
+ VERSION = "1.0.0"
3
3
  end
Binary file