settings: Clean up muted_topics/users rendering logic.

This commit removes the unnecessary `data-list-widget` attribute
present in the <div> and <tbody> tag for muted_topics and muted_users table.

It became unnecessary/useless in 19cf6d0e04 and
then was renamed while still useless.

Also uses the correct variable name `muted_topic` and `muted_user`
instead of `muted_topics` and `muted_users` to render a item of their list
in DOM through Listwidget.
This commit is contained in:
jai2201 2022-02-21 22:55:49 +05:30 committed by Tim Abbott
parent 5e49ddf4e1
commit d6c00521b3
6 changed files with 10 additions and 10 deletions

View File

@ -16,8 +16,8 @@ export function populate_list() {
ListWidget.create(muted_topics_table, all_muted_topics, {
name: "muted-topics-list",
modifier(muted_topics) {
return render_muted_topic_ui_row({muted_topics});
modifier(muted_topic) {
return render_muted_topic_ui_row({muted_topic});
},
filter: {
element: $search_input,

View File

@ -21,8 +21,8 @@ export function populate_list() {
ListWidget.create(muted_users_table, all_muted_users, {
name: "muted-users-list",
modifier(muted_users) {
return render_muted_user_ui_row({muted_users});
modifier(muted_user) {
return render_muted_user_ui_row({muted_user});
},
filter: {
element: $search_input,

View File

@ -1,4 +1,4 @@
{{#with muted_topics}}
{{#with muted_topic}}
<tr data-stream-id="{{stream_id}}" data-stream="{{stream}}" data-topic="{{topic}}" data-date-muted="{{date_muted_str}}">
<td>{{stream}}</td>
<td>{{topic}}</td>

View File

@ -1,4 +1,4 @@
{{#with muted_users}}
{{#with muted_user}}
<tr data-user-id="{{user_id}}" data-user-name="{{user_name}}" data-date-muted="{{date_muted_str}}">
<td>{{user_name}}</td>
<td>{{date_muted_str}}</td>

View File

@ -1,6 +1,6 @@
<div id="muted-topic-settings" class="settings-section" data-name="muted-topics">
<input id="muted_topics_search" class="search" type="text" placeholder="{{t 'Filter muted topics' }}" aria-label="{{t 'Filter muted topics' }}"/>
<div class="progressive-table-wrapper" data-simplebar data-list-widget="muted-topics-list">
<div class="progressive-table-wrapper" data-simplebar>
<table class="table table-condensed table-striped wrapped-table">
<thead class="table-sticky-headers">
<th data-sort="alphabetic" data-sort-prop="stream">{{t "Stream" }}</th>
@ -8,7 +8,7 @@
<th data-sort="numeric" data-sort-prop="date_muted">{{t "Date muted" }}</th>
<th class="actions">{{t "Actions" }}</th>
</thead>
<tbody id="muted_topics_table" class="required-text" data-empty="{{t 'You have not muted any topics yet.'}}" data-list-widget="muted-topics-list"></tbody>
<tbody id="muted_topics_table" class="required-text" data-empty="{{t 'You have not muted any topics yet.'}}"></tbody>
</table>
</div>
</div>

View File

@ -1,13 +1,13 @@
<div id="muted-user-settings" class="settings-section" data-name="muted-users">
<input id="muted_users_search" class="search" type="text" placeholder="{{t 'Filter muted users' }}" aria-label="{{t 'Filter muted users' }}"/>
<div class="progressive-table-wrapper" data-simplebar data-list-widget="muted-users-list">
<div class="progressive-table-wrapper" data-simplebar>
<table class="table table-condensed table-striped wrapped-table">
<thead class="table-sticky-headers">
<th data-sort="alphabetic" data-sort-prop="user_name">{{t "User" }}</th>
<th data-sort="numeric" data-sort-prop="date_muted">{{t "Date muted" }}</th>
<th class="actions">{{t "Actions" }}</th>
</thead>
<tbody id="muted_users_table" class="required-text" data-empty="{{t 'You have not muted any users yet.'}}" data-list-widget="muted-users-list"></tbody>
<tbody id="muted_users_table" class="required-text" data-empty="{{t 'You have not muted any users yet.'}}"></tbody>
</table>
</div>
</div>