akester/storehouse

Fork Project

d3d7b1c4adb66ea91d2ef088486adbb6edb30512

Authored By: Andrew Kester Date: July 7, 2017 2:47 pm

Fix issue with branch / tag selector when the user is on a commit.

src/StorehouseBundle/Resources/views/Project/_Partials/RightSidebar.html.twig
21 21
 
22 22
 {% if tags %}
23 23
 	<label for="branch-select">Branches and Tags:</label>
24
-	<select id="branch-select" onchange="document.location = this.value">
24
+	<select id="branch-select" onchange="document.location = this.value" autocomplete="none">
25
+		{% if context.commit not in tags %}
26
+			<option selected disabled>Pick a branch or tag</option>
27
+		{% endif %}
28 25
 		{% for tag in tags %}
29 26
 			<option {% if context.commit == tag %} selected {% endif %} value="{{ path('project/tree', {'project': context.project.name, 'commit' : tag }) }}">{{ tag }}
30 27
 		{% endfor %}
32 35
 	<div class="input-group-button">
33 36
 		<button class="copy button hollow secondary"><i class="fa fa-copy"></i></button>
34 37
 	</div>
35
+
36 38
 	{% if app.user %}
37 39
 		<input class="input-group-field" value="{{ context.project.sshPrefix }}sthse@sthse.co:/code/{{ context.project.path }}" readonly="" type="text">
38 40
 	{% else %}
39 41