Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Replace repository select2 with simple selects

Oliver Güntherae2e396253b1
diff --git a/app/assets/javascripts/repository_navigation.js b/app/assets/javascripts/repository_navigation.js
index d0b6c75516c..00e384c9952 100644
--- a/app/assets/javascripts/repository_navigation.js
+++ b/app/assets/javascripts/repository_navigation.js
@@ -40,20 +40,7 @@
selects.prop('disable', true);
form.submit();
selects.prop('disable', false);
- }
-
- /*
- Enable select2
- */
- branch.select2({
- dropdownCssClass: '-large-dropdown',
- placeholder: I18n.t('js.repositories.select_branch')
- }
- );
- tag.select2({
- dropdownCssClass: '-large-dropdown',
- placeholder: I18n.t('js.repositories.select_tag'),
- });
+ };
/*
If we're viewing a tag or branch, don't display it in the
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index 8389ecae0d0..514f29d7dd7 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -62,7 +62,10 @@ See docs/COPYRIGHT.rdoc for more details.
<div>
<%= label_tag 'branch', I18n.t(:label_branch) %>
</div>
- <%= select_tag :branch, options_for_select([''] + @repository.branches, @rev), id: 'revision-branch-select' %>
+ <%= select_tag :branch,
+ options_for_select(@repository.branches, @rev),
+ include_blank: "--- #{t(:actionview_instancetag_blank_option)} ---",
+ id: 'revision-branch-select' %>
</li>
<% end %>
<% if [email protected]? && @repository.tags.length > 0 %>
@@ -70,7 +73,10 @@ See docs/COPYRIGHT.rdoc for more details.
<div>
<%= label_tag 'tag', I18n.t(:label_tag) %>
</div>
- <%= select_tag :tag, options_for_select([''] + @repository.tags, @rev), id: 'revision-tag-select' %>
+ <%= select_tag :tag,
+ options_for_select(@repository.tags, @rev),
+ include_blank: "--- #{t(:actionview_instancetag_blank_option)} ---",
+ id: 'revision-tag-select' %>
</li>
<% end %>
<li class="toolbar-item -icon-only">