mutx 0.1.69 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/documentation/repos.md +21 -24
  4. data/lib/generators/task_rack.rb +8 -2
  5. data/lib/generators/templates/config.ru.tt +1 -1
  6. data/lib/mutx/API/execution.rb +8 -44
  7. data/lib/mutx/API/repo.rb +7 -10
  8. data/lib/mutx/background_jobs/workers/executor.rb +44 -38
  9. data/lib/mutx/commands/install.rb +1 -1
  10. data/lib/mutx/commands/start.rb +1 -1
  11. data/lib/mutx/custom/execution.rb +1 -1
  12. data/lib/mutx/database/mongo_connector.rb +19 -22
  13. data/lib/mutx/execution.rb +1 -0
  14. data/lib/mutx/lib/authentication.rb +23 -0
  15. data/lib/mutx/lib/helpers.rb +52 -0
  16. data/lib/mutx/lib/middlewares/database_middleware.rb +16 -0
  17. data/lib/mutx/lib/middlewares/flash_middleware.rb +31 -0
  18. data/lib/mutx/lib/middlewares/logger_middleware.rb +13 -0
  19. data/lib/mutx/lib/monkey_patch.rb +28 -0
  20. data/lib/mutx/lib/paths.rb +80 -0
  21. data/lib/mutx/platforms/ruby.rb +8 -0
  22. data/lib/mutx/public/css/bootstrap.min.css +7 -0
  23. data/lib/mutx/public/css/font-awesome.min.css +4 -0
  24. data/lib/mutx/public/css/jquery.json-viewer.css +44 -0
  25. data/{favicon.ico → lib/mutx/public/img/favicon.ico} +0 -0
  26. data/lib/mutx/public/js/bootstrap.min.js +6 -0
  27. data/lib/mutx/public/js/jquery.json-viewer.js +148 -0
  28. data/lib/mutx/public/js/jquery.min.js +6 -0
  29. data/lib/mutx/{view/javascript.mote → public/js/mutx.js} +0 -5
  30. data/lib/mutx/public/js/notify.min.js +1 -0
  31. data/lib/mutx/results/result.rb +60 -68
  32. data/lib/mutx/results/results.rb +4 -0
  33. data/lib/mutx/routes.rb +85 -883
  34. data/lib/mutx/routes/admin_routes.rb +16 -0
  35. data/lib/mutx/routes/admin_routes/custom_params_routes.rb +97 -0
  36. data/lib/mutx/routes/admin_routes/repositories_routes.rb +35 -0
  37. data/lib/mutx/routes/admin_routes/tasks_routes.rb +110 -0
  38. data/lib/mutx/routes/api_routes.rb +49 -0
  39. data/lib/mutx/routes/api_routes/custom_params_routes.rb +41 -0
  40. data/lib/mutx/routes/api_routes/input_routes.rb +48 -0
  41. data/lib/mutx/routes/api_routes/repos_routes.rb +74 -0
  42. data/lib/mutx/routes/api_routes/results_routes.rb +50 -0
  43. data/lib/mutx/routes/api_routes/tasks_routes.rb +47 -0
  44. data/lib/mutx/routes/api_routes/tests_routes.rb +42 -0
  45. data/lib/mutx/routes/features_routes.rb +24 -0
  46. data/lib/mutx/routes/help_routes.rb +23 -0
  47. data/lib/mutx/routes/logs_routes.rb +22 -0
  48. data/lib/mutx/routes/message_routes.rb +24 -0
  49. data/lib/mutx/routes/repositories_routes.rb +25 -0
  50. data/lib/mutx/routes/results_routes.rb +53 -0
  51. data/lib/mutx/routes/task_results_routes.rb +25 -0
  52. data/lib/mutx/routes/tasks_routes.rb +67 -0
  53. data/lib/mutx/routes/tests_routes.rb +66 -0
  54. data/lib/mutx/support/change_inspector.rb +3 -3
  55. data/lib/mutx/support/files_cleanner.rb +12 -3
  56. data/lib/mutx/support/git.rb +11 -2
  57. data/lib/mutx/support/processes.rb +2 -2
  58. data/lib/mutx/support/project_type.rb +12 -0
  59. data/lib/mutx/tasks/task.rb +8 -2
  60. data/lib/mutx/version.rb +1 -1
  61. data/lib/mutx/view/{custom/params/delete_form.mote → admin/custom-params/_delete_form.mote} +2 -4
  62. data/lib/mutx/view/{custom/params/create_edit_form.mote → admin/custom-params/_form.mote} +5 -9
  63. data/lib/mutx/view/{custom/params/custom_param_task_deleting_box.mote → admin/custom-params/_task_deleting_box.mote} +1 -2
  64. data/lib/mutx/view/{custom/params → admin/custom-params}/delete.mote +1 -3
  65. data/lib/mutx/view/{custom/params → admin/custom-params}/edit.mote +1 -5
  66. data/lib/mutx/view/{custom/params/list.mote → admin/custom-params/index.mote} +8 -13
  67. data/lib/mutx/view/{custom/params → admin/custom-params}/new.mote +1 -5
  68. data/lib/mutx/view/{custom/params/custom_param_selection_box.mote → admin/custom-params/selection_box.mote} +2 -3
  69. data/lib/mutx/view/{list_repos.mote → admin/repositories/index.mote} +2 -6
  70. data/lib/mutx/view/{repos.mote → admin/repositories/new.mote} +2 -6
  71. data/lib/mutx/view/{tasks/admin/delete_form.mote → admin/tasks/_delete_form.mote} +2 -12
  72. data/lib/mutx/view/{tasks/admin/create_edit_form.mote → admin/tasks/_form.mote} +6 -9
  73. data/lib/mutx/view/{tasks/admin → admin/tasks}/delete.mote +1 -3
  74. data/lib/mutx/view/{tasks/admin → admin/tasks}/edit.mote +1 -4
  75. data/lib/mutx/view/{tasks/admin/list.mote → admin/tasks/index.mote} +5 -10
  76. data/lib/mutx/view/{tasks/admin → admin/tasks}/new.mote +1 -5
  77. data/lib/mutx/view/{tasks/admin/view.mote → admin/tasks/show.mote} +1 -3
  78. data/lib/mutx/view/body.mote +13 -51
  79. data/lib/mutx/view/{custom/params.mote → custom-params/_custom_params.mote} +3 -4
  80. data/lib/mutx/view/{custom/params → custom-params/types}/json.mote +0 -0
  81. data/lib/mutx/view/{custom/params → custom-params/types}/select_list.mote +0 -0
  82. data/lib/mutx/view/{custom/params → custom-params/types}/text.mote +0 -0
  83. data/lib/mutx/view/error_handler.mote +4 -54
  84. data/lib/mutx/view/features/{feature.mote → file.mote} +0 -0
  85. data/lib/mutx/view/features/index.mote +9 -0
  86. data/lib/mutx/view/git_information.mote +2 -8
  87. data/lib/mutx/view/help/{main.mote → _main.mote} +0 -0
  88. data/lib/mutx/view/help/{page.mote → _page.mote} +0 -0
  89. data/lib/mutx/view/help/{search_result.mote → _search_result.mote} +0 -0
  90. data/lib/mutx/view/help/index.mote +38 -0
  91. data/lib/mutx/view/layout/flash.mote +7 -0
  92. data/lib/mutx/view/{footer.mote → layout/footer.mote} +1 -1
  93. data/lib/mutx/view/layout/javascript.mote +6 -0
  94. data/lib/mutx/view/{modals.mote → layout/modals.mote} +0 -0
  95. data/lib/mutx/view/layout/navigation_bar.mote +88 -0
  96. data/lib/mutx/view/{styles.mote → layout/styles.mote} +10 -0
  97. data/lib/mutx/view/logs/{logs.mote → index.mote} +1 -1
  98. data/lib/mutx/view/logs/show.mote +3 -0
  99. data/lib/mutx/view/repositories/_repository.mote +7 -0
  100. data/lib/mutx/view/repositories/index.mote +23 -0
  101. data/lib/mutx/view/repositories/show.mote +21 -0
  102. data/lib/mutx/view/results/{detailed_info.mote → _result.mote} +5 -5
  103. data/lib/mutx/view/results/console.mote +63 -106
  104. data/lib/mutx/view/results/{all.mote → index.mote} +18 -24
  105. data/lib/mutx/view/sections.rb +36 -24
  106. data/lib/mutx/view/task_results/_result.mote +57 -0
  107. data/lib/mutx/view/{results/result.mote → task_results/_result_item.mote} +6 -5
  108. data/lib/mutx/view/task_results/index.mote +35 -0
  109. data/lib/mutx/view/tasks/_task.mote +90 -0
  110. data/lib/mutx/view/tasks/index.mote +61 -0
  111. data/lib/mutx/view/tasks/show.mote +167 -0
  112. data/lib/mutx/view/tests/_test.mote +90 -0
  113. data/lib/mutx/view/tests/index.mote +59 -0
  114. data/lib/mutx/view/tests/show.mote +172 -0
  115. data/lib/mutx/view/view.rb +172 -10
  116. metadata +89 -50
  117. data/lib/mutx/database/middleware.rb +0 -18
  118. data/lib/mutx/view/features.mote +0 -57
  119. data/lib/mutx/view/features/features_list.mote +0 -10
  120. data/lib/mutx/view/help.mote +0 -75
  121. data/lib/mutx/view/logs/log.mote +0 -3
  122. data/lib/mutx/view/message.mote +0 -8
  123. data/lib/mutx/view/navigation_bar.mote +0 -67
  124. data/lib/mutx/view/results/results.mote +0 -112
  125. data/lib/mutx/view/tasks/message.mote +0 -37
  126. data/lib/mutx/view/tasks/task.mote +0 -167
  127. data/lib/mutx/view/tasks/task_item.mote +0 -77
  128. data/lib/mutx/view/tasks/tasks.mote +0 -74
