Commit 76f3ca86 by muzaffaryousaf

Accessibility fixes for team profile page.

TNL-1930
parent 4aec2abf
...@@ -55,7 +55,10 @@ define([ ...@@ -55,7 +55,10 @@ define([
['en', 'English'], ['en', 'English'],
['fr', 'French'] ['fr', 'French']
], ],
teamMembershipDetailUrl: 'api/team/v0/team_membership/team_id,bilbo' teamMembershipDetailUrl: 'api/team/v0/team_membership/team_id,bilbo',
setFocusToHeaderFunc: function() {
$('.teams-content').focus();
}
}); });
profileView.render(); profileView.render();
AjaxHelpers.expectRequest( AjaxHelpers.expectRequest(
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
this.requestUsername = options.requestUsername; this.requestUsername = options.requestUsername;
this.isPrivileged = options.isPrivileged; this.isPrivileged = options.isPrivileged;
this.teamMembershipDetailUrl = options.teamMembershipDetailUrl; this.teamMembershipDetailUrl = options.teamMembershipDetailUrl;
this.setFocusToHeaderFunc = options.setFocusToHeaderFunc;
this.countries = TeamUtils.selectorOptionsArrayToHashWithBlank(options.countries); this.countries = TeamUtils.selectorOptionsArrayToHashWithBlank(options.countries);
this.languages = TeamUtils.selectorOptionsArrayToHashWithBlank(options.languages); this.languages = TeamUtils.selectorOptionsArrayToHashWithBlank(options.languages);
...@@ -42,6 +43,7 @@ ...@@ -42,6 +43,7 @@
membershipText: TeamUtils.teamCapacityText(memberships.length, this.maxTeamSize), membershipText: TeamUtils.teamCapacityText(memberships.length, this.maxTeamSize),
isMember: isMember, isMember: isMember,
hasCapacity: memberships.length < this.maxTeamSize, hasCapacity: memberships.length < this.maxTeamSize,
hasMembers: memberships.length >= 1
})); }));
this.discussionView = new TeamDiscussionView({ this.discussionView = new TeamDiscussionView({
...@@ -50,6 +52,8 @@ ...@@ -50,6 +52,8 @@
this.discussionView.render(); this.discussionView.render();
this.renderTeamMembers(); this.renderTeamMembers();
this.setFocusToHeaderFunc();
return this; return this;
}, },
......
...@@ -283,6 +283,13 @@ ...@@ -283,6 +283,13 @@
}, },
/** /**
* Sets focus to teams header.
*/
setFocusToHeader: function() {
$('.page-header-main .sr-is-focusable').focus();
},
/**
* Return a promise for the team view for the given team ID. * Return a promise for the team view for the given team ID.
*/ */
getBrowseTeamView: function (topicID, teamID) { getBrowseTeamView: function (topicID, teamID) {
...@@ -301,7 +308,8 @@ ...@@ -301,7 +308,8 @@
requestUsername: self.userInfo.username, requestUsername: self.userInfo.username,
countries: self.countries, countries: self.countries,
languages: self.languages, languages: self.languages,
teamMembershipDetailUrl: self.teamMembershipDetailUrl teamMembershipDetailUrl: self.teamMembershipDetailUrl,
setFocusToHeaderFunc: self.setFocusToHeader
}); });
var teamJoinView = new TeamJoinView({ var teamJoinView = new TeamJoinView({
teamEvents: self.teamEvents, teamEvents: self.teamEvents,
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
data-user-create-comment="<%= !readOnly %>" data-user-create-comment="<%= !readOnly %>"
data-user-create-subcomment="<%= !readOnly %>"> data-user-create-subcomment="<%= !readOnly %>">
<% if ( !readOnly) { %> <% if ( !readOnly) { %>
<a href="#" class="new-post-btn" role="button"><span class="icon fa fa-edit new-post-icon"></span><%= gettext("New Post") %></a> <button type="button" class="btn new-post-btn"><i class="icon fa fa-edit new-post-icon" aria-hidden="true"></i><%= gettext("New Post") %></button>
<% } %> <% } %>
</div> </div>
</div> </div>
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
</div> </div>
<% } %> <% } %>
<div class="team-members"> <div class="team-members">
<span class="sr"><%- gettext("Team member profiles") %></span> <% if (hasMembers) { %>
<span class="sr"><%- gettext("Team member profiles") %></span>
<% } %>
<div class="members-info"></div> <div class="members-info"></div>
</div> </div>
......
...@@ -243,13 +243,13 @@ ...@@ -243,13 +243,13 @@
@include clearfix(); @include clearfix();
@extend %t-copy-sub1; @extend %t-copy-sub1;
padding: ($baseline/2) $baseline; padding: ($baseline/2) $baseline;
background-color: $gray-l5; background-color: $gray-l6;
color: $gray; color: $gray;
.meta-detail { .meta-detail {
margin-top: ($baseline/4); margin-top: ($baseline/4);
@include margin-right ($baseline*.75); @include margin-right ($baseline*.75);
color: $gray; color: $gray-d1;
.icon { .icon {
@include margin-right ($baseline/4); @include margin-right ($baseline/4);
...@@ -372,7 +372,7 @@ ...@@ -372,7 +372,7 @@
margin-bottom: $baseline; margin-bottom: $baseline;
@extend %t-copy-sub1; @extend %t-copy-sub1;
color: $gray-l1; color: $gray;
div, .team-detail-header { div, .team-detail-header {
margin-bottom: ($baseline/4); margin-bottom: ($baseline/4);
......
<header class="page-header has-secondary"> <header class="page-header has-secondary">
<div class="page-header-main"> <div class="page-header-main">
<div class="sr-is-focusable" tabindex="-1"></div>
<% if (breadcrumbs !== null && breadcrumbs.length > 0) { %> <% if (breadcrumbs !== null && breadcrumbs.length > 0) { %>
<nav class="breadcrumbs" aria-label="<%- nav_aria_label %>"> <nav class="breadcrumbs" aria-label="<%- nav_aria_label %>">
<% _.each(breadcrumbs, function (breadcrumb) { %> <% _.each(breadcrumbs, function (breadcrumb) { %>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment