rules_engine 0.1.10 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/VERSION +1 -1
  2. data/rails_generators/manifests/rules_engine.rb +25 -18
  3. data/rails_generators/manifests/rules_engine.yml +10 -3
  4. data/rails_generators/templates/app/controllers/re_history_controller.rb +15 -0
  5. data/rails_generators/templates/app/controllers/re_plan_workflows_controller.rb +12 -23
  6. data/rails_generators/templates/app/controllers/re_plans_controller.rb +11 -11
  7. data/rails_generators/templates/app/controllers/re_workflow_rules_controller.rb +2 -1
  8. data/rails_generators/templates/app/controllers/re_workflows_controller.rb +7 -7
  9. data/rails_generators/templates/app/helpers/rules_engine_helper.rb +1 -1
  10. data/rails_generators/templates/app/models/re_plan.rb +1 -1
  11. data/rails_generators/templates/app/models/re_rule.rb +1 -2
  12. data/rails_generators/templates/app/models/re_workflow.rb +1 -9
  13. data/rails_generators/templates/app/views/re_history/_index_prepare.html.erb +12 -0
  14. data/rails_generators/templates/app/views/re_history/_index_update.html.erb +20 -0
  15. data/rails_generators/templates/app/views/re_history/_show.html.erb +30 -0
  16. data/rails_generators/templates/app/views/re_history/index.html.erb +11 -0
  17. data/rails_generators/templates/app/views/re_history/index.js.erb +4 -0
  18. data/rails_generators/templates/app/views/re_history/show.html.erb +8 -0
  19. data/rails_generators/templates/app/views/re_history/show.js.erb +4 -0
  20. data/rails_generators/templates/app/views/re_plans/_copy.html.erb +1 -1
  21. data/rails_generators/templates/app/views/re_plans/{re_process.html.erb → history.html.erb} +3 -3
  22. data/rails_generators/templates/app/views/re_plans/history.js.erb +4 -0
  23. data/rails_generators/templates/app/views/re_plans/index.html.erb +2 -2
  24. data/rails_generators/templates/app/views/re_plans/preview.html.erb +0 -1
  25. data/rails_generators/templates/app/views/re_plans/show.html.erb +2 -2
  26. data/rails_generators/templates/app/views/re_workflows/_copy.html.erb +1 -1
  27. data/rails_generators/templates/app/views/re_workflows/index.html.erb +2 -2
  28. data/rails_generators/templates/doc/README.rules_engine +1 -1
  29. data/rails_generators/templates/public/javascripts/rules_engine/re_history_index.js +43 -0
  30. data/rails_generators/templates/public/javascripts/rules_engine/{re_process_show.js → re_history_show.js} +3 -3
  31. data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/{re_process → re_history}/error-14.png +0 -0
  32. data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/{re_process → re_history}/info-14.png +0 -0
  33. data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/{re_process → re_history}/list-25.png +0 -0
  34. data/rails_generators/templates/public/stylesheets/rules_engine/images/rules_engine/{re_process → re_history}/success-14.png +0 -0
  35. data/rails_generators/templates/public/stylesheets/rules_engine/screen.css +19 -69
  36. data/rails_generators/templates/spec/controllers/re_application_controller_spec.rb +68 -0
  37. data/rails_generators/templates/spec/controllers/re_history_controller_spec.rb +41 -0
  38. data/rails_generators/templates/spec/controllers/re_plan_workflow_rules_controller_spec.rb +355 -0
  39. data/rails_generators/templates/spec/controllers/re_plan_workflows_controller_spec.rb +364 -0
  40. data/rails_generators/templates/spec/controllers/re_plans_controller_spec.rb +165 -223
  41. data/rails_generators/templates/spec/controllers/re_publications_controller_spec.rb +29 -0
  42. data/rails_generators/templates/spec/controllers/re_workflow_rules_controller_spec.rb +353 -0
  43. data/rails_generators/templates/spec/controllers/re_workflows_controller_spec.rb +326 -0
  44. data/rails_generators/templates/spec/helpers/rules_engine_helper_spec.rb +8 -8
  45. metadata +28 -21
  46. data/rails_generators/templates/app/controllers/re_processes_controller.rb +0 -15
  47. data/rails_generators/templates/app/views/re_plans/re_process.js.erb +0 -4
  48. data/rails_generators/templates/app/views/re_processes/_index_prepare.html.erb +0 -12
  49. data/rails_generators/templates/app/views/re_processes/_index_update.html.erb +0 -20
  50. data/rails_generators/templates/app/views/re_processes/_show.html.erb +0 -30
  51. data/rails_generators/templates/app/views/re_processes/index.html.erb +0 -11
  52. data/rails_generators/templates/app/views/re_processes/index.js.erb +0 -4
  53. data/rails_generators/templates/app/views/re_processes/show.html.erb +0 -8
  54. data/rails_generators/templates/app/views/re_processes/show.js.erb +0 -4
  55. data/rails_generators/templates/public/javascripts/rules_engine/re_process_index.js +0 -43
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.10
1
+ 0.2.0
@@ -6,10 +6,10 @@ class RulesEngineManifest
6
6
  app/helpers
