summaryrefslogtreecommitdiff
path: root/app/views/shared/_new_project_item_select.html.haml
blob: 46095912821956272b36c104f4a11900364b0113 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
- if @projects.any?
  .prepend-left-10.project-item-select-holder
    = project_select_tag :project_path, class: "project-item-select", data: { include_groups: local_assigns[:include_groups] }
    %a.btn.btn-new.new-project-item-select-button
      = icon('plus')
      = local_assigns[:label]
      %b.caret

  :javascript
    $('.new-project-item-select-button').on('click', function() {
      $('.project-item-select').select2('open');
    });

    var relativePath = '#{local_assigns[:path]}';

    $('.project-item-select').on('click', function() {
      window.location = $(this).val() + '/' + relativePath;
    });

    new ProjectSelect()