File tree Expand file tree Collapse file tree
federatedcode/static/images Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 < meta charset ="utf-8 ">
77 < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
88 < title > {% block title %}FederatedCode.io{% endblock %}</ title >
9- < link rel ="icon " href ="{% static 'images/favicon.ico ' %} " />
9+ < link rel ="icon " href ="{% static 'images/aboutcode_favicon-32x32.png ' %} " />
1010
1111 < link rel ="stylesheet " href ="{% static 'css/bulma.css' %} " />
1212 < link rel ="stylesheet " href ="{% static 'css/custom.css' %} " />
2929
3030 < script src ="{% static 'js/notification.js' %} " defer > </ script >
3131 < script >
32- // Since django can not determine the client’s time zone automatically.
33- // Store client's timezone in cookies to enable localization.
34- // https://docs.djangoproject.com/en/5.1/topics/i18n/timezones/#selecting-the-current-time-zone
32+ // Since django can not determine the client’s time zone automatically.
33+ // Store client's timezone in cookies to enable localization.
34+ // https://docs.djangoproject.com/en/5.1/topics/i18n/timezones/#selecting-the-current-time-zone
3535 const currentTimeZone = Intl . DateTimeFormat ( ) . resolvedOptions ( ) . timeZone ;
3636 document . cookie = "user_timezone=" + currentTimeZone ;
3737 </ script >
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ <h1>My Packages</h1>
5050 < hr />
5151 < pre class ="has-text-black "> {{ note.content }}</ pre >
5252 < hr />
53- < button class ="button " onclick ="window.open('{% url 'note-page' note.id %}'); "> Reply 💬</ button >
53+ < button class ="button " onclick ="window.open('{% url 'note-page' note.id %}'); "> Comment 💬</ button >
5454 </ div >
5555 </ div >
5656 < div class ="media-right ">
Original file line number Diff line number Diff line change 1919 </ p >
2020
2121 < figure class ="media-left ">
22- < p class ="image is-64x64 " style ="margin: auto ">
22+ < p class ="image is-128x128 " style ="margin: auto ">
2323 < img src ="{{ package.acct | get_pkg_image }} " alt ="purl-image ">
2424 </ p >
2525 </ figure >
118118 < div class ="container mt-5 mb-5 ">
119119 < article class ="panel is-info mr-6 ">
120120 < p class ="panel-heading ">
121- Updates
121+ Package Events
122122 </ p >
123123 < div class ="panel-block ">
124124 < article class ="media box " style ="width: 100% ">
136136 </ div >
137137 </ article >
138138 </ div >
139+ {% if is_paginated %}
140+ < nav class ="pagination is-centered px-6 pt-6 pb-4 " role ="navigation " aria-label ="pagination ">
141+ {% if page_obj.has_previous %}
142+ < a class ="pagination-previous " href ="?page={{ page_obj.previous_page_number }} "> Previous</ a >
143+ {% endif %}
144+
145+ {% if page_obj.has_next %}
146+ < a class ="pagination-next " href ="?page={{ page_obj.next_page_number }} "> Next page</ a >
147+ {% endif %}
148+
149+ < ul class ="pagination-list ">
150+ < li > < a class ="pagination-link " aria-label ="Goto page 1 " href ="?page=1 "> 1</ a > </ li >
151+ < li > < span class ="pagination-ellipsis "> …</ span > </ li >
152+ < li > < a class ="pagination-link " aria-label ="Goto page {{ page_obj.number }} "
153+ href ="?page={{ page_obj.paginator.num_pages }} "> {{ page_obj.paginator.num_pages }}</ a > </ li >
154+ </ ul >
155+ </ nav >
156+ {% endif %}
139157 </ article >
140158 </ div >
141159 </ div >
Original file line number Diff line number Diff line change @@ -191,9 +191,16 @@ def get_success_url(self):
191191
192192 def get_context_data (self , ** kwargs ):
193193 context = super ().get_context_data (** kwargs )
194- # slug = purl_string
195194
196- context ["purl_notes" ] = Note .objects .filter (acct = generate_webfinger (self .kwargs ["slug" ]))
195+ # Paginate Package updates.
196+ purl_note_paginate_by = 10
197+ purl_notes = Note .objects .filter (acct = generate_webfinger (self .kwargs ["slug" ]))
198+ paginator = Paginator (purl_notes , purl_note_paginate_by )
199+ page_number = self .request .GET .get ("page" )
200+ page_obj = paginator .get_page (page_number )
201+ context ["purl_notes" ] = page_obj
202+ context ["is_paginated" ] = purl_notes .count () > purl_note_paginate_by
203+ context ["page_obj" ] = page_obj
197204
198205 context ["followers" ] = Follow .objects .filter (package = self .object )
199206
@@ -324,7 +331,7 @@ class PackageListView(ListView, FormMixin):
324331 model = Package
325332 context_object_name = "package_list"
326333 template_name = "pkg_list.html"
327- paginate_by = 20
334+ paginate_by = 30
328335 form_class = SearchPackageForm
329336
330337 def get_queryset (self ):
You can’t perform that action at this time.
0 commit comments