home » zplus/freepost.git
Author zPlus <zplus@peers.community> 2018-07-23 13:25:30
Committer zPlus <zplus@peers.community> 2018-07-23 13:25:30
Commit bd265f4 (patch)
Tree 63ca811
Parent(s)

Fix pagination. modified: freepost/static/stylus/freepost.styl modified: freepost/static/stylus/reset.styl modified: freepost/templates/posts.html modified: freepost/templates/vote.html


commits diff: d4dbdc6..bd265f4
4 files changed, 46 insertions, 25 deletionsdownload


Diffstat
-rwxr-xr-x freepost/static/stylus/freepost.styl 8
-rwxr-xr-x freepost/static/stylus/reset.styl 3
-rw-r--r-- freepost/templates/posts.html 52
-rwxr-xr-x freepost/templates/vote.html 8

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+5/-3 M   freepost/static/stylus/freepost.styl
index e00a71b..0d9bf7a
old size: 10K - new size: 11K
@@ -102,7 +102,7 @@ body
102 102 .vote
103 103 margin 0
104 104
105 - > form
105 + form
106 106 display inline-block
107 107
108 108 > button
@@ -146,14 +146,16 @@ body
146 146 > .post
147 147 display grid
148 148 grid-template-columns min-content auto
149 - margin 0 0 2em 0
149 + grid-column-gap 1.5rem
150 +
151 + margin-bottom 2rem
150 152
151 153 /* Show numbered position in the list */
152 154 > .position
153 155 color #555
154 156 font-style italic
155 157 line-height 1.9rem
156 - margin-right 1.5rem
158 + text-align right
157 159
158 160 > .info
159 161 > .title

+3/-0 M   freepost/static/stylus/reset.styl
index a195e69..cb0ef21
old size: 5K - new size: 5K
@@ -128,6 +128,9 @@ textarea.form-control
128 128 height 8rem
129 129
130 130 .pagination
131 + > form
132 + display inline-block
133 +
131 134 > .page_number
132 135 font-size .7rem
133 136 font-weight bold

+34/-18 M   freepost/templates/posts.html
index ffe58e8..ae714d7
old size: 4K - new size: 4K
@@ -50,11 +50,15 @@
50 50 </time>
51 51 </a>
52 52 </em>
53 +
53 54 by
55 +
54 56 <a href="{{ url ('user_public', username=post.username) }}">
55 57 {{ post.username }}
56 58 </a>
59 +
57 60
61 +
58 62 <a href="{{ url ('post', hash_id=post.hashId) }}#comments">
59 63 {% if post.commentsCount > 0 %}
60 64 {{ post.commentsCount }} comments
@@ -68,18 +72,22 @@
68 72
69 73 {% endfor %}
70 74
71 - <form class="pagination">
72 - {% for key, value in request.query.items () %}
73 - <input type="hidden" name="{{ key }}" value="{{ value }}" />
74 - {% endfor %}
75 -
75 + <div class="pagination">
76 76 {% if page_number > 0 %}
77 - <button type="submit"
78 - name="page"
79 - value="{{ page_number - 1 }}"
80 - class="button button_default1">
81 - Previous
82 - </button>
77 + <form>
78 + {% for key, value in request.query.items () %}
79 + {% if key != 'page' %}
80 + <input type="hidden" name="{{ key }}" value="{{ value }}" />
81 + {% endif %}
82 + {% endfor %}
83 +
84 + <button type="submit"
85 + name="page"
86 + value="{{ page_number - 1 }}"
87 + class="button button_default1">
88 + Previous
89 + </button>
90 + </form>
83 91 {% endif %}
84 92
85 93 {% if page_number > 0 %}
@@ -89,12 +97,20 @@
89 97 {% endif %}
90 98
91 99 {% if posts %}
92 - <button type="submit"
93 - name="page"
94 - value="{{ page_number + 1 }}"
95 - class="button button_default1">
96 - Next
97 - </button>
100 + <form>
101 + {% for key, value in request.query.items () %}
102 + {% if key != 'page' %}
103 + <input type="hidden" name="{{ key }}" value="{{ value }}" />
104 + {% endif %}
105 + {% endfor %}
106 +
107 + <button type="submit"
108 + name="page"
109 + value="{{ page_number + 1 }}"
110 + class="button button_default1">
111 + Next
112 + </button>
113 + </form>
98 114 {% endif %}
99 - </form>
115 + </div>
100 116 </div>

+4/-4 M   freepost/templates/vote.html
index 6c75e12..bb0f191
old size: 2K - new size: 2K
@@ -21,7 +21,7 @@
21 21
22 22 </button>
23 23 </form>
24 -
24 +
25 25 {# Show number of votes #}
26 26 <span class="count">{{ item.vote }}</span>
27 27
@@ -34,11 +34,11 @@
34 34
35 35 </button>
36 36 </form>
37 -
37 +
38 38 {% else %}
39 39
40 - {{ item.vote ~ ' vote' ~ ('s' if item.vote != 1 else '') }}
41 -
40 + {{ item.vote ~ ' vote' ~ ('s' if item.vote != 1) }}
41 +
42 42 {% endif %}
43 43
44 44 </span>