@@ -26,6 +26,6 @@ module Mutx
26
26
  end
27
27
  end
28
28
 
29
- end
30
- end
31
- end
29
+ end # ChangeInspector
30
+ end # Support
31
+ end # Mutx
@@ -15,6 +15,8 @@ module Mutx
15
15
 
16
16
  end
17
17
 
18
+ # Returns true if delete fiven file_name
19
+ # @param [String] file_name
18
20
  def self.delete_file file_name
19
21
  begin
20
22
  File.delete("#{file_name}") and true
@@ -34,15 +36,22 @@ module Mutx
34
36
  report = all_mutx_reports.select do |file|
35
37
  file.include? text
36
38
  end.first
37
-
38
- delete_file(report)
39
+ if delete_file(report)
40
+ Mutx::Support::Log.debug "Execution files(id=#{result.id}) cleanned" and true
41
+ else
42
+ false
43
+ end
39
44
  end
40
45
 
41
46
  def self.delete_html_report_for result_id
42
47
  file = all_mutx_reports.select do |file|
43
48
  file.include? result_id
44
49
  end.first
45
- delete_file(file) if file
50
+ if file
51
+ delete_file(file) and true
52
+ else
53
+ false
54
+ end
46
55
  end
47
56
 
48
57
  def self.all_mutx_reports
