flyboy 0.0.5 → 0.0.6

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.
Files changed (50) hide show
  1. data/app/controllers/flyboy/application_controller.rb +1 -4
  2. data/app/controllers/flyboy/goals_controller.rb +1 -1
  3. data/app/controllers/flyboy/task_comments_controller.rb +3 -5
  4. data/app/controllers/flyboy/tasks_controller.rb +27 -10
  5. data/app/models/flyboy/task_comment.rb +5 -0
  6. data/app/views/flyboy/_filters.html.slim +2 -4
  7. data/app/views/flyboy/task_comments/_list.html.slim +5 -2
  8. data/config/locales/fr.yml +7 -14
  9. data/lib/flyboy/version.rb +1 -1
  10. data/spec/controllers/flyboy/task_comments_controller_spec.rb +6 -6
  11. data/spec/dummy/app/assets/javascripts/application.js +1 -0
  12. data/spec/dummy/app/views/layouts/application.html.erb +4 -0
  13. data/spec/dummy/db/test.sqlite3 +0 -0
  14. data/spec/dummy/log/development.log +3981 -0
  15. data/spec/dummy/log/test.log +22472 -0
  16. data/spec/dummy/tmp/cache/assets/development/sprockets/0b81d67185fafc34bb306fa9a36b908c +0 -0
  17. data/spec/dummy/tmp/cache/assets/development/sprockets/10ee1eebdd2597b102d3f333f8d6aa77 +0 -0
  18. data/spec/dummy/tmp/cache/assets/development/sprockets/1656338baad17c91a6f7412f302ebd31 +0 -0
  19. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  20. data/spec/dummy/tmp/cache/assets/development/sprockets/309f38dc2cba393a866708d36e86a182 +0 -0
  21. data/spec/dummy/tmp/cache/assets/development/sprockets/49fd843796f3ae46b1c45c6aed1813d7 +0 -0
  22. data/spec/dummy/tmp/cache/assets/development/sprockets/4c42b2369fc4309cc475c0140d9be7b4 +0 -0
  23. data/spec/dummy/tmp/cache/assets/development/sprockets/53d11dab8923a59a9faac8c477248417 +0 -0
  24. data/spec/dummy/tmp/cache/assets/development/sprockets/6362c7e7864adb2cd6025755a6b12b72 +0 -0
  25. data/spec/dummy/tmp/cache/assets/development/sprockets/71c27ec1e11a4658c53269a8bfeee148 +0 -0
  26. data/spec/dummy/tmp/cache/assets/development/sprockets/77d0df9ddb0e8c864cb2e5a78dec7b82 +0 -0
  27. data/spec/dummy/tmp/cache/assets/development/sprockets/9170cea0c3c8535be830a51eaf4c5059 +0 -0
  28. data/spec/dummy/tmp/cache/assets/development/sprockets/a88d9c609d05fcc4670c8742b41816c0 +0 -0
  29. data/spec/dummy/tmp/cache/assets/development/sprockets/ad05260b988c5f87acdbe4d9d950149c +0 -0
  30. data/spec/dummy/tmp/cache/assets/development/sprockets/af9d30792028928b663a5b2dc1e0610b +0 -0
  31. data/spec/dummy/tmp/cache/assets/development/sprockets/c6114e4a5461cc7720ccdee699e719b5 +0 -0
  32. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  33. data/spec/dummy/tmp/cache/assets/development/sprockets/d3c11cb677afa27b7ed5ca3148a593f9 +0 -0
  34. data/spec/dummy/tmp/cache/assets/development/sprockets/d87810c66e05721ba749c5901c1af296 +0 -0
  35. data/spec/dummy/tmp/cache/assets/development/sprockets/da9bbe94d344cd5330f174778f6b0f1c +0 -0
  36. data/spec/dummy/tmp/cache/assets/development/sprockets/e5471fbd33acc4f0660cea27a0ec4638 +0 -0
  37. data/spec/dummy/tmp/cache/assets/development/sprockets/ebe08f689f659c024f467b77f32a1c49 +0 -0
  38. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  39. data/spec/dummy/tmp/cache/assets/development/sprockets/f85d4a9665985e6a3aad59ea680d3edc +0 -0
  40. data/spec/dummy/tmp/cache/assets/test/sprockets/10ee1eebdd2597b102d3f333f8d6aa77 +0 -0
  41. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  42. data/spec/dummy/tmp/cache/assets/test/sprockets/49fd843796f3ae46b1c45c6aed1813d7 +0 -0
  43. data/spec/dummy/tmp/cache/assets/test/sprockets/53d11dab8923a59a9faac8c477248417 +0 -0
  44. data/spec/dummy/tmp/cache/assets/test/sprockets/6362c7e7864adb2cd6025755a6b12b72 +0 -0
  45. data/spec/dummy/tmp/cache/assets/test/sprockets/77d0df9ddb0e8c864cb2e5a78dec7b82 +0 -0
  46. data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  47. data/spec/dummy/tmp/cache/assets/test/sprockets/e5471fbd33acc4f0660cea27a0ec4638 +0 -0
  48. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  49. data/spec/dummy/tmp/pids/server.pid +1 -0
  50. metadata +55 -5
