fixed typos and added truncation to org name

This commit is contained in:
zmagod 2016-10-17 09:47:36 +02:00
parent 1614cbc2b2
commit a116feac9c
5 changed files with 26 additions and 11 deletions

View file

@ -6,4 +6,13 @@ module OrganizationsHelper
current_user.save
end
end
def truncate_organization_name(name, len = Constants::NAME_TRUNCATION_LENGTH)
if name.length > len
"<div class='modal-tooltip'>#{truncate(name, length: len)}
<span class='modal-tooltiptext'>#{name}</span></div>".html_safe
else
name
end
end
end

View file

@ -56,7 +56,7 @@ module UsersGenerator
end
end
# Assing user organization as user currentorganization
# Assign user organization as user current organization
nu.current_organization_id = nu.organizations.first.id
nu.save!

View file

@ -111,7 +111,7 @@
</div>
<% end %>
<% if current_organization.projects.length> 0 %>
<% if current_organization.projects.length > 0 %>
<%= render partial: "projects/index/org_projects",
locals: { org: current_organization,
projects: current_organization.projects } %>

View file

@ -104,7 +104,9 @@
<% if current_user.organizations.length > 1 %>
<li class="dropdown" id="team-switch">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span><%= current_organization.name %></span>
<span>
<%= truncate_organization_name(current_organization.name) %>
</span>
</a>
<ul class="dropdown-menu ">
@ -114,7 +116,11 @@
<%= hidden_field(:user, :current_organization_id) %>
<% current_user.organizations.each do |org| %>
<% next unless org != current_organization %>
<li><a href="#" data-id="<%= org.id %>" class="text-center"><%= org.name %></a></li>
<li>
<a href="#" data-id="<%= org.id %>" class="text-center">
<%= org.name %>
</a>
</li>
<% end %>
<% end %>
</ul>

View file

@ -11,7 +11,6 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20161012112900) do
# These are extensions that must be enabled in order to support this database
@ -659,12 +658,13 @@ ActiveRecord::Schema.define(version: 20161012112900) do
t.integer "invitation_limit"
t.integer "invited_by_id"
t.string "invited_by_type"
t.integer "invitations_count", default: 0
t.integer "tutorial_status", default: 0, null: false
t.boolean "assignments_notification", default: true
t.boolean "recent_notification", default: true
t.boolean "assignments_notification_email", default: false
t.boolean "recent_notification_email", default: false
t.integer "invitations_count", default: 0
t.integer "tutorial_status", default: 0, null: false
t.boolean "assignments_notification", default: true
t.boolean "recent_notification", default: true
t.boolean "assignments_notification_email", default: false
t.boolean "recent_notification_email", default: false
t.boolean "system_message_notification_email", default: false
t.integer "current_organization_id"
t.boolean "system_message_notification_email", default: false
end