@@ -157,7 +157,6 @@ module Mutx
157
157
 
158
158
  def self.log
159
159
  res = Mutx::Support::Console.execute "git log"
160
-
161
160
  end
162
161
 
163
162
  def self.log_last_commit
@@ -168,10 +167,20 @@ module Mutx
168
167
  self.commits.first
169
168
  end
170
169
 
170
+ # Returns an Array of changed files on last commit
171
+ # @return [Array] ["path/file_1","path/file_2".."path/file_n"]
172
+ def self.changed_files_on_last_commit
173
+ res = Mutx::Support::Console.execute("git diff-tree --no-commit-id --name-only -r #{self.get_last_commit_id}")
174
+ res.split(" ")
175
+ end
176
+
177
+ # Returns true if the obtained commit is different from the last saved commit
178
+ # @return [Bool]
171
179
  def self.is_there_commit_id_diff? obtained_commit
172
- obtained_commit != self.last_commit_id
180
+ obtained_commit != self.get_last_commit_id
173
181
  end
174
182
 
183
+
175
184
  def self.remote_url
176
185
  res = Mutx::Support::Console.execute("git config --get remote.origin.url").split("\n").first.gsub(":","/").gsub("git@", 'http://').chop
177
186
  res[0..-5] if res.end_with? ".git"
