home » zplus/freepost.git
Author zPlus <-> 2016-04-21 14:41:57
Committer zPlus <-> 2016-04-21 14:41:57
Commit c20deea (patch)
Tree e799039
Parent(s)

Word-Wrap long text in posts and comments


commits diff: e319bfc..c20deea
2 files changed, 51 insertions, 45 deletionsdownload


Diffstat
-rw-r--r-- css/freepost.css 24
-rw-r--r-- template/comment.twig 72

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+17/-7 M   css/freepost.css
index 9a9d039..9c52781
old size: 9K - new size: 9K
@@ -164,6 +164,7 @@ html, body
164 164 .content > .post > .text
165 165 {
166 166 margin: 1em 2.5em;
167 + word-wrap: break-word;
167 168 }
168 169
169 170 /* Post "new comment" form */
@@ -201,23 +202,26 @@ html, body
201 202 .content > .post > .comments > .comment
202 203 {
203 204 margin: 0 0 2em 0;
205 + overflow: hidden;
204 206 }
205 207
206 - .content > .post > .comments > .comment .pin
208 + .content > .post > .comments > .comment > .pin
207 209 {
208 210 color: #CD006B;
211 + float: left;
209 212 font-size: .8em;
210 213 padding: 0 1em 0 0;
211 - vertical-align: top;
214 + vertical-align: top;
212 215 }
213 216
214 - .content > .post > .comments > .comment .info
217 + .content > .post > .comments > .comment > .info
215 218 {
216 219 font-size: .9em;
220 + margin: 0 0 0 1em;
217 221 }
218 222
219 - .content > .post > .comments > .comment .info .username > a,
220 - .content > .post > .comments > .comment .info .username > a:hover
223 + .content > .post > .comments > .comment > .info .username > a,
224 + .content > .post > .comments > .comment > .info .username > a:hover
221 225 {
222 226 font-weight: bold;
223 227 }
@@ -234,11 +238,17 @@ html, body
234 238 text-decoration: none;
235 239 }
236 240
237 - .content > .post > .comments > .comment .info > .vote
241 + .content > .post > .comments > .comment > .info > .vote
238 242 {
239 243 margin: 0 1em;
240 244 }
241 -
245 +
246 + .content > .post > .comments > .comment > .text
247 + {
248 + margin: .5em 0 0 1.5em;
249 + word-wrap: break-word;
250 + }
251 +
242 252 /* User home page */
243 253 .content table.user
244 254 {

+34/-38 M   template/comment.twig
index 2c2610c..b29fe29
old size: 2K - new size: 2K
@@ -4,49 +4,45 @@
4 4 {# Add an anchor link for this comment #}
5 5 <a id="comment-{{ comment.hashId }}"></a>
6 6
7 - <table class="comment" style="margin-left:{{ depth * 2 }}em">
8 - <tr>
9 - <td class="pin">▣</td>
7 + <div class="comment" style="margin-left:{{ depth * 2 }}em">
8 + <div class="pin">▣</div>
9 +
10 + <div class="info">
11 + {# Username #}
12 + <span class="username {{ post.userId == comment.userId ? 'op' }}">
13 + <a href="{{ ('user/' ~ comment.username)|docroot }}">{{ comment.username }}</a>
14 + </span>
10 15
11 - <td class="info">
12 - {# Username #}
13 - <span class="username {{ post.userId == comment.userId ? 'op' }}">
14 - <a href="{{ ('user/' ~ comment.username)|docroot }}">{{ comment.username }}</a>
15 - </span>
16 -
17 - {%
18 - include 'vote.twig' with {
19 - target: 'comment',
20 - hash_id: comment.hashId,
21 - vote: votes[comment.id] is defined ? votes[comment.id].vote : null,
22 - vote_count: comment.vote,
23 - user: user is defined ? user : null
24 - } only
25 - %}
16 + {%
17 + include 'vote.twig' with {
18 + target: 'comment',
19 + hash_id: comment.hashId,
20 + vote: votes[comment.id] is defined ? votes[comment.id].vote : null,
21 + vote_count: comment.vote,
22 + user: user is defined ? user : null
23 + } only
24 + %}
25 +
26 + {# DateTime #}
27 + <a href="{{ ('post/' ~ post.hashId ~ '#comment-' ~ comment.hashId)|docroot }}"><em>{{ comment.created|ago }}</em></a>
28 +
29 + {% if user %}
30 +
26 31
27 - {# DateTime #}
28 - <a href="{{ ('post/' ~ post.hashId ~ '#comment-' ~ comment.hashId)|docroot }}"><em>{{ comment.created|ago }}</em></a>
32 + {# Reply #}
33 + <a href="../reply?comment={{ comment.hashId }}">Reply</a>
29 34
30 - {% if user %}
31 -
32 -
33 - {# Reply #}
34 - <a href="../reply?comment={{ comment.hashId }}">Reply</a>
35 -
36 - {% if comment.userId == user.id %}
37 - {# Edit #}
38 - <a href="../edit?comment={{ comment.hashId }}">Edit</a>
39 - {% endif %}
35 + {% if comment.userId == user.id %}
36 + {# Edit #}
37 + <a href="../edit?comment={{ comment.hashId }}">Edit</a>
40 38 {% endif %}
41 - </td>
42 - </tr>
43 - <tr>
44 - <td></td>
45 - <td>
39 + {% endif %}
40 + </div>
41 +
42 + <div class="text">
46 43 {{ comment.text|markdown|raw }}
47 - </td>
48 - </tr>
49 - </table>
44 + </div>
45 + </div>
50 46
51 47 {# Add replies #}
52 48