- 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()

- 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], order_by: 'last_activity_at' }
    %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()

Sort projects by last activity for new issue dropdown
Sort projects by last activity for new issue dropdown

When creating new issue from dashboard page I want to see projects
sorted by last activity instead of ID

Signed-off-by: Dmitriy Zaporozhets <be23d75b156792e5acab51b196a2deb155d35d6a@gmail.com>