@@ -31,10 +31,10 @@ module Mutx
31
31
  end
32
32
 
33
33
  def self.kill_p(pid)
34
+ return false if pid.nil?
34
35
  pid = pid.to_i if pid.respond_to? :to_i
35
36
  begin
36
- Process.kill('INT', pid)
37
- true
37
+ Process.kill('INT', pid) and true
38
38
  rescue => e
39
39
  puts "#{e} [#{pid}]"
40
40
  false
@@ -0,0 +1,12 @@
1
+ module Mutx
2
+ module Support
3
+ module ProjectType
4
+
5
+ # Returns true if there is a folder called /features and there is files .feature extension within
6
+ def self.cucumber?
7
+ !Dir["features/**/*.feature"].empty?
8
+ end
9
+
10
+ end
11
+ end
12
+ end
@@ -67,7 +67,7 @@ module Mutx
67
67
  @framework = task_data["framework"]
68
68
  @command = task_data["command"]
69
69
  @custom_params = task_data["custom_params"] || []
70
- @information = task_data["information"]
70
+ @information = task_data["information"] if (task_data["information"] and task_data["information"] != "")
71
71
  @running_execs = []
72
72
  @cucumber = task_data["cucumber"]
73
73
  @cucumber_report = task_data["cucumber_report"]
@@ -263,6 +263,12 @@ module Mutx
263
263
  end
264
264
  end
265
265
 
266
+ def switch!
267
+ @task_status = @task_status == "on" ? "off" : "on"
268
+ self.save!
269
+ @task_status
270
+ end
271
+
266
272
  def task_data_for task_name
267
273
  Mutx::Database::MongoConnector.task_data_for(task_name)
268
274
  end
@@ -321,7 +327,7 @@ module Mutx
321
327
  self.type == "test"
322
328
  end
323
329
 
324
- def push_exec result_id
330
+ def push_exec! result_id
325
331
  @running_execs << result_id
326
332
  self.save!
327
333
  end
@@ -1,3 +1,3 @@
1
1
  module Mutx
2
- VERSION = "0.1.69"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,10 +1,9 @@
1
1
  <?
2
- custom_param = Mutx::Tasks::Custom::Param.get(args[:custom_param_id]).structure
3
2
  types = Mutx::Tasks::Custom::Param.types
4
3
  options = custom_param["options"].join(",").gsub("none,","")
5
4
  ?>
6
5
  <nav class="navbar navbar-default">
7
- <form name="delete-custom-param" id="delete-custom-param" action="/admin/delete-custom-param" method="POST">
6
+ <form name="delete-custom-param" id="delete-custom-param" action="{{ path_for(:admin_custom_params_destroy, custom_param_id: custom_param["_id"]) }}" method="POST">
8
7
  <div class='form-group'>
9
8
  <br>
10
9
  <label class='col-sm-2 control-label' for='formGroupInputSmall'>
@@ -36,8 +35,7 @@ options = custom_param["options"].join(",").gsub("none,","")
36
35
  % elsif custom_param["type"]=="json"
37
36
  <div class='form-group'>
38
37
  <label class='col-sm-2 control-label' for='formGroupInputSmall'>Value</label>
39
- % param_representation = Mote.parse(File.read("#{Mutx::View.path}/custom/params/json.mote"), self, [:param, :no_label]).call(param:custom_param, no_label:true)
40
- {{param_representation}}
38
+ {{ partial('custom-params/types/json', param: custom_param, no_label: true) }}
41
39
  </div>
42
40
  %end
43
41
  <div class='form-group'>
@@ -1,10 +1,5 @@
1
1
  <?
2
-
3
- query_string = args[:query_string]
4
-
5
- action = args[:action]
6
2
  if action=="edit"
7
- custom_param = Mutx::Tasks::Custom::Param.get(args[:custom_param_id]).structure
8
3
  name = custom_param["name"]
9
4
  type = custom_param["type"]
10
5
  value = custom_param["value"]
@@ -16,8 +11,9 @@ if action=="edit"
16
11
  else
17
12
  value.gsub('"=>"','":"') if type=="json"
18
13
  end
19
-
20
-
14
+ path = path_for(:admin_custom_params_update, custom_param_id: custom_param['_id'])
15
+ else
16
+ path = path_for(:admin_custom_params_create)
21
17
  end
22
18
 
23
19
 
@@ -60,7 +56,7 @@ types.unshift("Select...") unless types.include? "Select..."
60
56
  </script>
61
57
 
62
58
  <nav class="navbar navbar-default">
63
- <form name="custom-param" id="custom-param" action="/admin/custom-param" method="POST">
59
+ <form name="custom-param" id="custom-param" action="{{ path }}" method="POST">
64
60
  <div class='form-group'>
65
61
  <br>
66
62
  <label class='col-sm-2 control-label' for='formGroupInputSmall'>
@@ -102,7 +98,7 @@ types.unshift("Select...") unless types.include? "Select..."
102
98
  <br>
103
99
  <div class='form-group'>
104
100
  <label class='col-sm-2 control-label' for='formGroupInputSmall'></label>
105
- <input type="submit" class="btn btn-success" value="Save">&nbsp;<a class="btn btn-danger" href="/admin/custom/params">Cancel</a>
101
+ <input type="submit" class="btn btn-success" value="Save">&nbsp;<a class="btn btn-danger" href="{{ path_for(:admin_custom_params_index) }}">Cancel</a>
106
102
  </div>
107
103
  <br>
108
104
  </form>
@@ -17,8 +17,7 @@
17
17
  <label class='control-label' for='formGroupInputSmall'>{{custom_param['name']}}</label>&nbsp;
18
18
  </td>
19
19
  <td>
20
- % custom_param_template = Mote.parse(File.read("#{Mutx::View.path}/custom/params/#{custom_param["type"]}.mote"), self, [:param, :no_label, :task_form])
21
- {{custom_param_template.call(param:custom_param, no_label:true, task_form:true)}}
20
+ {{ partial("custom-params/types/#{custom_param["type"]}", param: custom_param, no_label: true, task_form: true) }}
22
21
  </td>
23
22
  </tr>
24
23
  % end
@@ -1,5 +1,3 @@
1
- % form_template = Mote.parse(File.read("#{Mutx::View.path}/custom/params/delete_form.mote"), self, [:args])
2
-
3
1
  <div class="panel panel-info">
4
2
  <!-- Default panel contents -->
5
3
  <div class="panel-heading"><h2>Delete Custom Parameter</h2></div>
@@ -9,7 +7,7 @@
9
7
 
10
8
  <div class="panel-success">
11
9
  <div class="panel-body">
12
- {{form_template.call(args:args)}}
10
+ {{ partial('admin/custom-params/_delete_form', custom_param: custom_param) }}
13
11
  </div>
14
12
  </div>
15
13
  </div>