7
7
  app/models
8
8
  app/views/layouts
9
+ app/views/re_history
9
10
  app/views/re_plan_workflow_rules
10
11
  app/views/re_plan_workflows
11
12
  app/views/re_plans
12
- app/views/re_processes
13
13
  app/views/re_publications
14
14
  app/views/re_workflow_rules
15
15
  app/views/re_workflows
@@ -41,8 +41,8 @@ class RulesEngineManifest
41
41
  public/stylesheets/rules_engine/images/re_view_navigate
42
42
  public/stylesheets/rules_engine/images/rules_engine
43
43
  public/stylesheets/rules_engine/images/rules_engine/re_common
44
+ public/stylesheets/rules_engine/images/rules_engine/re_history
44
45
  public/stylesheets/rules_engine/images/rules_engine/re_plan
45
- public/stylesheets/rules_engine/images/rules_engine/re_process
46
46
  public/stylesheets/rules_engine/images/rules_engine/re_publication
47
47
  public/stylesheets/rules_engine/images/rules_engine/re_rule
48
48
  public/stylesheets/rules_engine/images/rules_engine/re_workflow
@@ -55,10 +55,10 @@ class RulesEngineManifest
55
55
  end
56
56
 
57
57
  %W(
58
+ app/controllers/re_history_controller.rb
58
59
  app/controllers/re_plan_workflow_rules_controller.rb
59
60
  app/controllers/re_plan_workflows_controller.rb
60
61
  app/controllers/re_plans_controller.rb
61
- app/controllers/re_processes_controller.rb
62
62
  app/controllers/re_publications_controller.rb
63
63
  app/controllers/re_workflow_rules_controller.rb
64
64
  app/controllers/re_workflows_controller.rb
@@ -68,6 +68,13 @@ class RulesEngineManifest
68
68
  app/models/re_rule.rb
69
69
  app/models/re_workflow.rb
70
70
  app/views/layouts/rules_engine.html.erb
71
+ app/views/re_history/_index_prepare.html.erb
72
+ app/views/re_history/_index_update.html.erb
73
+ app/views/re_history/_show.html.erb
74
+ app/views/re_history/index.html.erb
75
+ app/views/re_history/index.js.erb
76
+ app/views/re_history/show.html.erb
77
+ app/views/re_history/show.js.erb
71
78
  app/views/re_plan_workflow_rules/edit.html.erb
72
79
  app/views/re_plan_workflow_rules/edit.js.erb
73
80
  app/views/re_plan_workflow_rules/error.html.erb
@@ -104,24 +111,17 @@ class RulesEngineManifest
104
111
  app/views/re_plans/create.js.erb
105
112
  app/views/re_plans/edit.html.erb
106
113
  app/views/re_plans/edit.js.erb
114
+ app/views/re_plans/history.html.erb
115
+ app/views/re_plans/history.js.erb
107
116
  app/views/re_plans/index.html.erb
108
117
  app/views/re_plans/index.js.erb
109
118
  app/views/re_plans/new.html.erb
110
119
  app/views/re_plans/new.js.erb
111
120
  app/views/re_plans/preview.html.erb
112
121
  app/views/re_plans/preview.js.erb
113
- app/views/re_plans/re_process.html.erb
114
- app/views/re_plans/re_process.js.erb
115
122
  app/views/re_plans/show.html.erb
116
123
  app/views/re_plans/template.html.erb
117
124
  app/views/re_plans/update.js.erb
118
- app/views/re_processes/_index_prepare.html.erb
119
- app/views/re_processes/_index_update.html.erb
120
- app/views/re_processes/_show.html.erb
121
- app/views/re_processes/index.html.erb
122
- app/views/re_processes/index.js.erb
123
- app/views/re_processes/show.html.erb
124
- app/views/re_processes/show.js.erb
125
125
  app/views/re_publications/_show_prepare.html.erb
126
126
  app/views/re_publications/_show_update.html.erb
127
127
  app/views/re_publications/show.html.erb
@@ -190,11 +190,11 @@ class RulesEngineManifest
190
190
  public/javascripts/jquery.autocomplete.pack.js
191
191
  public/javascripts/jquery.blockUI.js
192
192
  public/javascripts/jquery.fancybox-1.3.1.js
193
+ public/javascripts/rules_engine/re_history_index.js
194
+ public/javascripts/rules_engine/re_history_show.js
193
195
  public/javascripts/rules_engine/re_plan_change.js
194
196
  public/javascripts/rules_engine/re_plan_new.js
195
197
  public/javascripts/rules_engine/re_plan_preview.js
196
- public/javascripts/rules_engine/re_process_index.js
197
- public/javascripts/rules_engine/re_process_show.js
198
198
  public/javascripts/rules_engine/re_publication_show.js
199
199
  public/javascripts/rules_engine/re_view.js
200
200
  public/javascripts/rules_engine/re_workflow_add.js
@@ -294,6 +294,10 @@ class RulesEngineManifest
294
294
  public/stylesheets/rules_engine/images/rules_engine/re_common/status-verify-14.png
295
295
  public/stylesheets/rules_engine/images/rules_engine/re_common/status-verify-18.png
296
296
  public/stylesheets/rules_engine/images/rules_engine/re_common/status-verify-25.png
297
+ public/stylesheets/rules_engine/images/rules_engine/re_history/error-14.png
298
+ public/stylesheets/rules_engine/images/rules_engine/re_history/info-14.png
299
+ public/stylesheets/rules_engine/images/rules_engine/re_history/list-25.png
300
+ public/stylesheets/rules_engine/images/rules_engine/re_history/success-14.png
297
301
  public/stylesheets/rules_engine/images/rules_engine/re_plan/alert-25.png
298
302
  public/stylesheets/rules_engine/images/rules_engine/re_plan/change-25.png
299
303
  public/stylesheets/rules_engine/images/rules_engine/re_plan/copy-25.png
@@ -307,10 +311,6 @@ class RulesEngineManifest
307
311
  public/stylesheets/rules_engine/images/rules_engine/re_plan/show-25.png
308
312
  public/stylesheets/rules_engine/images/rules_engine/re_plan/title-plural.png
309
313
  public/stylesheets/rules_engine/images/rules_engine/re_plan/title-single.png
310
- public/stylesheets/rules_engine/images/rules_engine/re_process/error-14.png
311
- public/stylesheets/rules_engine/images/rules_engine/re_process/info-14.png
312
- public/stylesheets/rules_engine/images/rules_engine/re_process/list-25.png
313
- public/stylesheets/rules_engine/images/rules_engine/re_process/success-14.png
314
314
  public/stylesheets/rules_engine/images/rules_engine/re_publication/show-25.png
315
315
  public/stylesheets/rules_engine/images/rules_engine/re_rule/add-14.png
316
316
  public/stylesheets/rules_engine/images/rules_engine/re_rule/alert-25.png
@@ -355,7 +355,14 @@ class RulesEngineManifest
355
355
  public/stylesheets/rules_engine/images/rules_engine/re_workflow/title-plural.png
356
356
  public/stylesheets/rules_engine/images/rules_engine/re_workflow/title-single.png
357
357
  public/stylesheets/rules_engine/screen.css
358
+ spec/controllers/re_application_controller_spec.rb
359
+ spec/controllers/re_history_controller_spec.rb
360
+ spec/controllers/re_plan_workflow_rules_controller_spec.rb
361
+ spec/controllers/re_plan_workflows_controller_spec.rb
358
362
  spec/controllers/re_plans_controller_spec.rb
363
+ spec/controllers/re_publications_controller_spec.rb
364
+ spec/controllers/re_workflow_rules_controller_spec.rb
365
+ spec/controllers/re_workflows_controller_spec.rb
359
366
  spec/helpers/rules_engine_helper_spec.rb
360
367
  spec/models/re_plan_spec.rb
361
368
  spec/models/re_plan_workflow_spec.rb
@@ -5,7 +5,7 @@ contents :
5
5
  - app/views/re_workflows
6
6
  - app/views/re_workflow_rules
7
7
  - app/views/re_publications
8
- - app/views/re_processes
8
+ - app/views/re_history
9
9
 
10
10
  - public/stylesheets/fancybox
11
11
  - public/stylesheets/blueprint
@@ -27,7 +27,7 @@ files :
27
27
  - app/controllers/re_workflows_controller.rb
28
28
  - app/controllers/re_workflow_rules_controller.rb
29
29
  - app/controllers/re_publications_controller.rb
30
- - app/controllers/re_processes_controller.rb
30
+ - app/controllers/re_history_controller.rb
31
31
 
32
32
  - app/helpers/rules_engine_helper.rb
33
33
 
@@ -61,7 +61,14 @@ files :
61
61
  - spec/models/re_rule_spec.rb
62
62
  - spec/models/re_workflow_spec.rb
63
63
 
64
- - spec/controllers/re_plans_controller_spec.rb
64
+ - spec/controllers/re_application_controller_spec.rb
65
+ - spec/controllers/re_history_controller_spec.rb
66
+ - spec/controllers/re_plan_workflow_rules_controller_spec.rb
67
+ - spec/controllers/re_plan_workflows_controller_spec.rb
68
+ - spec/controllers/re_plans_controller_spec.rb
69
+ - spec/controllers/re_publications_controller_spec.rb
70
+ - spec/controllers/re_workflow_rules_controller_spec.rb
71
+ - spec/controllers/re_workflows_controller_spec.rb
65
72
 
66
73
  - features/step_definitions/common/re_debug_steps.rb
67
74
  - features/step_definitions/common/re_error_steps.rb
@@ -0,0 +1,15 @@
1
+ class ReHistoryController < ApplicationController
2
+ helper :rules_engine
3
+ layout 'rules_engine'
4
+
5
+ # before_filter :login_required
6
+ before_filter :rules_engine_reader_access_required, :only => [:index, :show]
7
+
8
+ def index
9
+ @re_history = RulesEngine::Process.runner.history(nil, :page => params[:page] || 1, :per_page => 5)
10
+ end
11
+
12
+ def show
13
+ @re_audit_history = RulesEngine::Process.auditor.history(params[:id])
14
+ end
15
+ end
@@ -17,11 +17,6 @@ class RePlanWorkflowsController < ApplicationController
17
17
  controller.re_load_model :re_workflow, {:redirect_path => :change_re_plan_path}
18
18
  end
19
19
 
20
- def index
21
- klass = ReWorkflow
22
- @re_workflows = klass.find(:all)
23
- end
24
-
25
20
  def show
26
21
  end
27
22
 
@@ -103,11 +98,8 @@ class RePlanWorkflowsController < ApplicationController
103
98
  end
104
99
 
105
100
  def add
106
- if @re_plan.add_workflow(@re_workflow)
107
- flash[:success] = 'Workflow Added.'
108
- else
109
- flash[:error] = 'Cannot Add Workflow.'
110
- end
101
+ @re_plan.add_workflow(@re_workflow)
102
+ flash[:success] = 'Workflow Added.'
111
103
 
112
104
  respond_to do |format|
113
105
  format.html do
@@ -120,11 +112,8 @@ class RePlanWorkflowsController < ApplicationController
120
112
  end
121
113
 
122
114
  def remove
123
- if @re_plan.remove_workflow(@re_workflow)
124
- flash[:success] = 'Workflow Removed.'
125
- else
126
- flash[:error] = 'Cannot Remove Workflow.'
127
- end
115
+ @re_plan.remove_workflow(@re_workflow)
116
+ flash[:success] = 'Workflow Removed.'
128
117
 
129
118
  respond_to do |format|
130
119
  format.html do
@@ -137,23 +126,23 @@ class RePlanWorkflowsController < ApplicationController
137
126
  end
138
127
 
139
128
  def copy
140
- @re_workflow_new = ReWorkflow.new
129
+ @re_workflow_copy = ReWorkflow.new
141
130
  end
142
131
 
143
132
  def duplicate
144
- @re_workflow_new = ReWorkflow.new
145
- @re_workflow_new.revert!(@re_workflow.publish)
146
- @re_workflow_new.attributes = params[:re_workflow]
133
+ @re_workflow_copy = ReWorkflow.new
134
+ @re_workflow_copy.revert!(@re_workflow.publish)
135
+ @re_workflow_copy.attributes = params[:re_workflow]
147
136
 
148
- if @re_workflow_new.save
149
- @re_plan.add_workflow(@re_workflow_new)
137
+ if @re_workflow_copy.save
138
+ @re_plan.add_workflow(@re_workflow_copy)
150
139
  flash[:success] = 'Workflow Duplicated.'
151
140
  respond_to do |format|
152
141
  format.html do
153
- redirect_to(change_re_plan_workflow_path(@re_plan, @re_workflow_new))
142
+ redirect_to(change_re_plan_workflow_path(@re_plan, @re_workflow_copy))
154
143
  end
155
144
  format.js do
156
- render :inline => "window.location.href = '#{change_re_plan_workflow_path(@re_plan, @re_workflow_new)}';"
145
+ render :inline => "window.location.href = '#{change_re_plan_workflow_path(@re_plan, @re_workflow_copy)}';"
157
146
  end
158
147
  end
159
148
  else
@@ -4,9 +4,9 @@ class RePlansController < ApplicationController
4
4
 
5
5
  # before_filter :login_required
6
6
  before_filter :rules_engine_editor_access_required, :only => [:new, :create, :edit, :update, :destroy, :change, :publish, :revert, :copy, :duplicate]
7
- before_filter :rules_engine_reader_access_required, :only => [:index, :show, :preview, :re_process]
7
+ before_filter :rules_engine_reader_access_required, :only => [:index, :show, :preview, :history]
8
8
 
9
- before_filter :only => [:show, :edit, :update, :destroy, :change, :preview, :publish, :revert, :re_process, :copy, :duplicate] do |controller|
9
+ before_filter :only => [:show, :edit, :update, :destroy, :change, :preview, :publish, :revert, :history, :copy, :duplicate] do |controller|
10
10
  controller.re_load_model :re_plan
11
11
  end
12
12
 
@@ -125,27 +125,27 @@ class RePlansController < ApplicationController
125
125
  end
126
126
  end
127
127
 
128
- def re_process
129
- @re_processes = RulesEngine::Process.runner.history(@re_plan.code, :page => params[:page] || 1, :per_page => 5)
128
+ def history
129
+ @re_history = RulesEngine::Process.runner.history(@re_plan.code, :page => params[:page] || 1, :per_page => 5)
130
130
  end
131
131
 
132
132
  def copy
133
- @re_plan_new = RePlan.new
133
+ @re_plan_copy = RePlan.new
134
134
  end
135
135
 
136
136
  def duplicate
137
- @re_plan_new = RePlan.new
138
- @re_plan_new.revert!(@re_plan.publish)
139
- @re_plan_new.attributes = params[:re_plan]
137
+ @re_plan_copy = RePlan.new
138
+ @re_plan_copy.revert!(@re_plan.publish)
139
+ @re_plan_copy.attributes = params[:re_plan]
140
140
 
141
- if @re_plan_new.save
141
+ if @re_plan_copy.save
142
142
  flash[:success] = 'Plan Duplicated.'
143
143
  respond_to do |format|
144
144
  format.html do
145
- redirect_to(change_re_plan_path(@re_plan_new))
145
+ redirect_to(change_re_plan_path(@re_plan_copy))
146
146
  end
147
147
  format.js do
148
- render :inline => "window.location.href = '#{change_re_plan_path(@re_plan_new)}';"
148
+ render :inline => "window.location.href = '#{change_re_plan_path(@re_plan_copy)}';"
149
149
  end
150
150
  end
151
151
  else
@@ -16,6 +16,7 @@ class ReWorkflowRulesController < ApplicationController
16
16
 
17
17
  def help
18
18
  @rule_class = RulesEngine::Discovery.rule_class(params[:rule_class_name])
19
+
19
20
  if @rule_class.nil?
20
21
  flash[:error] = "#{params[:rule_class]} : class not found."
21
22
  render :error
@@ -37,7 +38,7 @@ class ReWorkflowRulesController < ApplicationController
37
38
 
38
39
  def create
39
40
  @re_rule = ReRule.new(:re_workflow_id => @re_workflow.id, :rule_class_name => params[:rule_class_name])
40
- if @re_rule.rule.nil?
41
+ if @re_rule.rule.nil?
41
42
  render :action => "error"
42
43
  return
43
44
  end
@@ -95,22 +95,22 @@ class ReWorkflowsController < ApplicationController
95
95
  end
96
96
 
97
97
  def copy
98
- @re_workflow_new = ReWorkflow.new
98
+ @re_workflow_copy = ReWorkflow.new
99
99
  end
100
100
 
101
101
  def duplicate
102
- @re_workflow_new = ReWorkflow.new
103
- @re_workflow_new.revert!(@re_workflow.publish)
104
- @re_workflow_new.attributes = params[:re_workflow]
102
+ @re_workflow_copy = ReWorkflow.new
103
+ @re_workflow_copy.revert!(@re_workflow.publish)
104
+ @re_workflow_copy.attributes = params[:re_workflow]
105
105
 
106
- if @re_workflow_new.save
106
+ if @re_workflow_copy.save
107
107
  flash[:success] = 'Workflow Duplicated.'
108
108
  respond_to do |format|
109
109
  format.html do
110
- redirect_to(change_re_workflow_path(@re_workflow_new))
110
+ redirect_to(change_re_workflow_path(@re_workflow_copy))
111
111
  end
112
112
  format.js do
113
- render :inline => "window.location.href = '#{change_re_workflow_path(@re_workflow_new)}';"
113
+ render :inline => "window.location.href = '#{change_re_workflow_path(@re_workflow_copy)}';"
114
114
  end
115
115
  end
116
116
  else
@@ -16,7 +16,7 @@ module RulesEngineHelper
16
16
  "Ver.#{re_plan.plan_version}"
17
17
  end
18
18
 
19
- def re_process_status process_status
19
+ def re_history_status process_status
20
20
  case process_status.to_i
21
21
  when RulesEngine::Process::PROCESS_STATUS_RUNNING
22
22
  'running'
@@ -62,7 +62,7 @@ class RePlan < ActiveRecord::Base
62
62
  workflow_data = rule_data["workflow_#{rule_data["workflow"]}"]
63
63
  while (workflow_data && orig_re_workflows.length < 500)
64
64
  workflow_code = workflow_data["code"]
65
- re_workflow = ReWorkflow.find_by_code(workflow_code) || ReWorkflow.new(:code => workflow_code)
65
+ re_workflow = ReWorkflow.find_by_code(workflow_code) || ReWorkflow.new
66
66
  re_workflow.revert!(workflow_data)
67
67
  orig_re_workflows << re_workflow
68
68
 
@@ -41,8 +41,7 @@ class ReRule < ActiveRecord::Base
41
41
  end
42
42
 
43
43
  def publish
44
- { "uuid" => id,
45
- "rule_class_name" => rule_class_name,
44
+ { "rule_class_name" => rule_class_name,
46
45
  "title" => title,
47
46
  "summary" => summary,
48
47
  "data" => data
@@ -40,15 +40,7 @@ class ReWorkflow < ActiveRecord::Base
40
40
  self.title = rule_data["title"]
41
41
  self.description = rule_data["description"]
42
42
 
43
- # self.re_rules = (rule_data["rules"] || []).map { |rule| ReRule.new.revert!(rule) }
44
- orig_re_rules = []
45
- (rule_data["rules"] || []).each do |rule|
46
- re_rule = ReRule.find_by_id(rule["uuid"]) || ReRule.new
47
- re_rule.revert!(rule)
48
- orig_re_rules << re_rule
49
- end
50
-
51
- self.re_rules = orig_re_rules
43
+ self.re_rules = (rule_data["rules"] || []).map { |rule| ReRule.new.revert!(rule) }
52
44
  self
53
45
  end
54
46
 
@@ -0,0 +1,12 @@
1
+ <h4>
2
+ <div class="re-menu-history-list" id="re_menu_process_list_<%= re_plan_id %>">Process History</div>
3
+ </h4>
4
+
5
+ <div class="clear top-5"></div>
6
+ <div id="re_history_list_pending">
7
+ <div class="re-xtra-history-list-pending">
8
+ Updating Processes
9
+ </div>
10
+ </div>
11
+ <div id="re_history_list">
12
+ </div>
@@ -0,0 +1,20 @@
1
+ <% if @re_history.nil? || @re_history["processes"].nil? || @re_history["processes"].empty? %>
2
+ <h6 class="left-50 red"><em>Not Processed</em></h6>
3
+ <% else %>
4
+ <% @re_history["processes"].each do |re_process| %>
5
+ <div class="clear top-2"></div>
6
+ <div class="left-10 right-5">
7
+ <a class="re-code-small float-left re-xtra-history-show re-xtra-history-<%= re_history_status(re_process["process_status"]) %>" href="#<%= re_process["process_id"] %>">
8
+ <%= re_process["plan_code"] %> <span class="blue">V.<%= re_process["plan_version"] %></span>
9
+ </a>
10
+ <div class="smalltext float-right right-5">
11
+ <%= re_process["started_at"].nil? ? '' : Time.parse(re_process["started_at"]).strftime('%d %b %Y - %H:%M') %>
12
+ </div>
13
+ <hr/>
14
+ </div>
15
+ <% end %>
16
+ <% if !@re_history["processes"].empty? && (@re_history["next_page"] || @re_history["previous_page"]) %>
17
+ <a class="re-xtra-history-next-<%= @re_history["next_page"] ? 'enabled' : 'disabled' %>" href='#<%= @re_history["next_page"] || '1' %>'></a>
18
+ <a class="re-xtra-history-prev-<%= @re_history["previous_page"] ? 'enabled' : 'disabled' %>" href='#<%= @re_history["previous_page"] || '1' %>'></a>
19
+ <% end %>
20
+ <% end %>
@@ -0,0 +1,30 @@
1
+ <div class="clear span-18">
2
+ <div class="re-infobox">
3
+ <h3 class="re-hdr-history-show"> Process Audit</h3>
4
+ <div class="clear top-10"></div>
5
+ <% if @re_audit_history.nil? || @re_audit_history["audits"].nil? || @re_audit_history["audits"].empty? %>
6
+ <h6 class="left-50 red"><em>No Audit History</em></h6>
7
+ <% else %>
8
+ <% @re_audit_history["audits"].each do |re_audit| %>
9
+ <div class="clear top-2"></div>
10
+ <div class="left-10 right-5">
11
+ <div class="re-code-small float-left re-xtra-history-audit-<%= re_audit_status(re_audit["code"]) %>">
12
+ <%= re_audit["message"] %>
13
+ </div>
14
+ <div class="smalltext float-right right-5">
15
+ <%= re_audit["created_at"].nil? ? '' : Time.parse(re_audit["created_at"]).strftime('%d %b %Y - %H:%M') %>
16
+ </div>
17
+ <hr/>
18
+ </div>
19
+
20
+ <% end %>
21
+ <% if !@re_audit_history["audits"].empty? && (@re_audit_history["next_page"] || @re_audit_history["previous_page"]) %>
22
+ <a class="re-xtra-history-next-<%= @re_audit_history["next_page"] ? 'enabled' : 'disabled' %>" href='#<%= @re_audit_history["next_page"] || '1' %>'></a>
23
+ <a class="re-xtra-history-prev-<%= @re_audit_history["previous_page"] ? 'enabled' : 'disabled' %>" href='#<%= @re_audit_history["previous_page"] || '1' %>'></a>
24
+ <% end %>
25
+ <% end %>
26
+ <%= re_button_link_orange('Close', re_history_index_path, :id => "re_history_show_close") %>
27
+ <div class="clear top-5"></div>
28
+ </div>
29
+ </div>
30
+ <div class="clear"></div>