bug fixes and dropdown button layout

James Peret преди 10 години
родител
ревизия
14f1621c23

+ 12 - 0
app/assets/javascripts/mission_editor.js

@@ -16,6 +16,18 @@ function attachHandler(jQuery) {
16 16
 	  //alert(panel_body.id)
17 17
 	})
18 18
 	
19
+	$('.dropdown-toggle').dropdown();
20
+	
21
+	$('.dropdown-toggle').on('show.bs.dropdown', function () {
22
+		alert('asdfsf')
23
+		$(this).parent().parent().parent().addClass("overflow");
24
+	  
25
+		
26
+	})
27
+	$('.validation_dropdown').click(function(e) {
28
+	  
29
+	});
30
+	
19 31
 }
20 32
 
21 33
 $(document).ready(attachHandler);

+ 24 - 1
app/assets/stylesheets/avl2_theme/buttons.less

@@ -99,4 +99,27 @@ button.btn.btn-success.inverse:hover, input[type="submit"].btn.btn-success.inver
99 99
 	background-color: @green;
100 100
 	color: @black;
101 101
 	border: 2px solid darken(@green, 20%);
102
-}
102
+}
103
+
104
+.validation_dropdown a {
105
+	color: @black;
106
+}
107
+.validation_dropdown .dropdown-toggle .caret {
108
+	margin-top: 8px;
109
+	border-top-color: @black;
110
+	border-bottom-color: @black;
111
+}
112
+
113
+.nav.btn a:hover { background: rgba(0, 0, 0, 0); }
114
+.nav.btn a:visited { background: rgba(0, 0, 0, 0); }
115
+
116
+// Hacks
117
+
118
+// Accordion with dropdown menu fix
119
+.overflow { overflow:visible; }
120
+
121
+.in.collapse { 
122
+	overflow:visible;
123
+}
124
+
125
+.collapse.in:hover { overflow:visible; }

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

@@ -86,6 +86,7 @@
86 86
 				}
87 87
 			}
88 88
 		}
89
+		.panel-divider-top { border-top: @theme-border; }
89 90
 		.accordion {
90 91
 			margin-bottom: 0px;
91 92
 		}

+ 8 - 0
app/assets/stylesheets/mission_editor.css.less

@@ -174,4 +174,12 @@ span.btn-file .form-group {
174 174
 		p { margin-top: -15px;}
175 175
 		i { font-size: 210px;}
176 176
 	}
177
+}
178
+
179
+.steps-validation {
180
+	height: 48px;
181
+}
182
+
183
+.steps-validation-title {
184
+	padding-top: 5px;
177 185
 }

+ 22 - 2
app/views/mission_editor/agents/_form_step.html.erb

@@ -2,7 +2,7 @@
2 2
 	<% step_number = 0 %>
3 3
 	<%= f.fields_for :agent_steps, show_empty: false do |ff| %>
4 4
 		<% step_number = step_number + 1%>
5
-		<%= content_tag(:div, class: 'panel panel-white hidden') do %>
5
+		<%= content_tag(:div, class: "panel panel-white #{'hidden' if ff.object == nil}") do %>
6 6
 			<%= content_tag(:div, class: 'panel-heading') do %>
7 7
 				<%= content_tag(:h3, class: 'panel-title') do %>
8 8
 					<%= content_tag(:span, (ff.object.step.to_s != '' ? ff.object.step.to_s : '#'), class: 'task-number') %>
@@ -22,7 +22,27 @@
22 22
 						<%= ff.text_field :title, label: (t 'mission_editor.agents.step_title'), class: 'input-block-level' %>
23 23
 						<%= ff.text_area :description, label: (t 'mission_editor.agents.description'), class: 'input-block-level', rows: 10 %>
24 24
 					<% end %>
25
-		
25
+				<% end %>
26
+				<%= content_tag(:div, class: "panel-content panel-divider-top steps-validation") do %>
27
+					<%= content_tag(:div, class: "panel-text") do %>
28
+						<%= content_tag(:span, (t 'mission_editor.agents.step_validations'),  class: "steps-validation-title pull-left") %>
29
+						<div class="nav btn pull-right validation_dropdown">
30
+						     <li class="dropdown">
31
+						       <a class="dropdown-toggle" data-toggle="dropdown" href="#">
32
+						         <%= (t 'mission_editor.agents.add_validation') %>
33
+						         <span class="caret"></span>
34
+						       </a>
35
+						       <ul class="dropdown-menu dropdown-menu-right" role="menu">
36
+						         <li>
37
+						           <%= link_to t('landing_page.en'), change_locale_path(:en) %>
38
+						         </li>
39
+						         <li>
40
+						           <%= link_to t('landing_page.pt-BR'), change_locale_path(:"pt-BR") %>
41
+						         </li>
42
+						       </ul>
43
+						     </li>
44
+						 </div>
45
+					<% end %>
26 46
 				<% end %>
27 47
 			<% end %>
28 48
 		<% end %>