Skip to content

Commit 223750c

Browse files
committed
feat: port over html for ignored user post settings control
1 parent ac10156 commit 223750c

File tree

1 file changed

+66
-3
lines changed

1 file changed

+66
-3
lines changed

src/components/settings/IgnoredUsersPosts.vue

Lines changed: 66 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,63 @@
22
<div id="ignored-users-posts-settings" class="settings-section">
33
<h3 class="thin-underline">Ignored Users Posts</h3>
44

5+
<div class="row">
6+
<!-- <autocomplete-user-id admin="false" user-id="vmIgnoreUserPosts.userToIgnore.user_id" username="vmIgnoreUserPosts.userToIgnore.username" input-placeholder="Type username to add to ignored posts list"></autocomplete-user-id> -->
7+
<button class="fill-row" @click="ignoreUser()" :disabled="!userToIgnore.user_id">Add to Ignore List</button>
8+
</div>
9+
<div class="clear"></div>
10+
<!-- All Users -->
11+
<table class="striped ignored-users" width="100%">
12+
<thead>
13+
<th></th>
14+
<th>Username</th>
15+
<th>Action</th>
16+
</thead>
17+
<tbody v-if="users.length < 1">
18+
<tr>
19+
<td class="centered-text no-data" colspan="3"><h5>No User Posts Being Ignored</h5></td>
20+
</tr>
21+
</tbody>
22+
<tbody v-for="user in ignored" :key="user.id">
23+
<tr>
24+
<td>
25+
<!-- <div class="user-avatar {{$webConfigs.default_avatar_shape}}">
26+
<a href="">
27+
<img :src="{{::user.avatar || $webConfigs.default_avatar}}">
28+
</a>
29+
</div> -->
30+
</td>
31+
<td>
32+
<a class="user-username" href="">{{user.username}}</a>
33+
</td>
34+
<td v-if="user.ignored">
35+
<a @click="unignoreUser(user)">
36+
<i class="fa fa-user"></i>&nbsp;&nbsp;
37+
Stop Ignoring<span class="hide-mobile"> User's Posts</span>
38+
</a>
39+
</td>
40+
<td v-if="!user.ignored">
41+
<a @click="ignoreUser(user)">
42+
<i class="fa fa-user-times"></i>&nbsp;&nbsp;
43+
Ignore<span class="hide-mobile"> User's Posts</span>
44+
</a>
45+
</td>
46+
</tr>
47+
</tbody>
48+
</table>
49+
50+
<div class="pagination-simple">
51+
<a v-show="prev" @click="pullPage(-1)">
52+
&#10094; Previous
53+
</a>
54+
<span v-show="!prev">&#10094; Previous</span>
55+
&nbsp;&nbsp;&nbsp;
56+
<a v-show="next" @click="pullPage(1)">
57+
Next &#10095;
58+
</a>
59+
<span v-show="!next">Next &#10095;</span>
60+
</div>
61+
562

663
</div>
764
</template>
@@ -15,11 +72,17 @@ export default {
1572
setup() {
1673
onBeforeMount(() => v.ignored = [])
1774
/* View Methods */
18-
const ignoreUser = () => console.log('Ignored Users Posts')
19-
75+
const ignoreUser = () => console.log('Ignore Users Posts')
76+
const unignoreUser = () => console.log('Unignore Users Posts')
77+
const pullPage = page => console.log('Pull page', page)
2078
// const $alertStore = inject('$alertStore')
2179
22-
const v = reactive({ ignored: [] })
80+
const v = reactive({
81+
next: false,
82+
prev: false,
83+
ignored: [],
84+
userToIgnore: {}
85+
})
2386
2487
return { ignoreUser, ...toRefs(v) }
2588
}

0 commit comments

Comments
 (0)