indicate & disable deleted posts

This commit is contained in:
Morgan McMillian 2016-10-30 09:13:53 -07:00
parent 7306635fc6
commit f61584a526
4 changed files with 41 additions and 25 deletions

View file

@ -32,6 +32,9 @@ Container {
property variant theme : Application.themeSupport.theme.colorTheme.style property variant theme : Application.themeSupport.theme.colorTheme.style
enabled: (ListItemData.is_deleted) ? false : true
opacity: (ListItemData.is_deleted) ? 0.5 : 1.0
Container { Container {
layout: DockLayout {} layout: DockLayout {}
horizontalAlignment: HorizontalAlignment.Fill horizontalAlignment: HorizontalAlignment.Fill
@ -132,7 +135,7 @@ Container {
topMargin: ui.sdu(2.0) topMargin: ui.sdu(2.0)
bottomMargin: ui.sdu(2.0) bottomMargin: ui.sdu(2.0)
Label { Label {
text: ListItemData.content.html text: (ListItemData.is_deleted) ? qsTr("<i>{{POST DELETED}}</i>") : ListItemData.content.html
multiline: true multiline: true
textFormat: TextFormat.Html textFormat: TextFormat.Html
} }

View file

@ -57,6 +57,7 @@ NavigationPane {
} }
] ]
onTriggered: { onTriggered: {
if (!postModel.data(indexPath).is_deleted) {
var page = threadPage.createObject(); var page = threadPage.createObject();
pnut.threadReceived.connect(page.loadThread); pnut.threadReceived.connect(page.loadThread);
pnut.getThread(postModel.data(indexPath).thread_id); pnut.getThread(postModel.data(indexPath).thread_id);
@ -68,6 +69,7 @@ NavigationPane {
page.unmute.connect(pnut.unmuteUser) page.unmute.connect(pnut.unmuteUser)
nav.push(page); nav.push(page);
} }
}
function viewProfile(userobj) { function viewProfile(userobj) {
var page = profilePage.createObject(); var page = profilePage.createObject();
page.user = userobj page.user = userobj
@ -204,7 +206,13 @@ NavigationPane {
id: pnut id: pnut
onStreamReceived: { onStreamReceived: {
//nav.parent.unreadContentCount = stream.length
stream.forEach(function(post) {
if (post.is_deleted) {
console.log("got a deleted post")
}
})
switch (rtype) { switch (rtype) {
case Pnut.STREAM_OLDER: case Pnut.STREAM_OLDER:
//streamView.scrollToPosition(ScrollPosition.End, ScrollAnimation.None); //streamView.scrollToPosition(ScrollPosition.End, ScrollAnimation.None);

View file

@ -1 +1 @@
203 209

View file

@ -30,42 +30,47 @@
<context> <context>
<name>PostItem</name> <name>PostItem</name>
<message> <message>
<location filename="../assets/PostItem.qml" line="165"/> <location filename="../assets/PostItem.qml" line="138"/>
<source>&lt;i&gt;{{POST DELETED}}&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../assets/PostItem.qml" line="168"/>
<source>Reply</source> <source>Reply</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/PostItem.qml" line="174"/> <location filename="../assets/PostItem.qml" line="177"/>
<source>Reply All</source> <source>Reply All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/PostItem.qml" line="184"/> <location filename="../assets/PostItem.qml" line="187"/>
<source>Add Bookmark</source> <source>Add Bookmark</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/PostItem.qml" line="184"/> <location filename="../assets/PostItem.qml" line="187"/>
<source>Delete Bookmark</source> <source>Delete Bookmark</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/PostItem.qml" line="195"/> <location filename="../assets/PostItem.qml" line="198"/>
<source>Repost</source> <source>Repost</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/PostItem.qml" line="195"/> <location filename="../assets/PostItem.qml" line="198"/>
<source>Delete Repost</source> <source>Delete Repost</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/PostItem.qml" line="206"/> <location filename="../assets/PostItem.qml" line="209"/>
<source>Quote</source> <source>Quote</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/PostItem.qml" line="215"/> <location filename="../assets/PostItem.qml" line="218"/>
<source>View Profile</source> <source>View Profile</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -152,22 +157,22 @@
<context> <context>
<name>StreamTab</name> <name>StreamTab</name>
<message> <message>
<location filename="../assets/StreamTab.qml" line="121"/> <location filename="../assets/StreamTab.qml" line="123"/>
<source>New Post</source> <source>New Post</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/StreamTab.qml" line="135"/> <location filename="../assets/StreamTab.qml" line="137"/>
<source>To Top</source> <source>To Top</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/StreamTab.qml" line="163"/> <location filename="../assets/StreamTab.qml" line="165"/>
<source>To Bottom</source> <source>To Bottom</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../assets/StreamTab.qml" line="150"/> <location filename="../assets/StreamTab.qml" line="152"/>
<source>Reload</source> <source>Reload</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>