Commit 4454c819 by Chris Rodriguez

LMS: forum markup tweaks and cleanup

parent d2392b45
...@@ -6,17 +6,17 @@ describe "DiscussionThreadListView", -> ...@@ -6,17 +6,17 @@ describe "DiscussionThreadListView", ->
appendSetFixtures(""" appendSetFixtures("""
<script type="text/template" id="thread-list-template"> <script type="text/template" id="thread-list-template">
<div class="forum-nav-header"> <div class="forum-nav-header">
<a href="#" class="forum-nav-browse" aria-haspopup="true"> <button type="button" class="forum-nav-browse" id="forum-nav-browse" aria-haspopup="true">
<i class="icon fa fa-bars"></i> <span class="icon fa fa-bars" aria-hidden="true"></span>
<span class="sr">Discussion topics; current selection is: </span> <span class="sr">Discussion topics; currently listing: </span>
<span class="forum-nav-browse-current">All Discussions</span> <span class="forum-nav-browse-current">All Discussions</span>
</a> </button>
<form class="forum-nav-search"> <form class="forum-nav-search">
<label> <label>
<span class="sr">Search</span> <span class="sr">Search all posts</span>
<input class="forum-nav-search-input" type="text" placeholder="Search all posts"> <input class="forum-nav-search-input" id="forum-nav-search" type="text" placeholder="Search all posts">
<i class="icon fa fa-search"></i> <span class="icon fa fa-search" aria-hidden="true"></span>
</label> </label>
</form> </form>
</div> </div>
...@@ -66,7 +66,7 @@ describe "DiscussionThreadListView", -> ...@@ -66,7 +66,7 @@ describe "DiscussionThreadListView", ->
</li> </li>
</ul> </ul>
</div> </div>
<div class="forum-nav-thread-list-wrapper"> <div class="forum-nav-thread-list-wrapper" id="sort-filter-wrapper" tabindex="-1">
<div class="forum-nav-refine-bar"> <div class="forum-nav-refine-bar">
<label class="forum-nav-filter-main"> <label class="forum-nav-filter-main">
<select class="forum-nav-filter-main-control"> <select class="forum-nav-filter-main-control">
......
...@@ -15,43 +15,43 @@ ...@@ -15,43 +15,43 @@
</span> </span>
<table class="home-helpgrid"> <table class="home-helpgrid">
<tr class="helpgrid-row helpgrid-row-navigation"> <tr class="helpgrid-row helpgrid-row-navigation">
<td class="row-title"><%- gettext("Find discussions") %></td> <th scope="row" class="row-title"><%- gettext("Find discussions") %></td>
<td class="row-item"> <td class="row-item">
<i class="icon fa fa-reorder"></i> <span class="icon fa fa-reorder" aria-hidden="true"></span>
<span class="row-description"><%- gettext("Focus in on specific topics") %></span> <span class="row-description"><%- gettext("Use the Discussion Topics menu to find specific topics.") %></span>
</td> </td>
<td class="row-item"> <td class="row-item">
<i class="icon fa fa-search"></i> <span class="icon fa fa-search" aria-hidden="true"></span>
<span class="row-description"><%- gettext("Search for specific posts") %></span> <span class="row-description"><%- gettext("Search all posts") %></span>
</td> </td>
<td class="row-item"> <td class="row-item">
<i class="icon fa fa-sort"></i> <span class="icon fa fa-sort" aria-hidden="true"></span>
<span class="row-description"><%- gettext("Sort by date, vote, or comments") %></span> <span class="row-description"><%- gettext("Filter and sort topics") %></span>
</td> </td>
</tr> </tr>
<tr class="helpgrid-row helpgrid-row-participation"> <tr class="helpgrid-row helpgrid-row-participation">
<td class="row-title"><%- gettext("Engage with posts") %></td> <th scope="row" class="row-title"><%- gettext("Engage with posts") %></td>
<td class="row-item"> <td class="row-item">
<i class="icon fa fa-plus"></i> <span class="icon fa fa-plus" aria-hidden="true"></span>
<span class="row-description"><%- gettext("Upvote posts and good responses") %></span> <span class="row-description"><%- gettext("Vote for good posts and responses") %></span>
</td> </td>
<td class="row-item"> <td class="row-item">
<i class="icon fa fa-flag"></i> <span class="icon fa fa-flag" aria-hidden="true"></span>
<span class="row-description"><%- gettext("Report Forum Misuse") %></span> <span class="row-description"><%- gettext("Report abuse, topics, and responses") %></span>
</td> </td>
<td class="row-item"> <td class="row-item">
<i class="icon fa fa-star"></i> <span class="icon fa fa-star" aria-hidden="true"></span>
<span class="row-description"><%- gettext("Follow posts for updates") %></span> <span class="row-description"><%- gettext("Follow or unfollow posts") %></span>
</td> </td>
</tr> </tr>
<tr class="helpgrid-row helpgrid-row-notification"> <tr class="helpgrid-row helpgrid-row-notification">
<td class="row-title"><%- gettext('Receive updates') %></td> <th scope="row" class="row-title"><%- gettext('Receive updates') %></td>
<td class="row-item-full" colspan="3"> <td class="row-item-full" colspan="3">
<label for="email-setting-checkbox"> <label for="email-setting-checkbox">
<span class="sr"><%- gettext("Toggle Notifications Setting") %></span> <span class="sr"><%- gettext("Toggle Notifications Setting") %></span>
<span class="notification-checkbox"> <span class="notification-checkbox">
<input type="checkbox" id="email-setting-checkbox" class="email-setting" name="email-notification"/> <input type="checkbox" id="email-setting-checkbox" class="email-setting" name="email-notification"/>
<i class="icon fa fa-envelope"></i> <span class="icon fa fa-envelope" aria-hidden="true"></span>
</span> </span>
</label> </label>
<span class="row-description"><%- gettext("Check this box to receive an email digest once a day notifying you about new, unread activity from posts you are following.") %></span> <span class="row-description"><%- gettext("Check this box to receive an email digest once a day notifying you about new, unread activity from posts you are following.") %></span>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<div class="post-options"> <div class="post-options">
<label class="post-option is-enabled"> <label class="post-option is-enabled">
<input type="checkbox" name="follow" class="post-option-input js-follow" checked> <input type="checkbox" name="follow" class="post-option-input js-follow" checked>
<i class="icon fa fa-star"></i><%- gettext("follow this post") %> <span class="icon fa fa-star" aria-hidden="true"></span><%- gettext("follow this post") %>
</label> </label>
<% if (allow_anonymous) { %> <% if (allow_anonymous) { %>
<label class="post-option"> <label class="post-option">
...@@ -47,6 +47,6 @@ ...@@ -47,6 +47,6 @@
</div> </div>
<div> <div>
<input type="submit" class="submit" value="<%- gettext('Add Post') %>"> <input type="submit" class="submit" value="<%- gettext('Add Post') %>">
<a href="#" class="cancel"><%- gettext('Cancel') %></a> <button type="button" class="cancel"><%- gettext('Cancel') %></button>
</div> </div>
</form> </form>
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
</span><fieldset class="field-input"><legend class="sr"><%- gettext("Post type:") %></legend> </span><fieldset class="field-input"><legend class="sr"><%- gettext("Post type:") %></legend>
<input aria-describedby="field_help_post_type" type="radio" name="<%= form_id %>-post-type" class="post-type-input" id="<%= form_id %>-post-type-question" value="question"> <input aria-describedby="field_help_post_type" type="radio" name="<%= form_id %>-post-type" class="post-type-input" id="<%= form_id %>-post-type-question" value="question">
<label for="<%= form_id %>-post-type-question" class="post-type-label"> <label for="<%= form_id %>-post-type-question" class="post-type-label">
<i class="icon fa fa-question"></i> <span class="icon fa fa-question" aria-hidden="true"></span>
<% // Translators: This is a forum post type %> <% // Translators: This is a forum post type %>
<%- gettext("Question") %> <%- gettext("Question") %>
</label> </label>
<input aria-describedby="field_help_post_type" type="radio" name="<%= form_id %>-post-type" class="post-type-input" id="<%= form_id %>-post-type-discussion" value="discussion" checked> <input aria-describedby="field_help_post_type" type="radio" name="<%= form_id %>-post-type" class="post-type-input" id="<%= form_id %>-post-type-discussion" value="discussion" checked>
<label for="<%= form_id %>-post-type-discussion" class="post-type-label"> <label for="<%= form_id %>-post-type-discussion" class="post-type-label">
<i class="icon fa fa-comments"></i> <span class="icon fa fa-comments" aria-hidden="true"></span>
<% // Translators: This is a forum post type %> <% // Translators: This is a forum post type %>
<%- gettext("Discussion") %> <%- gettext("Discussion") %>
</label> </label>
......
<% // Using div here instead of label because we are using a non-native control %> <% // Using div here instead of label because we are using a non-native control %>
<div class="field-label"> <div class="field-label">
<span class="field-label-text"><%- gettext("Topic Area:") %></span><div class="field-input post-topic"> <span class="field-label-text"><%- gettext("Topic Area:") %></span><div class="field-input post-topic">
<a href="#" class="post-topic-button"> <button type="button" class="post-topic-button">
<span class="sr"><%- gettext("Discussion topics; current selection is: ") %></span> <span class="sr"><%- gettext("Discussion topics; currently listing: ") %></span>
<span class="js-selected-topic"></span> <span class="js-selected-topic"></span>
<span class="drop-arrow" aria-hidden="true">▾</span> <span class="drop-arrow" aria-hidden="true">▾</span>
</a> </button>
<div class="topic-menu-wrapper"> <div class="topic-menu-wrapper">
<label class="topic-filter-label"> <label class="topic-filter-label">
<span class="sr"><%- gettext("Filter topics") %></span> <span class="sr"><%- gettext("Filter topics") %></span>
......
...@@ -22,15 +22,25 @@ ...@@ -22,15 +22,25 @@
} }
.forum-nav-browse { .forum-nav-browse {
@include box-sizing(border-box); @include box-sizing(border-box);
display: table-cell; display: table-cell;
vertical-align: middle; vertical-align: middle;
width: 50%; width: auto;
padding: ($baseline/4); padding: 11px;
border: 0;
&:hover, &:focus, &.is-active { border-radius: 0;
background-color: $gray-l5; background: transparent;
} box-shadow: none;
&:hover,
&:focus,
&.is-active {
// converted to button from a;
// need importants to overwrite later button styles
box-shadow: none !important;
background-image: none !important;
background-color: $gray-l5 !important;
}
.icon { .icon {
@include font-size(14); @include font-size(14);
...@@ -93,6 +103,33 @@ ...@@ -93,6 +103,33 @@
width: 100%; width: 100%;
} }
.forum-nav-browse-title {
display: block;
width: 100%;
border: 0;
border-radius: 0;
border-bottom: 1px solid $gray-l3;
padding: ($baseline/2) ($baseline/2);
background: transparent;
box-shadow: none;
background-image: none;
color: $link-color;
text-align: left;
&:hover,
&:focus {
// switched from a to button;
// need to override button styles
background-image: none !important;
box-shadow: none !important;
background: $forum-color-active-thread !important;
}
}
.forum-nav-browse-title .icon {
@include margin-right($baseline/2);
}
.forum-nav-browse-menu { .forum-nav-browse-menu {
@include font-size(14); @include font-size(14);
overflow-y: scroll; overflow-y: scroll;
...@@ -100,22 +137,15 @@ ...@@ -100,22 +137,15 @@
} }
.forum-nav-browse-submenu { .forum-nav-browse-submenu {
padding-left: $baseline; list-style: none;
list-style: none; padding: 0;
}
.forum-nav-browse-title {
display: block;
border-bottom: 1px solid $gray-l3;
padding: ($baseline/2) ($baseline/2);
&:hover, &:focus { li {
background: $forum-color-active-thread;
}
}
.forum-nav-browse-title .icon { .forum-nav-browse-title {
@include margin-right($baseline/2); padding-left: $baseline;
}
}
} }
// ------------------- // -------------------
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
@extend %cont-truncated; @extend %cont-truncated;
z-index: 1000; z-index: 1000;
padding: 0 $baseline 0 ($baseline*0.75); padding: 0 $baseline 0 ($baseline*0.75);
width: 100%;
height: 40px; height: 40px;
font-size: 14px; font-size: 14px;
line-height: 36px; line-height: 36px;
......
...@@ -19,13 +19,13 @@ import json ...@@ -19,13 +19,13 @@ import json
data-discussion-id='${entries[entry]["id"]}' data-discussion-id='${entries[entry]["id"]}'
data-cohorted="${str(entries[entry]['is_cohorted']).lower()}" data-cohorted="${str(entries[entry]['is_cohorted']).lower()}"
> >
<a href="#" class="forum-nav-browse-title">${entry}</a> <button type="button" class="forum-nav-browse-title">${entry}</button>
</li> </li>
</%def> </%def>
<%def name="render_category(categories, category)"> <%def name="render_category(categories, category)">
<li class="forum-nav-browse-menu-item"> <li class="forum-nav-browse-menu-item">
<a href="#" class="forum-nav-browse-title">${category}</a> <button type="button" class="forum-nav-browse-title">${category}</button>
<ul class="forum-nav-browse-submenu"> <ul class="forum-nav-browse-submenu">
${render_dropdown(categories[category])} ${render_dropdown(categories[category])}
</ul> </ul>
...@@ -37,15 +37,18 @@ import json ...@@ -37,15 +37,18 @@ import json
<label> <label>
<span class="sr">${_("Filter Topics")}</span> <span class="sr">${_("Filter Topics")}</span>
<input type="text" class="forum-nav-browse-filter-input" placeholder="${_("filter topics")}"> <input type="text" class="forum-nav-browse-filter-input" placeholder="${_("filter topics")}">
<i class="icon fa fa-filter"></i> <span class="icon fa fa-filter" aria-hidden="true"></span>
</label> </label>
</form> </form>
<ul class="forum-nav-browse-menu"> <ul class="forum-nav-browse-menu">
<li class="forum-nav-browse-menu-item forum-nav-browse-menu-all"> <li class="forum-nav-browse-menu-item forum-nav-browse-menu-all">
<a href="#" class="forum-nav-browse-title">${_("All Discussions")}</a> <button type="button" class="forum-nav-browse-title">${_("All Discussions")}</button>
</li> </li>
<li class="forum-nav-browse-menu-item forum-nav-browse-menu-following"> <li class="forum-nav-browse-menu-item forum-nav-browse-menu-following">
<a href="#" class="forum-nav-browse-title"><i class="icon fa fa-star"></i>${_("Posts I'm Following")}</a> <button type="button" class="forum-nav-browse-title">
<span class="icon fa fa-star" aria-hidden="true"></span>
${_("Posts I'm Following")}
</button>
</li> </li>
${render_dropdown(category_map)} ${render_dropdown(category_map)}
</ul> </ul>
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<script type="text/template" id="thread-list-template"> <script type="text/template" id="thread-list-template">
<div class="forum-nav-header"> <div class="forum-nav-header">
<a href="#" class="forum-nav-browse" aria-haspopup="true"> <button type="button" class="forum-nav-browse" id="forum-nav-browse" aria-haspopup="true">
## There is no whitespace between these because the front-end JS code ## There is no whitespace between these because the front-end JS code
## needs to precisely compute the available width for forum-nav- ## needs to precisely compute the available width for forum-nav-
## browse-current in order to do truncation of topic names. ## browse-current in order to do truncation of topic names.
<i class="icon fa fa-reorder"></i><span class="sr">${_("Discussion topics; current selection is: ")}</span><span class="forum-nav-browse-current">${_("All Discussions")}</span><span class="forum-nav-browse-drop-arrow">▾</span> <span class="icon fa fa-reorder" aria-hidden="true"></span>
</a> <span class="sr">${_("Discussion topics; currently listing: ")}</span>
<span class="forum-nav-browse-current">${_("All Discussions")}</span>
<span class="forum-nav-browse-drop-arrow" aria-hidden="true"></span>
</button>
<form class="forum-nav-search"> <form class="forum-nav-search">
<div class="forum-nav-search-ff-position-fix"> <div class="forum-nav-search-ff-position-fix">
<label> <label>
<span class="sr">${_("Search")}</span> <span class="sr">${_("Search all posts")}</span>
<input class="forum-nav-search-input" type="text" placeholder="${_("Search all posts")}"> <input class="forum-nav-search-input" id="forum-nav-search" type="text" placeholder="${_("Search all posts")}">
<i class="icon fa fa-search"></i> <span class="icon fa fa-search" aria-hidden="true"></span>
</label> </label>
</div> </div>
</form> </form>
</div> </div>
<%include file="_filter_dropdown.html" /> <%include file="_filter_dropdown.html" />
<div class="forum-nav-thread-list-wrapper"> <div class="forum-nav-thread-list-wrapper" id="sort-filter-wrapper" tabindex="-1">
<div class="forum-nav-refine-bar"> <div class="forum-nav-refine-bar">
<label class="forum-nav-filter-main"> <label class="forum-nav-filter-main">
## Translators: This labels a filter menu in forum navigation ## Translators: This labels a filter menu in forum navigation
......
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