Mission control layout and step submission validation methods

James Peret %!s(int64=10) %!d(string=hace) años
padre
commit
4374a3bc08

+ 3 - 121
app/assets/stylesheets/avalanche_theme.css.less

@@ -1,8 +1,9 @@
1 1
 // Avalanche Theme Stylesheet
2 2
 // ------------------------------------------------
3 3
 
4
-@import "colors.less";
5
-
4
+@import "avl2_theme/colors.less";
5
+@import "avl2_theme/buttons.less";
6
+@import "avl2_theme/panel.less";
6 7
 
7 8
 html, body {
8 9
     height: 100%;
@@ -219,54 +220,6 @@ h4 {
219 220
 	margin-bottom: 60px;
220 221
 }
221 222
 
222
-
223
-// Buttons
224
-
225
-.btn.btn-success {
226
-	color: @green;
227
-	border-color: @green;
228
-}
229
-
230
-.btn {
231
-	display: inline-block;
232
-	padding: 4px 12px;
233
-	margin-bottom: 0;
234
-	text-align: center;
235
-	vertical-align: middle;
236
-	cursor: pointer;
237
-	color: #333333;
238
-	background-color: transparent;
239
-	border: 2px solid @black;
240
-	border-bottom-color: @black;
241
-	border-radius: 4px;
242
-	text-shadow: none;
243
-	/* Create Mission: */
244
-	font-family: Avenir-Book;
245
-	font-style: normal;
246
-	color: #333333;
247
-	text-transform: none;
248
-}
249
-
250
-.btn-large {
251
-	font-family: Avenir-Black;
252
-	font-size: 18px;
253
-	color: #333333;
254
-	line-height: 20px;
255
-}
256
-
257
-.btn:hover {
258
-	background: rgba(0, 0, 0, 0.2);
259
-}
260
-
261
-.btn-link {
262
-	border: none;
263
-}
264
-
265
-.btn-link:hover {
266
-	border: none;
267
-	background-color: transparent;
268
-}
269
-
270 223
 // Progress Bar
271 224
 
272 225
 .progress-success.progress-striped .bar, .progress-striped .bar-success {
@@ -297,77 +250,6 @@ h4 {
297 250
 	margin-right: auto;
298 251
 }
299 252
 
300
-// Panel
301
-
302
-.panel.panel-default { 
303
-	margin-top: 15px;
304
-	.box-theme; 
305
-}
306
-
307
-.panel {
308
-	.panel-heading {
309
-		background-color: @light-gray;
310
-		height: 32px;
311
-		.theme-box-padding;	
312
-	}
313
-	.panel-heading.panel-divider {
314
-		border-top: @theme-border;
315
-		border-bottom: @theme-border;
316
-		height: 32px;
317
-		margin-bottom: -2px;
318
-		background-color: @white;
319
-		.caret { margin-top: 16px; margin-left: 5px; margin-right: 5px; }
320
-	}
321
-	.panel-title {
322
-		margin-top: 0px;
323
-		margin-bottom: 0px;
324
-		.task-text {
325
-			font-family: Avenir-Medium;
326
-			font-size: 18px;
327
-			color: #000000;
328
-			line-height: 25px;
329
-			padding-top: 6px;
330
-			font-weight: 200;
331
-		}
332
-		.label { 
333
-			margin-top: 5px;
334
-			font-family: Avenir-Oblique;
335
-			color: #000000;
336
-			font-style: oblique;
337
-			text-shadow: none;
338
-			padding: 5px;
339
-		}
340
-		.label.label-warning { background-color: #F2CB63; }
341
-		.caret {
342
-			float: left;
343
-			margin-top: 14px;
344
-			margin-right: 5px;
345
-			margin-left: 5px;
346
-		}
347
-		.task-number { line-height: 36px;}
348
-		.task-icon { padding-top: 7px }
349
-		.task-icon i { color: @black }
350
-	}
351
-	.panel-body {
352
-		.panel-content {
353
-			.panel-text {
354
-				font-family: Avenir-Light;
355
-				font-size: 18px;
356
-				color: #1D1D26;
357
-				line-height: 26px;
358
-				.theme-box-padding;
359
-			}
360
-		}
361
-		.accordion {
362
-			margin-bottom: 0px;
363
-		}
364
-	}
365
-	.panel-body.in { border-top: @theme-border; }
366
-	.panel-footer {}
367
-} 
368
-
369
-// Overrides
370
-.accordion-inner { padding: 0px; }
371 253
 
372 254
 // Footer
373 255
 

+ 55 - 0
app/assets/stylesheets/avl2_theme/buttons.less

@@ -0,0 +1,55 @@
1
+// Buttons
2
+
3
+@import "colors.less";
4
+
5
+.btn.btn-success {
6
+	color: @green;
7
+	border-color: @green;
8
+}
9
+.btn.btn-success:hover { background-color: fade(@green, 25%); }
10
+
11
+.btn.btn-danger {
12
+	color: @red;
13
+	border-color: @red;
14
+}
15
+.btn.btn-danger:hover { background-color: fade(@red, 25%); }
16
+
17
+.btn {
18
+	display: inline-block;
19
+	padding: 4px 12px;
20
+	margin-bottom: 0;
21
+	text-align: center;
22
+	vertical-align: middle;
23
+	cursor: pointer;
24
+	color: #333333;
25
+	background-color: transparent;
26
+	border: 2px solid @black;
27
+	border-bottom-color: @black;
28
+	border-radius: 4px;
29
+	text-shadow: none;
30
+	/* Create Mission: */
31
+	font-family: Avenir-Book;
32
+	font-style: normal;
33
+	color: #333333;
34
+	text-transform: none;
35
+}
36
+
37
+.btn-large {
38
+	font-family: Avenir-Black;
39
+	font-size: 18px;
40
+	color: #333333;
41
+	line-height: 20px;
42
+}
43
+
44
+.btn:hover {
45
+	background: rgba(0, 0, 0, 0.2);
46
+}
47
+
48
+.btn-link {
49
+	border: none;
50
+}
51
+
52
+.btn-link:hover {
53
+	border: none;
54
+	background-color: transparent;
55
+}

app/assets/stylesheets/colors.less → app/assets/stylesheets/avl2_theme/colors.less


+ 105 - 0
app/assets/stylesheets/avl2_theme/panel.less

@@ -0,0 +1,105 @@
1
+// Panel
2
+
3
+@import "colors.less";
4
+
5
+.panel.panel-default { 
6
+	margin-top: 15px;
7
+	.box-theme; 
8
+}
9
+
10
+.panel {
11
+	.panel-heading {
12
+		background-color: @light-gray;
13
+		height: 32px;
14
+		.theme-box-padding;	
15
+	}
16
+	.panel-heading.panel-divider {
17
+		border-top: @theme-border;
18
+		border-bottom: @theme-border;
19
+		height: 32px;
20
+		margin-bottom: -2px;
21
+		background-color: @white;
22
+		.caret { margin-top: 16px; margin-left: 5px; margin-right: 5px; }
23
+	}
24
+	.panel-title {
25
+		margin-top: 0px;
26
+		margin-bottom: 0px;
27
+		.task-text {
28
+			font-family: Avenir-Medium;
29
+			font-size: 18px;
30
+			color: #000000;
31
+			line-height: 25px;
32
+			padding-top: 6px;
33
+			font-weight: 200;
34
+		}
35
+		.label { 
36
+			margin-top: 5px;
37
+			font-family: Avenir-Oblique;
38
+			color: #000000;
39
+			font-style: oblique;
40
+			text-shadow: none;
41
+			padding: 5px;
42
+		}
43
+		.label.label-warning { background-color: #F2CB63; }
44
+		.caret {
45
+			float: left;
46
+			margin-top: 14px;
47
+			margin-right: 5px;
48
+			margin-left: 5px;
49
+		}
50
+		.task-number { line-height: 36px;}
51
+		.task-icon { padding-top: 7px }
52
+		.task-icon i { color: @black }
53
+		.task-icon.mission-control { float: left; 
54
+			padding-top: 0px;
55
+			margin-top: -3px;
56
+		}
57
+	}
58
+	.panel-body {
59
+		.panel-content {
60
+			.panel-text {
61
+				font-family: Avenir-Light;
62
+				font-size: 18px;
63
+				color: #1D1D26;
64
+				line-height: 26px;
65
+				.theme-box-padding;
66
+			}
67
+		}
68
+		.accordion {
69
+			margin-bottom: 0px;
70
+		}
71
+	}
72
+	.panel-body.in { border-top: @theme-border; }
73
+	.panel-footer {
74
+		border-top: @theme-border;
75
+		border-bottom: @theme-border;
76
+		height: 32px;
77
+		margin-bottom: -2px;
78
+		background-color: @white;
79
+		.theme-box-padding;
80
+		.caret { margin-top: 16px; margin-left: 5px; margin-right: 5px; }
81
+		.description {
82
+			/* Agente James Peret (: */
83
+			font-family: Avenir-Medium;
84
+			font-size: 14px;
85
+			color: #000000;
86
+			line-height: 15px;
87
+			margin-bottom: 0px;
88
+			margin-top: 2px;
89
+			margin-left: 8px;
90
+		}
91
+		.sub-text {
92
+			/* Agente James Peret (: */
93
+			font-family: Avenir-Light;
94
+			font-size: 11px;
95
+			color: #000000;
96
+			line-height: 15px;
97
+			margin-bottom: 0px;
98
+			margin-top: 0px;
99
+			margin-left: 8px;
100
+		}
101
+	}
102
+} 
103
+
104
+// Overrides
105
+.accordion-inner { padding: 0px; }

+ 1 - 1
app/assets/stylesheets/dashboard.css.less

@@ -1,7 +1,7 @@
1 1
 // Dashboard Stylesheet
2 2
 //------------------------------------
3 3
 
4
-@import "colors.less";
4
+@import "avl2_theme/colors.less";
5 5
 
6 6
 .dashboard-stats {
7 7
 	float: left;

+ 40 - 1
app/assets/stylesheets/missions.css.less

@@ -8,7 +8,7 @@
8 8
 
9 9
 // Mission Status
10 10
 
11
-@import "colors.less";
11
+@import "avl2_theme/colors.less";
12 12
 
13 13
 .mission-status {
14 14
 	padding-left: 6px;
@@ -312,4 +312,43 @@ p.agent-stats i {
312 312
 	line-height: 22px;
313 313
 	float: left;
314 314
 	margin-top: 5px;
315
+}
316
+
317
+// Mission Control
318
+
319
+.mission-control-agents-sidebar {
320
+	background-color: #f3f3f3;
321
+	padding-top: 10px;
322
+	padding-bottom: 0px;
323
+	ul {
324
+		.theme-box-padding;	
325
+		list-style: none;
326
+		margin-left: 0px;
327
+		margin-right: 0px;
328
+	}
329
+	li {	
330
+		list-style: none;
331
+		margin-left: 0px;
332
+		margin-right: 0px;
333
+		margin-bottom: 15px;
334
+		.description {
335
+			font-family: Avenir-Medium;
336
+			font-size: 14px;
337
+			color: #1D1D26;
338
+			line-height: 19px;
339
+			margin-bottom: 0px;
340
+			margin-left: 8px;
341
+			margin-top: -4px;
342
+		}
343
+		.sub-text {
344
+			/* James Peret 3: */
345
+			font-family: Avenir-Light;
346
+			font-size: 14px;
347
+			color: #1D1D26;
348
+			line-height: 19px;
349
+			margin-bottom: 0px;
350
+			margin-left: 8px;
351
+			margin-top: -4px;
352
+		}
353
+	}
315 354
 }

+ 39 - 1
app/controllers/missions_controller.rb

@@ -10,7 +10,17 @@ class MissionsController < ApplicationController
10 10
   end
11 11
   
12 12
   def mission_control
13
-    @mission = Mission.find(params[:id])
13
+    @mission = Mission.friendly.find(params[:id])
14
+    @submissions = Array.new
15
+    @mission.mission_agents.each do |agent|
16
+      agent.agent_steps.each do |step|
17
+        if step.step_submissions.count > 0
18
+          if step.step_submissions.last.validated == nil
19
+            @submissions << step.step_submissions.last
20
+          end
21
+        end
22
+      end
23
+    end
14 24
     if current_user != @mission.owner
15 25
       redirect_to missions_path, alert: (t 'mission.access_denied_error')
16 26
     end
@@ -109,6 +119,34 @@ class MissionsController < ApplicationController
109 119
       end
110 120
     end
111 121
   end
122
+  
123
+  def accept_step_submission
124
+    mission = Mission.friendly.find(params[:id])
125
+    if current_user != mission.owner
126
+      redirect_to missions_path, alert: (t 'mission.access_denied_error')
127
+    else
128
+      submission = StepSubmission.find(params[:step_submission_id])
129
+      submission.validated = true
130
+      submission.validated_by = current_user
131
+      submission.date_validated = Time.now
132
+      submission.save
133
+      redirect_to mission_control_path(mission)
134
+    end
135
+  end
136
+  
137
+  def reject_step_submission
138
+    mission = Mission.friendly.find(params[:id])
139
+    if current_user != mission.owner
140
+      redirect_to missions_path, alert: (t 'mission.access_denied_error')
141
+    else
142
+      submission = StepSubmission.find(params[:step_submission_id])
143
+      submission.validated = false
144
+      submission.validated_by = current_user
145
+      submission.date_validated = Time.now
146
+      submission.save
147
+      redirect_to mission_control_path(mission)
148
+    end
149
+  end
112 150
 
113 151
   private
114 152
     # Use callbacks to share common setup or constraints between actions.

+ 9 - 1
app/views/missions/_mission_details.html.erb

@@ -11,6 +11,14 @@
11 11
 					<%= content_tag(:small, (t 'mission.mission')+':') %>
12 12
 					<%= content_tag(:h1) do %>
13 13
 						<%=  mission.title %>
14
+						<% if user_signed_in? %>
15
+							<% if current_user == mission.owner %>
16
+								<%= link_to (t 'nav.edit'), edit_mission_path(mission), class: 'btn btn-mini' %>
17
+							<% end %>
18
+							<% if mission.mission_agents.find_by_user_id(current_user.id) != nil || current_user == mission.owner %>
19
+								<%= link_to (t 'nav.back'), dashboard_path, class: 'btn btn-mini' %>
20
+							<% end %>
21
+						<% end %>
14 22
 						<%= status(mission.status) %>
15 23
 					<% end %>
16 24
 				<% end %>
@@ -59,7 +67,7 @@
59 67
 				<%= content_tag(:div, class: 'mission-call-to-action') do %>
60 68
 					<%= link_to (t 'mission.join'), '#', class: 'btn btn-large' %>
61 69
 				<% end %>
62
-				
70
+				<%= content_tag(:div, '', class: 'clearfix', id: 'mission-tab') %>
63 71
 			<% end %>	
64 72
 		<% end %>
65 73
 	<% end %>

+ 19 - 0
app/views/missions/_mission_tabs.html.erb

@@ -0,0 +1,19 @@
1
+<%= content_tag(:div, class: 'container container-tabs') do %>
2
+	<%= content_tag(:div, class: 'row') do %>
3
+		<%= content_tag(:div, class: 'span12') do %>
4
+			<%= content_tag(:ul, class: 'nav nav-tabs') do %>
5
+				<% if user_signed_in? %>
6
+					<% if current_user = @mission.owner %>
7
+						<%= content_tag(:li, (link_to (t 'mission.mission_control'), mission_control_path(@mission, anchor: "mission-tab")), class: ('active' if params[:action] == 'mission_control' )) %>
8
+					<% end %>
9
+				<% end %>
10
+				<%= content_tag(:li, (link_to (t 'mission.briefing'), mission_path(@mission, anchor: "mission-tab")), class: ('active' if params[:action] == 'show' )) %>
11
+				<% if params[:action] == 'show_agents' then link_class = 'active' end %>
12
+				<% if params[:action] == 'show_agent_details' then link_class = 'active clickable' end %>
13
+				<%= content_tag(:li, (link_to (t 'mission.agents'), mission_agents_list_path(@mission, anchor: "mission-tab")), class: link_class) %>
14
+				<%= content_tag(:li, (link_to (t 'mission.chat'), '#'), class: 'disabled') %>
15
+				<%= content_tag(:li, (link_to (t 'mission.log'), '#'), class: 'disabled') %>
16
+			<% end %>
17
+		<% end %>
18
+	<% end %>
19
+<% end %>

+ 88 - 12
app/views/missions/mission_control.html.erb

@@ -1,17 +1,93 @@
1
-<%= content_tag(:div, class: 'container top-container container-last') do %>
1
+<%= render :partial => "mission_details", locals: {mission: @mission} %>
2
+<%= render :partial => 'mission_tabs', locals: {mission: @mission} %>
3
+
4
+<% # Content -------- %>
5
+
6
+<%= content_tag(:div, class: 'container container-last') do %>
2 7
 	<%= content_tag(:div, class: 'row') do %>
3
-		<%= content_tag(:div, class: 'span12') do %>
8
+	
9
+		<%= content_tag(:div, class: 'span8') do %>
10
+			<%= content_tag(:h4, ((t 'mission_control.agent_steps_validation') + ':') ) %>
11
+			
12
+			<% @submissions.each do |submission| %>
13
+				<%= content_tag(:div, class: 'panel panel-default') do %>
14
+					<%= content_tag(:div, class: 'panel-heading') do %>
15
+						<%= content_tag(:h3, class: 'panel-title') do %>
16
+							<%= content_tag(:span, '<i class="fa fa-comment"></i>'.html_safe, class: 'task-icon mission-control') %>
17
+							<%= link_to ('#colapse_submission_'+ submission.id.to_s ), class: 'accordion-toggle', data: {toggle: 'collapse', parent: '#colapse_submissions'} do %>
18
+								<%= content_tag(:span, '', class: 'caret')%>
19
+								<%= content_tag(:span, submission.agent_step.title, class: 'task-text') %>
20
+							<% end %>
21
+						<% end %>
22
+					<% end %>
23
+					<%= content_tag(:div, class: 'panel-body collapse', id: ('colapse_submission_'+ submission.id.to_s )) do %>
24
+						<%= content_tag(:div, class: "panel-content") do %>
25
+							<%= content_tag(:div, class: "panel-text") do %>
26
+								<%= submission.submission_contents.last.submission.content %>
27
+								
28
+							<% end %>
29
+						
30
+					
31
+						<% end %>
32
+					<% end %>
33
+					<%= content_tag(:div, class: 'panel-footer') do %>
34
+						<%= content_tag(:div, class: 'agent-avatar pull-left') do %>
35
+							<% if submission.agent_step.mission_agent.user.avatar.file != nil %>
36
+						    		<%= image_tag submission.agent_step.mission_agent.user.avatar.to_s, size: "32x32", :class => 'img-circle' %>
37
+						     <% else %>
38
+						    		<%= image_tag "user.png", size: "64x64", :class => 'img-circle' %>
39
+						     <% end %>
40
+						<% end %>
41
+						<%= content_tag(:div, class: ' pull-left') do %>
42
+							<%= content_tag(:p, (submission.agent_step.mission_agent.user.full_name + ' <b>(' + submission.agent_step.mission_agent.role + ')</b>').html_safe, class: 'description') %>
43
+							<%= content_tag(:p, time_ago_in_words(submission.created_at), class: 'sub-text') %><br>
44
+						<% end %>
45
+						<%= content_tag(:div, class: ' pull-right') do %>
46
+							<%= link_to((t 'mission_control.accept'), accept_step_submission_path(step_submission_id: submission.id), class: 'btn btn-success') %>
47
+							<%= link_to((t 'mission_control.reject'), reject_step_submission_path(step_submission_id: submission.id), class: 'btn btn-danger') %>
48
+						<% end %>
49
+					
50
+					
51
+					<% end %>
52
+				<% end %>
53
+			<% end %>
54
+			
4 55
 
5
-			<%= content_tag(:div, class: 'page-header page-header-type') do %>
6
-				<%= content_tag(:small, (t 'mission.mission_control')+':') %>
7
-				<%= content_tag(:h1) do %>
8
-					<%=  @mission.title %>
9
-					<%= link_to (t 'nav.edit'), edit_mission_path(@mission), class: 'btn btn-mini' %>
10
-					<%= link_to (t 'nav.back'), dashboard_path, class: 'btn btn-mini' %>
11
-					<%= status(@mission.status) %>
56
+		<% end %>
57
+		
58
+		<%= content_tag(:div, class: 'span4') do %>
59
+			<%= content_tag(:h4, ((t 'mission.agents') + ':') ) %>
60
+			<%= content_tag(:div, class: 'mission-control-agents-sidebar') do %>
61
+				<%= content_tag(:ul) do %>
62
+					<% @mission.mission_agents.each do |agent| %>
63
+						<%= content_tag(:li) do %>
64
+							<% if agent.user %>
65
+								<%= content_tag(:div, class: 'agent-avatar pull-left') do %>
66
+									<% if agent.user.avatar.file != nil %>
67
+								    		<%= image_tag agent.user.avatar.to_s, size: "32x32", :class => 'img-circle' %>
68
+								     <% else %>
69
+								    		<%= image_tag "user.png", size: "32x32", :class => 'img-circle' %>
70
+								     <% end %>
71
+								<% end %>
72
+								<%= content_tag(:div, class: ' pull-left') do %>
73
+									<%= content_tag(:p, (link_to agent.role, mission_agent_details_path(agent: agent)), class: 'description') %>
74
+									<%= content_tag(:p, agent.user.full_name, class: 'sub-text') %>
75
+								<% end %>
76
+							<% else %>
77
+								<%= content_tag(:div, class: 'agent-avatar pull-left') do %>
78
+									<%= image_tag "user.png", size: "32x32", :class => 'img-circle' %>
79
+								<% end %>
80
+								<%= content_tag(:div, class: ' pull-left') do %>
81
+									<%= content_tag(:p, (link_to agent.role, mission_agent_details_path(agent: agent)), class: 'description') %>
82
+									<%= content_tag(:p, (t 'agent.waiting_for_agent'), class: 'sub-text') %>
83
+								<% end %>
84
+							<% end %>
85
+							<%= content_tag(:div, '', class: 'clearfix') %>
86
+						<% end %>
87
+					<% end %>
12 88
 				<% end %>
13 89
 			<% end %>
14
-			<%= bootstrap_flash %>
15 90
 		<% end %>
16
-	<% end %>		
17
-<% end %>
91
+		
92
+	<% end %>
93
+<% end %>

+ 2 - 15
app/views/missions/show.html.erb

@@ -1,20 +1,7 @@
1
-<%= render partial: "mission_details", locals: {mission: @mission} %>
1
+<%= render :partial => "mission_details", locals: {mission: @mission} %>
2
+<%= render :partial => 'mission_tabs', locals: {mission: @mission} %>
2 3
 
3 4
 
4
-
5
-<%= content_tag(:div, class: 'container container-tabs') do %>
6
-	<%= content_tag(:div, class: 'row') do %>
7
-		<%= content_tag(:div, class: 'span12') do %>
8
-			<%= content_tag(:ul, class: 'nav nav-tabs') do %>
9
-				<%= content_tag(:li, (link_to (t 'mission.briefing'), mission_path(@mission)), class: 'active') %>
10
-				<%= content_tag(:li, (link_to (t 'mission.agents'), mission_agents_list_path(@mission))) %>
11
-				<%= content_tag(:li, (link_to (t 'mission.chat'), '#'), class: 'disabled') %>
12
-				<%= content_tag(:li, (link_to (t 'mission.log'), '#'), class: 'disabled') %>
13
-			<% end %>
14
-		<% end %>
15
-	<% end %>
16
-<% end %>
17
-
18 5
 <%= content_tag(:div, class: 'container container-last') do %>
19 6
 	<%= content_tag(:div, class: 'row') do %>
20 7
 		<%= content_tag(:div, class: 'span8 mission-briefing') do %>

+ 2 - 15
app/views/missions/show_agent_details.html.erb

@@ -1,19 +1,6 @@
1
-<%= render partial: "mission_details", locals: {mission: @mission} %>
1
+<%= render :partial => "mission_details", locals: {mission: @mission} %>
2
+<%= render :partial => 'mission_tabs', locals: {mission: @mission} %>
2 3
 
3
-<% # Tabs ---------- %>
4
-
5
-<%= content_tag(:div, class: 'container container-tabs') do %>
6
-	<%= content_tag(:div, class: 'row') do %>
7
-		<%= content_tag(:div, class: 'span12') do %>
8
-			<%= content_tag(:ul, class: 'nav nav-tabs') do %>
9
-				<%= content_tag(:li, (link_to (t 'mission.briefing'), mission_path(@mission))) %>
10
-				<%= content_tag(:li, (link_to (t 'mission.agents'), mission_agents_list_path(@mission)), class: 'active clickable') %>
11
-				<%= content_tag(:li, (link_to (t 'mission.chat'), '#'), class: 'disabled') %>
12
-				<%= content_tag(:li, (link_to (t 'mission.log'), '#'), class: 'disabled') %>
13
-			<% end %>
14
-		<% end %>
15
-	<% end %>
16
-<% end %>
17 4
 
18 5
 <% # Content -------- %>
19 6
 

+ 2 - 16
app/views/missions/show_agents.html.erb

@@ -1,21 +1,7 @@
1
-<%= render partial: "mission_details", locals: {mission: @mission} %>
1
+<%= render :partial => "mission_details", locals: {mission: @mission} %>
2
+<%= render :partial => 'mission_tabs', locals: {mission: @mission} %>
2 3
 
3 4
 
4
-<% # Tabs ---------- %>
5
-
6
-<%= content_tag(:div, class: 'container container-tabs') do %>
7
-	<%= content_tag(:div, class: 'row') do %>
8
-		<%= content_tag(:div, class: 'span12') do %>
9
-			<%= content_tag(:ul, class: 'nav nav-tabs') do %>
10
-				<%= content_tag(:li, (link_to (t 'mission.briefing'), mission_path(@mission))) %>
11
-				<%= content_tag(:li, (link_to (t 'mission.agents'), mission_agents_list_path(@mission)), class: 'active') %>
12
-				<%= content_tag(:li, (link_to (t 'mission.chat'), '#'), class: 'disabled') %>
13
-				<%= content_tag(:li, (link_to (t 'mission.log'), '#'), class: 'disabled') %>
14
-			<% end %>
15
-		<% end %>
16
-	<% end %>
17
-<% end %>
18
-
19 5
 <% # Content -------- %>
20 6
 
21 7
 <%= content_tag(:div, class: 'container container-last') do %>

+ 7 - 2
config/routes.rb

@@ -24,11 +24,15 @@ Avalanche2::Application.routes.draw do
24 24
   
25 25
   # Missions
26 26
   resources :missions
27
-  get 'mission_control/:id' => 'missions#mission_control', as: :mission_control
28
-  get '/missions/:id/agents', to: 'missions#show_agents', as: :mission_agents_list
27
+  get 'missions/:id/agents', to: 'missions#show_agents', as: :mission_agents_list
29 28
   get 'missions/:id/agents/:agent', to: 'missions#show_agent_details', as: :mission_agent_details
30 29
   get 'missions/:id/agents/:agent/take_agent_role', to: 'missions#take_agent_role', as: :take_agent_role
31 30
   
31
+  # Mission Control
32
+  get 'missions/:id/mission_control' => 'missions#mission_control', as: :mission_control
33
+  get  'missions/:id/mission_control/accept_step_submission/:step_submission_id' => 'missions#accept_step_submission', as: :accept_step_submission
34
+  get  'missions/:id/mission_control/reject_step_submission/:step_submission_id' => 'missions#reject_step_submission', as: :reject_step_submission
35
+  
32 36
   # Agents
33 37
   get 'dashboard' => 'agents#dashboard', as: :dashboard
34 38
   get 'agents' => 'agents#list', as: :agent_list
@@ -36,6 +40,7 @@ Avalanche2::Application.routes.draw do
36 40
   
37 41
   # Steps
38 42
   post 'missions/:id/agents/:agent/steps/:step/step_submission' => 'missions#step_submission', as: :step_submission
43
+ 
39 44
 
40 45
   # Admin Panel
41 46
   get "admin/dashboard" => "admin_panel#dashboard", :as => :admin_dashboard