@@ -1,5 +1,3 @@
1
- % form_template = Mote.parse(File.read("#{Mutx::View.path}/custom/params/create_edit_form.mote"), self, [:args])
2
- % args["action"]="edit"
3
1
  <div class="panel panel-info">
4
2
  <!-- Default panel contents -->
5
3
  <div class="panel-heading"><h2>Edit Custom Parameter</h2></div>
@@ -9,9 +7,7 @@
9
7
 
10
8
  <div class="panel-warning">
11
9
  <div class="panel-body">
12
-
13
- {{form_template.call(args:args)}}
14
-
10
+ {{ partial('admin/custom-params/_form', action: 'edit', custom_param: custom_param)}}
15
11
  </div>
16
12
  </div>
17
13
  </div>
@@ -1,22 +1,18 @@
1
- <?
2
- custom_params_list = Mutx::API::CustomParams.list
3
- ?>
4
-
5
1
  <div class="panel panel-default">
6
2
  <!-- Default panel contents -->
7
3
  <div class="panel-heading"><h2>Custom Parameters</h2></div>
8
4
  <div class="panel-body">
9
- <p><a class="btn btn-success" href="/admin/custom/params/new">New Custom Param</a></p>
5
+ <p><a class="btn btn-success" href="{{ path_for(:admin_custom_params_new) }}">New Custom Param</a></p>
10
6
  </div>
11
7
 
12
8
  <div class="panel-success">
13
9
  <div class="panel-body">
14
10
  <!-- Table -->
15
11
  <table class="table">
16
- % unless custom_params_list.empty?
12
+ % unless custom_params.empty?
17
13
  <thead>
18
14
  <tr>
19
- % custom_params_list.first.keys.select{|key| !(["action","options","value"].include? key)}.each do |header|
15
+ % custom_params.first.keys.select{|key| !(["action","options","value"].include? key)}.each do |header|
20
16
  <td><b>{{header.gsub(/(-|_)/," ").capitalize}}</b></td>
21
17
  % end
22
18
  <td><b>Representation</b></td>
@@ -24,7 +20,7 @@
24
20
  </tr>
25
21
  </thead>
26
22
  <tbody>
27
- % custom_params_list.each do |custom_param|
23
+ % custom_params.each do |custom_param|
28
24
  <tr>
29
25
  % custom_param.select{|key,value| !(["options","value"].include? key)}.each_pair do |key, value|
30
26
  <?
@@ -37,14 +33,13 @@
37
33
  {{value}}
38
34
  </td>
39
35
  %end
40
- <td>
41
- % param_representation = Mote.parse(File.read("#{Mutx::View.path}/custom/params/#{custom_param["type"]}.mote"), self, [:param, :no_label, :task_form]).call(param:custom_param, no_label:true, task_form:false)
42
- {{param_representation}}
36
+ <td>
37
+ {{ partial("custom-params/types/#{custom_param["type"]}", param:custom_param, no_label:true, task_form:false) }}
43
38
  </td>
44
39
  <td>
45
40
  <div class="btn-group">
46
- <a href="/admin/custom/params/{{custom_param["_id"]}}/edit"><button type="button" class="btn btn-info">Edit</button></a>
47
- <a href="/admin/custom/params/{{custom_param["_id"]}}/delete"><button type="button" class="btn btn-danger">Delete</button></a>
41
+ <a href="{{ path_for(:admin_custom_params_edit, custom_param_id: custom_param["_id"]) }}"><button type="button" class="btn btn-info">Edit</button></a>
42
+ <a href="{{ path_for(:admin_custom_params_delete, custom_param_id: custom_param["_id"]) }}"><button type="button" class="btn btn-danger">Delete</button></a>
48
43
  </div>
49
44
  </td>
50
45
  </tr>
@@ -1,5 +1,3 @@
1
- % form_template = Mote.parse(File.read("#{Mutx::View.path}/custom/params/create_edit_form.mote"), self, [:args])
2
- % args["action"]="edit"
3
1
  <div class="panel panel-info">