@@ -6,9 +6,6 @@ module Flyboy
6
6
 
7
7
  layout "application"
8
8
 
9
- helper Dorsale::FormHelper
10
- helper Dorsale::ContextHelper
11
- helper Dorsale::TextHelper
12
- helper Dorsale::ButtonHelper
9
+ helper Dorsale::AllHelpers
13
10
  end
14
11
  end
@@ -82,7 +82,7 @@ module Flyboy
82
82
  if @goal.open!
83
83
  flash[:success] = t("messages.goals.open_ok")
84
84
  else
85
- findlash[:danger] = t("messages.goals.open_error")
85
+ flash[:danger] = t("messages.goals.open_error")
86
86
  end
87
87
 
88
88
  redirect_to @goal
@@ -3,14 +3,12 @@
3
3
  module Flyboy
4
4
  class TaskCommentsController < ::Flyboy::ApplicationController
5
5
  def create
6
- @task ||= Task.find(params[:task_id])
7
- @comment ||= @task.comments.new(task_comment_params)
8
-
9
- @comment.date = DateTime.now # TODO : Export to model ?
6
+ @task ||= Task.find(params[:task_id])
7
+ @task_comment ||= @task.comments.new(task_comment_params)
10
8
 
11
9
  authorize! :update, @task
12
10
 
13
- if @comment.save
11
+ if @task_comment.save
14
12
  redirect_to @task
15
13
  else
16
14
  render "flyboy/tasks/show"
@@ -1,5 +1,3 @@
1
- # encoding: utf-8
2
-
3
1
  module Flyboy
4
2
  class TasksController < ::Flyboy::ApplicationController
5
3
  handles_sortable_columns
@@ -74,7 +72,8 @@ module Flyboy
74
72
  authorize! :create, @task
75
73
 
76
74
  if @task.save
77
- redirect_to @task, notice: t("messages.tasks.create_ok")
75
+ flash[:success] = t("messages.tasks.create_ok")
76
+ redirect_to @task
78
77
  else
79
78
  render :new
80
79
  end
@@ -84,7 +83,8 @@ module Flyboy
84
83
  authorize! :update, @task
85
84
 
86
85
  if @task.update_attributes(task_params)
87
- redirect_to @task, notice: t("messages.tasks.update_ok")
86
+ flash[:success] = t("messages.tasks.update_ok")
87
+ redirect_to @task
88
88
  else
89
89
  render :edit
90
90
  end
@@ -93,25 +93,42 @@ module Flyboy
93
93
  def destroy
94
94
  authorize! :delete, @task
95
95
 
96
- @task.destroy
96
+ if @task.destroy
97
+ flash[:success] = t("messages.tasks.delete_ok")
98
+ else
99
+ flash[:danger] = t("messages.tasks.delete_error")
100
+ end
101
+
97
102
  redirect_to tasks_url
98
103
  end
99
104
 
100
105
  def complete
101
106
  authorize! :complete, @task
102
107
 
