From 1e5f3f395b7efb997741e16207625b58a5ab361b Mon Sep 17 00:00:00 2001 From: Alma Armas Date: Wed, 27 Jan 2021 17:40:37 +0000 Subject: [PATCH] Fix microblog --- Web/Presenters/templates/components/post.xml | 14 +- .../components/post/microblogpost.xml | 186 +++++++-------- .../templates/components/post/oldpost.xml | 212 +++++++++--------- 3 files changed, 206 insertions(+), 206 deletions(-) diff --git a/Web/Presenters/templates/components/post.xml b/Web/Presenters/templates/components/post.xml index a099983a..83f5497e 100644 --- a/Web/Presenters/templates/components/post.xml +++ b/Web/Presenters/templates/components/post.xml @@ -1,7 +1,7 @@ -{ifset $thisUser} - {if $thisUser->hasMicroblogEnabled()} - {include "post/microblogpost.xml", post => $post} - {else} - {include "post/oldpost.xml", post => $post} - {/if} -{/ifset} \ No newline at end of file +{var microblogEnabled = isset($thisUser) ? $thisUser->hasMicroblogEnabled() : false} + +{if $microblogEnabled} + {include "post/microblogpost.xml", post => $post} +{else} + {include "post/oldpost.xml", post => $post} +{/if} diff --git a/Web/Presenters/templates/components/post/microblogpost.xml b/Web/Presenters/templates/components/post/microblogpost.xml index 0807c300..6cea48b3 100644 --- a/Web/Presenters/templates/components/post/microblogpost.xml +++ b/Web/Presenters/templates/components/post/microblogpost.xml @@ -1,93 +1,93 @@ -{var author = $post->getOwner()} - - - - - - - - -
- - - -
-
- {$post->getText()|noescape} - -
-
- {include "../attachment.xml", attachment => $attachment} -
-
-
-
-
-  ! Этот пост был размещён за взятку. -
-
- {var acutalAuthor = $post->getOwner(false)} - - Автор: - - {$acutalAuthor->getCanonicalName()} - - -
-
-
- {$post->getPublicationTime()} - {if isset($thisUser)} -   - - {if !($forceNoCommentsLink ?? false)} - - {if $post->getCommentsCount() > 0} - {_"comments"} ({$post->getCommentsCount()}) - {else} - {_"comments"} - {/if} - - {/if} - - - - - - {/if} -
-
- -
-
+{var author = $post->getOwner()} + + + + + + + + +
+ + + +
+
+ {$post->getText()|noescape} + +
+
+ {include "../attachment.xml", attachment => $attachment} +
+
+
+
+
+  ! Этот пост был размещён за взятку. +
+
+ {var acutalAuthor = $post->getOwner(false)} + + Автор: + + {$acutalAuthor->getCanonicalName()} + + +
+
+
+ {$post->getPublicationTime()} + {if isset($thisUser)} +   + + {if !($forceNoCommentsLink ?? false)} + + {if $post->getCommentsCount() > 0} + {_"comments"} ({$post->getCommentsCount()}) + {else} + {_"comments"} + {/if} + + {/if} + + + + + + {/if} +
+
+ +
+
diff --git a/Web/Presenters/templates/components/post/oldpost.xml b/Web/Presenters/templates/components/post/oldpost.xml index f3d17ff4..e70c0361 100644 --- a/Web/Presenters/templates/components/post/oldpost.xml +++ b/Web/Presenters/templates/components/post/oldpost.xml @@ -1,106 +1,106 @@ -{var author = $post->getOwner()} - - - - - - - - -
- - - -
-
- {$post->getText()|noescape} - -
-
- {include "../attachment.xml", attachment => $attachment} -
-
-
-
-
-  ! Этот пост был размещён за взятку. -
-
- {var acutalAuthor = $post->getOwner(false)} - - Автор: - - {$acutalAuthor->getCanonicalName()} - - -
-
-
- {if $post->canBeDeletedBy($thisUser) && !($forceNoDeleteLink ?? false)} - {_"delete"} |  - {/if} - - {if !($forceNoCommentsLink ?? false)} - - {if $post->getCommentsCount() > 0} - {_"comments"} ({$post->getCommentsCount()}) - {else} - {_"comments"} - {/if} - -  |  - {/if} - - - {if $post->getRepostCount() > 0} - {_"share"} - ({$post->getRepostCount()}) - {else} - {_"share"} - {/if} - - - - -
-
- -
-
+{var author = $post->getOwner()} + + + + + + + + +
+ + + +
+
+ {$post->getText()|noescape} + +
+
+ {include "../attachment.xml", attachment => $attachment} +
+
+
+
+
+  ! Этот пост был размещён за взятку. +
+
+ {var acutalAuthor = $post->getOwner(false)} + + Автор: + + {$acutalAuthor->getCanonicalName()} + + +
+
+
+ {if $post->canBeDeletedBy($thisUser) && !($forceNoDeleteLink ?? false)} + {_"delete"} |  + {/if} + + {if !($forceNoCommentsLink ?? false)} + + {if $post->getCommentsCount() > 0} + {_"comments"} ({$post->getCommentsCount()}) + {else} + {_"comments"} + {/if} + +  |  + {/if} + + + {if $post->getRepostCount() > 0} + {_"share"} + ({$post->getRepostCount()}) + {else} + {_"share"} + {/if} + + + + +
+
+ +
+