mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 10:59:51 +08:00
TRIVIAL: use class instead of id for the 'topic-list'
This commit is contained in:
parent
2096861d79
commit
b196de0821
|
@ -29,14 +29,14 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
|||
'c': '#create-topic', // create new topic
|
||||
|
||||
// star topic
|
||||
'f': '#topic-footer-buttons button.star, #topic-list tr.topic-list-item.selected a.star',
|
||||
'f': '#topic-footer-buttons button.star, .topic-list tr.topic-list-item.selected a.star',
|
||||
|
||||
'm m': 'div.notification-options li[data-id="0"] a', // mark topic as muted
|
||||
'm r': 'div.notification-options li[data-id="1"] a', // mark topic as regular
|
||||
'm t': 'div.notification-options li[data-id="2"] a', // mark topic as tracking
|
||||
'm w': 'div.notification-options li[data-id="3"] a', // mark topic as watching
|
||||
'n': '#user-notifications', // open notifictions menu
|
||||
'o,enter': '#topic-list tr.selected a.title', // open selected topic
|
||||
'o,enter': '.topic-list tr.selected a.title', // open selected topic
|
||||
'shift+r': '#topic-footer-buttons button.create', // reply to topic
|
||||
'shift+s': '#topic-footer-buttons button.share', // share topic
|
||||
's': '.topic-post.selected a.post-date' // share post
|
||||
|
@ -248,11 +248,11 @@ Discourse.KeyboardShortcuts = Ember.Object.createWithMixins({
|
|||
},
|
||||
|
||||
_findArticles: function() {
|
||||
var $topicList = $('#topic-list'),
|
||||
var $topicList = $('.topic-list'),
|
||||
$topicArea = $('.posts-wrapper');
|
||||
|
||||
if ($topicArea.size() > 0) {
|
||||
return $('.posts-wrapper .topic-post, #topic-list tbody tr');
|
||||
return $('.posts-wrapper .topic-post, .topic-list tbody tr');
|
||||
}
|
||||
else if ($topicList.size() > 0) {
|
||||
return $topicList.find('.topic-list-item');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{#if loaded}}
|
||||
{{#if topics}}
|
||||
<table id="topic-list">
|
||||
<table class="topic-list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="default">{{i18n topic.title}}</th>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{#if categories}}
|
||||
<div class='contents'>
|
||||
<table id='topic-list' class='categories'>
|
||||
<table class='topic-list categories'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='category'>{{i18n categories.category}}</th>
|
||||
|
@ -107,5 +107,5 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<footer id='topic-list-bottom'></footer>
|
||||
<footer class='topic-list-bottom'></footer>
|
||||
{{/if}}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
{{#if content.daily.topics.length}}<a href="{{unbound showMoreDailyUrl}}" class='btn btn-default pull-right'>{{i18n show_more}}</a>{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<footer id="topic-list-bottom">
|
||||
<footer class="topic-list-bottom">
|
||||
<h3>
|
||||
{{#if hasDisplayedAllTopLists}}
|
||||
{{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}}.
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
{{#if daily}}<h2><i class="fa fa-calendar-o"></i> {{i18n filters.top.today}}</h2>{{/if}}
|
||||
{{/if}}
|
||||
{{#if showTable}}
|
||||
<table id='topic-list'>
|
||||
<table class='topic-list'>
|
||||
<thead>
|
||||
<tr>
|
||||
{{#if currentUser}}
|
||||
|
@ -83,7 +83,7 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
|
||||
<footer id='topic-list-bottom'>
|
||||
<footer class='topic-list-bottom'>
|
||||
{{#if loadingMore}}
|
||||
<div class='topics-loading'>{{i18n topic.loading_more}}</div>
|
||||
{{/if}}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{#if loaded}}
|
||||
{{#if topics}}
|
||||
<table id="topic-list">
|
||||
<table class="topic-list">
|
||||
{{#groupedEach topic in topics}}
|
||||
<tr {{bind-attr class="archived"}}>
|
||||
<td>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{#each categories}}
|
||||
<div class='category-list-item'>
|
||||
<table id='topic-list'>
|
||||
<table class='topic-list'>
|
||||
<tr>
|
||||
<th class="main-link">
|
||||
{{category-link this allowUncategorized=true}}
|
||||
|
@ -14,7 +14,7 @@
|
|||
</td>
|
||||
</tr>
|
||||
{{/if}}
|
||||
|
||||
|
||||
{{#each topics}}
|
||||
<tr {{bind-attr class="archived :category-topic-link"}}>
|
||||
<td class='main-link'>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{{#if weekly}}<h2><i class="fa fa-calendar-o"></i> {{i18n filters.top.this_week}}</h2>{{/if}}
|
||||
{{#if daily}}<h2><i class="fa fa-calendar-o"></i> {{i18n filters.top.today}}</h2>{{/if}}
|
||||
{{/if}}
|
||||
<table id='topic-list'>
|
||||
<table class='topic-list'>
|
||||
{{#if topicTrackingState.hasIncoming}}
|
||||
<tbody>
|
||||
<tr>
|
||||
|
@ -24,7 +24,7 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
|
||||
<footer id='topic-list-bottom'>
|
||||
<footer class='topic-list-bottom'>
|
||||
{{#if loadingMore}}
|
||||
<div class='topics-loading'>{{i18n topic.loading_more}}</div>
|
||||
{{/if}}
|
||||
|
|
|
@ -11,7 +11,7 @@ export default Discourse.View.extend(UrlRefresh, {
|
|||
}.observes("controller.ordering"),
|
||||
|
||||
rows: function() {
|
||||
return $('#topic-list tbody');
|
||||
return $('.topic-list tbody');
|
||||
},
|
||||
|
||||
enableOrdering: function(){
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export default Discourse.View.extend(Discourse.LoadMore, {
|
||||
classNames: ['paginated-topics-list'],
|
||||
eyelineSelector: '.paginated-topics-list #topic-list tr',
|
||||
eyelineSelector: '.paginated-topics-list .topic-list tr',
|
||||
templateName: 'list/user_topics_list'
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
#topic-list {
|
||||
.topic-list {
|
||||
width: 100%;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
|
@ -21,7 +21,7 @@
|
|||
background: rgba($secondary, .8);
|
||||
|
||||
> tbody > tr {
|
||||
|
||||
|
||||
&.archived a {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
@ -95,7 +95,7 @@
|
|||
}
|
||||
|
||||
|
||||
#topic-list.categories {
|
||||
.topic-list.categories {
|
||||
|
||||
td.category {
|
||||
vertical-align: top;
|
||||
|
@ -121,7 +121,7 @@
|
|||
|
||||
}
|
||||
|
||||
.loading #topic-list {
|
||||
.loading .topic-list {
|
||||
border: 0;
|
||||
@include box-shadow(none);
|
||||
tr {
|
||||
|
@ -186,7 +186,7 @@ clear: both;
|
|||
}
|
||||
}
|
||||
|
||||
#topic-list {
|
||||
.topic-list {
|
||||
.alert {
|
||||
margin-bottom: 0;
|
||||
font-size: 14px;
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
font-size: 18px;
|
||||
}
|
||||
|
||||
#topic-list th, #topic-list td {
|
||||
.topic-list th, .topic-list td {
|
||||
padding: 12px 5px;
|
||||
line-height: 1.25;
|
||||
text-align: right;
|
||||
|
@ -343,12 +343,12 @@
|
|||
float: left;
|
||||
}
|
||||
|
||||
#topic-list .star {
|
||||
.topic-list .star {
|
||||
width: 20px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
#topic-list th:first-of-type, #topic-list td:first-of-type {
|
||||
.topic-list th:first-of-type, .topic-list td:first-of-type {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
|
@ -386,7 +386,7 @@
|
|||
float: right;
|
||||
}
|
||||
|
||||
#topic-list .pull-left {
|
||||
.topic-list .pull-left {
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
border-left: 1px solid transparent;
|
||||
}
|
||||
|
||||
#topic-list tr.selected td:first-child, .topic-list-item.selected td:first-child, .topic-post.selected {
|
||||
.topic-list tr.selected td:first-child, .topic-list-item.selected td:first-child, .topic-post.selected {
|
||||
border-left: 1px solid $danger;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
// Base list
|
||||
// --------------------------------------------------
|
||||
|
||||
#topic-list {
|
||||
.topic-list {
|
||||
margin: 0 0 10px;
|
||||
.fa-thumb-tack {color: $primary;}
|
||||
.fa-thumb-tack.unpinned {color: $primary;}
|
||||
|
@ -149,12 +149,12 @@
|
|||
|
||||
#list-area .top-lists h2 { margin: 5px 0 10px; }
|
||||
|
||||
#topic-list tbody tr.has-excerpt .star {
|
||||
.topic-list tbody tr.has-excerpt .star {
|
||||
vertical-align: top;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
#topic-list.categories {
|
||||
.topic-list.categories {
|
||||
a.title {color: $tertiary;}
|
||||
a.title:visited:not(.badge-notification) {color: scale-color($tertiary, $lightness: 35%);}
|
||||
|
||||
|
@ -244,7 +244,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
#topic-list-bottom {
|
||||
.topic-list-bottom {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
|
@ -325,7 +325,7 @@ and (max-width : 850px) {
|
|||
|
||||
}
|
||||
|
||||
#topic-list {
|
||||
.topic-list {
|
||||
.categories td.category {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
|
|
@ -464,7 +464,7 @@ a.star {
|
|||
#suggested-topics {
|
||||
clear: left;
|
||||
padding: 20px 0 15px 0;
|
||||
#topic-list {
|
||||
.topic-list {
|
||||
> tbody > tr {
|
||||
&:nth-child(odd) {
|
||||
background-color: darken($secondary, 3%);
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
// Base list
|
||||
// --------------------------------------------------
|
||||
|
||||
#topic-list {
|
||||
.topic-list {
|
||||
|
||||
> tbody > tr {
|
||||
&:nth-child(odd) {
|
||||
|
@ -85,7 +85,7 @@ tr.category-topic-link:nth-of-type(odd) {
|
|||
background-color: darken($secondary, 3%) !important;
|
||||
}
|
||||
|
||||
#topic-list.categories {
|
||||
.topic-list.categories {
|
||||
td.latest {
|
||||
vertical-align: top;
|
||||
padding: 5px;
|
||||
|
@ -127,7 +127,7 @@ tr.category-topic-link:nth-of-type(odd) {
|
|||
|
||||
.category-list-item {
|
||||
|
||||
#topic-list > tbody > tr {
|
||||
.topic-list > tbody > tr {
|
||||
&:nth-child(odd) {
|
||||
background-color: $secondary;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ tr.category-topic-link:nth-of-type(odd) {
|
|||
}
|
||||
|
||||
|
||||
#topic-list-bottom {
|
||||
.topic-list-bottom {
|
||||
margin: 20px 12px 0 12px;
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ ol.category-breadcrumb {
|
|||
|
||||
.top-lists {
|
||||
h2 { margin-left: 10px; }
|
||||
#topic-list { padding-bottom: 10px; }
|
||||
.topic-list { padding-bottom: 10px; }
|
||||
.btn-default.pull-right { margin-right: 10px; }
|
||||
}
|
||||
|
||||
|
@ -286,7 +286,7 @@ ol.category-breadcrumb {
|
|||
display: none;
|
||||
}
|
||||
|
||||
#topic-list-bottom h3 {
|
||||
.topic-list-bottom h3 {
|
||||
clear:both;
|
||||
padding-top:10px;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ var run = function(){
|
|||
page.runTests = function(){
|
||||
|
||||
test("at least one topic shows up", function() {
|
||||
return $('#topic-list tbody tr').length > 0;
|
||||
return $('.topic-list tbody tr').length > 0;
|
||||
});
|
||||
|
||||
test("expect a log in button", function(){
|
||||
|
|
|
@ -35,7 +35,7 @@ module("Discourse.KeyboardShortcuts", {
|
|||
" <li data-id='3'><a></a></li>",
|
||||
" </ul>",
|
||||
"</div>",
|
||||
"<table id='topic-list'>",
|
||||
"<table class='topic-list'>",
|
||||
" <tr class='topic-list-item selected'><td>",
|
||||
" <a class='title'></a>",
|
||||
" </td></tr>",
|
||||
|
|
|
@ -4,8 +4,8 @@ test("Default List", function() {
|
|||
expect(2);
|
||||
|
||||
visit("/").then(function() {
|
||||
ok(exists("#topic-list"), "The list of topics was rendered");
|
||||
ok(exists('#topic-list .topic-list-item'), "has topics");
|
||||
ok(exists(".topic-list"), "The list of topics was rendered");
|
||||
ok(exists('.topic-list .topic-list-item'), "has topics");
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -13,8 +13,8 @@ test("List one Category", function() {
|
|||
expect(2);
|
||||
|
||||
visit("/category/bug").then(function() {
|
||||
ok(exists("#topic-list"), "The list of topics was rendered");
|
||||
ok(exists('#topic-list .topic-list-item'), "has topics");
|
||||
ok(exists(".topic-list"), "The list of topics was rendered");
|
||||
ok(exists('.topic-list .topic-list-item'), "has topics");
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user