103
- comment = @task.comments.create(
104
- :progress => 100,
105
- :description =>"Marquée comme terminée.",
106
- :date => DateTime.now
108
+ @task_comment ||= @task.comments.new(
109
+ :progress => 100,
110
+ :description => t("messages.tasks.complete_ok"),
111
+ :date => DateTime.now
107
112
  )
108
113
 
114
+ if @task_comment.save
115
+ flash[:success] = t("messages.tasks.complete_ok")
116
+ else
117
+ flash[:danger] = t("messages.tasks.complete_error")
118
+ end
119
+
109
120
  redirect_to request.referer
110
121
  end
111
122
 
112
123
  def snooze
113
124
  @task.snooze
114
- @task.save
125
+
126
+ if @task.save
127
+ flash[:success] = t("messages.tasks.snooze_ok")
128
+ else
129
+ flash[:danger] = t("messages.tasks.snooze_error")
130
+ end
131
+
115
132
  redirect_to tasks_url
116
133
  end
117
134
 
@@ -8,6 +8,11 @@ module Flyboy
8
8
 
9
9
  default_scope -> { order("created_at DESC") }
10
10
 
11
+ def initialize(*args)
12
+ super
13
+ self.date = Time.now if date.nil?
14
+ end
15
+
11
16
  after_create :update_task_progress
12
17
 
13
18
  def update_task_progress
@@ -10,7 +10,5 @@
10
10
  option value="open" selected=(@filters.get("status") == "open") = "Ouvert"
11
11
  option value="closed" selected=(@filters.get("status") == "closed") = "Fermé"
12
12
 
13
-
14
- a#reset-filter href="#" class="btn" Mettre à zéro
15
-
16
- button type="submit" class="btn" id="apply-filter" Appliquer
13
+ = filter_reset_button
14
+ = filter_submit_button
@@ -1,4 +1,4 @@
1
- = simple_form_for [@task, (@comment || @task.comments.new)] do |f|
1
+ = simple_form_for [@task, (@task_comment || @task.comments.new)] do |f|
2
2
  table.default
3
3
  thead
4
4
  tr
@@ -22,6 +22,9 @@
22
22
  = progress_bar percentage: comment.progress, label: true
23
23
 
24
24
  td.desription
25
- = comment.description
25
+ p: small
26
+ span.date = comment.date
27
+
28
+ p = text2html comment.description
26
29
 
27
30
  td.actions
@@ -17,22 +17,15 @@ fr:
17
17
  tasks:
18
18
  create_ok: "La tâche a bien été créée"
19
19
  update_ok: "La tâche a bien été modifiée"
20
+ delete_ok: "La tâche a bien été supprimée"
21
+ delete_eror: "Impossible de supprimer la tâche"
22
+ snooze_ok: "La tâche a bien été reportée"
23
+ snooze_eror: "Impossible de reporter la tâche"
24
+ complete_ok: "La tâche a été marquée comme terminée"
25
+ complete_eror: "Impossible de terminer la tâche"
26
+
20
27
  actions:
21
- label: "Actions"
22
- back: "Retour"
23
- cancel: "Annuler"
24
- confirm: "Etes vous certains ?"
25
- delete: "Supprimer"
26
- edit: "Modifier"
27
- save: "Sauver"
28
- new: "Nouveau"
29
- create: "Créer"
30
- update: "Modifier"
31
- details: "Détails"
32
- open: "Ouvrir"
33
- close: "Fermer"
34
28
  complete: "Fait"
35
- snooze: "Reporter"
36
29
 
37
30
  goals:
38
31
  new_task: "Nouvelle Tâche"
@@ -1,3 +1,3 @@
1
1
  module Flyboy
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -3,13 +3,13 @@ require "spec_helper"
3
3
  describe Flyboy::TaskCommentsController, type: :controller do
4
4
  routes { Flyboy::Engine.routes }
5
5
 
6
- let(:task) { FactoryGirl.create(:flyboy_task) }
7
- let(:comment) { FactoryGirl.create(:flyboy_task_comment, task: task) }
6
+ let(:task) { FactoryGirl.create(:flyboy_task) }
7
+ let(:task_comment) { FactoryGirl.create(:flyboy_task_comment, task: task) }
8
8
 
9
- describe '#create' do
10
- it "should create the comment" do
11
- post :create, task_id: task.id, task_comment: comment.attributes
12
- expect(assigns(:comment).persisted?).to be true
9
+ describe "#create" do
10
+ it "should create the task_comment" do
11
+ post :create, task_id: task.id, task_comment: task_comment.attributes
12
+ expect(assigns(:task_comment).persisted?).to be true
13
13
  end
14
14
  end
15
15
 
@@ -1,2 +1,3 @@
1
1
  //= require jquery
2
2
  //= require jquery_ujs
3
+ //= require dorsale/all
@@ -8,6 +8,10 @@
8
8
  </head>
9
9
  <body>
10
10
 
11
+ <div id="flash" class="container">
12
+ <%= render "dorsale/flash" %>
13
+ </div>
14
+
11
15
  <div class="container">
12
16
  <%= yield %>
13
17
  </div>
Binary file