4
2
  <!-- Default panel contents -->
5
3
  <div class="panel-heading"><h2>New Custom Parameter</h2></div>
@@ -9,9 +7,7 @@
9
7
 
10
8
  <div class="panel-success">
11
9
  <div class="panel-body">
12
-
13
- {{form_template.call(args:args)}}
14
-
10
+ {{ partial('admin/custom-params/_form', action: 'new', custom_param: nil) }}
15
11
  </div>
16
12
  </div>
17
13
  </div>
@@ -14,9 +14,8 @@ custom_params_list = Mutx::API::CustomParams.list
14
14
  <label class='control-label' for='formGroupInputSmall'>{{custom_param['name']}}</label>&nbsp;
15
15
  </td>
16
16
  <td>
17
- % custom_param_template = Mote.parse(File.read("#{Mutx::View.path}/custom/params/#{custom_param["type"]}.mote"), self, [:param, :no_label, :task_form])
18
- {{custom_param_template.call(param:custom_param, no_label:true, task_form:true)}}
17
+ {{ partial("custom-params/types/#{custom_param['type']}", param: custom_param, no_label: true, task_form: true) }}
19
18
  </td>
20
19
  </tr>
21
20
  % end
22
- </table>
21
+ </table>
@@ -1,13 +1,9 @@
1
- <?
2
- repo_list = Mutx::Database::MongoConnector.all_repos
3
- ?>
4
-
5
1
  <div class="panel panel-success">
6
2
  <!-- Default panel contents -->
7
3
  <div class="panel-heading"><h2>Listing Repos</h2><h5><a href="#" title="Click here to know what this means" class="label label-info" aria-hidden="true" data-toggle="modal" data-target="#myModal" onclick="javascript:info('Update Repo', 'To update a repo the path must be: /:token/:repo_name . Send value in body as application/json { foo: bar, foo_1: bar_1 } . Without a valid token you cannot update');">
8
4
  ?</a></h5></div>
9
5
  <div class="panel-body">
10
- <p><a class="btn btn-success" href="/admin/repositories">New Repo</a></p>
6
+ <p><a class="btn btn-success" href="{{ path_for(:admin_repositories_new) }}">New Repo</a></p>
11
7
  </div>
12
8
  <div class="panel-success">
13
9
  <div class="panel-body">
@@ -21,7 +17,7 @@
21
17
  </tr>
22
18
  </thead>
23
19
  <tbody>
24
- % repo_list.each do |repo|
20
+ % repositories.each do |repo|
25
21
  <tr>
26
22
  <td>{{repo[:repo_name]}}</td>
27
23
  <td>{{repo[:repo_token]}}</td>
@@ -1,8 +1,4 @@
1
1
  <?
2
-
3
- query_string = args[:query_string]
4
-
5
- action = args[:action]
6
2
  if action=="edit"
7
3
  custom_param = Mutx::Tasks::Custom::Param.get(args[:custom_param_id]).structure
8
4
  name = custom_param["name"]
@@ -34,7 +30,7 @@ types.unshift("Select...") unless types.include? "Select..."
34
30
  ?>
35
31
  <div class="panel-heading"><h2>New Repo</h2></div>
36
32
  <nav class="navbar navbar-default">
37
- <form name="create-repo" id="create-repo" action="/admin/create-repo" method="POST">
33
+ <form name="create-repo" id="create-repo" action="{{ path_for(:admin_repositories_create) }}" method="POST">
38
34
  <div class='form-group'>
39
35
  <br>
40
36
  <label class='col-sm-2 control-label' for='formGroupInputSmall'>
@@ -44,7 +40,7 @@ types.unshift("Select...") unless types.include? "Select..."
44
40
  </div>
45
41
  <div class='form-group'>
46
42
  <label class='col-sm-2 control-label' for='formGroupInputSmall'></label>
