Merge pull request #230 from ZmagoD/zd_SCI_586

Adds new team button to team switch dropdown [fixes SCI-586]
This commit is contained in:
Zmago Devetak 2016-10-21 08:29:05 +02:00 committed by GitHub
commit f615b3da41
2 changed files with 11 additions and 3 deletions

View file

@ -83,7 +83,7 @@
function initGlobalSwitchForm() {
var teamSwitch = $('#team-switch');
teamSwitch
.find('.dropdown-menu a')
.find('.dropdown-menu .change-team')
.on('click', function(){
$('#user_current_organization_id')
.val($(this).attr('data-id'));

View file

@ -101,7 +101,7 @@
</li>
<!-- Global team switch -->
<% if current_user.organizations.length > 1 %>
<% if current_user.organizations.length > 0 %>
<li class="dropdown" id="team-switch">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<%= fa_icon 'users' %>
@ -118,12 +118,20 @@
<% current_user.organizations.each do |org| %>
<% next unless org != current_organization %>
<li>
<a href="#" data-id="<%= org.id %>" class="text-center">
<a href="#"
data-id="<%= org.id %>"
class="text-center change-team">
<%= org.name %>
</a>
</li>
<% end %>
<% end %>
<li>
<%= link_to new_organization_path do %>
<span class="glyphicon glyphicon-plus"></span>
<%= t('users.settings.organizations.index.new_organization') %>
<% end %>
</li>
</ul>
</li>
<% end %>