47
- <input type="submit" class="btn btn-success" value="Save">&nbsp;<a class="btn btn-danger" href="/admin/list/repositories">Cancel</a>
43
+ <input type="submit" class="btn btn-success" value="Save">&nbsp;<a class="btn btn-danger" href="{{ path_for(:admin_repositories_index) }}">Cancel</a>
48
44
  </div>
49
45
  <br>
50
46
  </form>
@@ -1,13 +1,4 @@
1
- <?
2
-
3
- query_string = args[:query_string]
4
-
5
- task = Mutx::Tasks::Task.get(args[:task_id]).task_data_structure
6
-
7
-
8
- ?>
9
-
10
- <form name="custom-param" id="custom-param" action="/admin/tasks/delete" method="POST">
1
+ <form name="custom-param" id="custom-param" action="{{ path_for(:admin_tasks_destroy, task_id: task["_id"]) }}" method="POST">
11
2
  <nav class="navbar navbar-default">
12
3
  <table width="100%">
13
4
  <tr>
@@ -67,8 +58,7 @@ task = Mutx::Tasks::Task.get(args[:task_id]).task_data_structure
67
58
  <table>
68
59
  <tr>
69
60
  <td>
70
- % custom_param_selection_box = Mote.parse(File.read("#{Mutx::View.path}/custom/params/custom_param_task_deleting_box.mote"), self, [:custom_params]).call(custom_params:task["custom_params"])
71
- {{custom_param_selection_box}}
61
+ {{ partial('admin/custom-params/task_deleting_box', custom_params: task["custom_params"]) }}
72
62
  </td>
73
63
  </tr>
74
64
  </table>
@@ -1,10 +1,6 @@
1
1
  <?
2
2
 
3
- query_string = args[:query_string]
4
-
5
- action = args[:action]
6
3
  if ["edit","view"].include? action
7
- task = Mutx::Tasks::Task.get(args[:task_id]).task_data_structure
8
4
  name = task["name"]
9
5
  type = task["type"]
10
6
  value = task["value"]
@@ -60,7 +56,9 @@ if ["edit","view"].include? action
60
56
  else
61
57
  active_if_notify_on_any = "active"
62
58
  end
63
-
59
+ path = :admin_tasks_update
60
+ else
61
+ path = :admin_tasks_create
64
62
  end
65
63
 
66
64
 
@@ -102,7 +100,7 @@ application = task["application"].upcase if task
102
100
 
103
101
  </script>
104
102
 
105
- <form name="custom-param" id="custom-param" action="/admin/tasks/add-edit" method="POST">
103
+ <form name="custom-param" id="custom-param" action="{{ path_for(path) }}" method="POST">
106
104
  <nav class="navbar navbar-default">
107
105
  <h3>&nbsp;&nbsp;Task Configuration</h3>
108
106
  <!--# name-->
@@ -401,8 +399,7 @@ application = task["application"].upcase if task
401
399
  <h3>&nbsp;&nbsp;Select Input Parameters</h3>
402
400
  <br>
403
401
  <div class='form-group'>
404
- % custom_param_selection_box = Mote.parse(File.read("#{Mutx::View.path}/custom/params/custom_param_selection_box.mote"), self, [:params]).call({params:params})
405
- {{custom_param_selection_box}}
402
+ {{ partial('admin/custom-params/selection_box', params: params) }}
406
403
  </div>
407
404
  </nav>
408
405
  <nav class="navbar navbar-default">
@@ -414,7 +411,7 @@ application = task["application"].upcase if task
414
411
  <div class="col-xs-6 col-md-4">
415
412
  % unless action == "view"
416
413
  <input type="submit" class="btn btn-success" value="Save">&nbsp;
417
- <a class="btn btn-danger" href="/admin/tasks/list">Cancel</a>
414
+ <a class="btn btn-danger" href="{{ path_for(:admin_tasks_index) }}">Cancel</a>
418
415
  % end
419
416
  </div>
420
417
  </div>