Skip to content

Commit 188bce2

Browse files
committed
Use compact table for followed packages
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 7a7e4c0 commit 188bce2

1 file changed

Lines changed: 67 additions & 24 deletions

File tree

fedcode/templates/user_profile.html

Lines changed: 67 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,23 @@
44
Your Profile
55
{% endblock %}
66

7+
{% block extra-head %}
8+
<style>
9+
/* Remove the border below the table header */
10+
thead th {
11+
border-bottom: none !important;
12+
}
13+
14+
tbody tr:hover {
15+
background-color: #e0e0e0 !important;
16+
cursor: pointer;
17+
}
18+
19+
tbody tr:nth-child(even):hover {
20+
background-color: #d3d3d3 !important;
21+
}
22+
</style>
23+
{% endblock %}
724

825
{% block content %}
926
<div class="columns">
@@ -47,32 +64,58 @@
4764

4865
</div>
4966
<div class="column is-8 ml-3 mr-6">
50-
<div class="container">
51-
<article class="panel is-info">
52-
{% if followings %}
53-
<p class="panel-heading">
54-
Following List
55-
</p>
56-
{% endif %}
57-
{% for following in followings %}
58-
<a class="panel-block is-active" href="#">
59-
<a href="{% url 'purl-profile' following.package.purl %}" class="button is-fullwidth">
60-
{{ following.package.purl }}@{{ following.package.service.user.username }}
61-
</a>
62-
</a>
63-
{% endfor %}
64-
</article>
65-
<nav class="pagination is-rounded" role="navigation" aria-label="pagination">
67+
<div class="box">
68+
<table class="table is-striped is-hoverable is-fullwidth">
69+
<thead>
70+
<tr>
71+
<th>
72+
<div class="box is-small">
73+
<div class="columns">
74+
<div class="column is-full">
75+
Followed Packages
76+
</div>
77+
</div>
78+
</div>
79+
</th>
80+
</tr>
81+
</thead>
82+
<tbody>
83+
{% for following in followings %}
84+
<tr>
85+
<td>
86+
<a href="{% url 'purl-profile' following.package.purl %}" class="has-text-info">
87+
<div class="columns px-5">
88+
<div class="column is-full">
89+
{{ following.package.acct }}
90+
</div>
91+
</div>
92+
</a>
93+
</td>
94+
</tr>
95+
{% empty %}
96+
<tr>
97+
<td class="has-text-centered" colspan="1">No package followed.</td>
98+
</tr>
99+
{% endfor %}
100+
</tbody>
101+
</table>
66102

67-
{% if followings.has_previous %}
68-
<a class="pagination-previous" href="?page={{ followings.previous_page_number }}">Previous</a>
69-
{% endif %}
70-
71-
{% if followings.has_next %}
72-
<a class="pagination-next" href="?page={{ followings.next_page_number }}">Next page</a>
73-
{% endif %}
74-
</nav>
75103
</div>
104+
<nav class="pagination is-centered px-5" role="navigation" aria-label="pagination">
105+
{% if followings.has_previous %}
106+
<a class="pagination-previous" href="?page={{ followings.previous_page_number }}">Previous</a>
107+
{% endif %}
108+
109+
{% if followings.has_next %}
110+
<a class="pagination-next" href="?page={{ followings.next_page_number }}">Next page</a>
111+
{% endif %}
112+
<ul class="pagination-list">
113+
<li><a class="pagination-link" aria-label="Goto page 1" href="?page=1">1</a></li>
114+
<li><span class="pagination-ellipsis">&hellip;</span></li>
115+
<li><a class="pagination-link" aria-label="Goto page {{ followings.number }}"
116+
href="?page={{ followings.paginator.num_pages }}">{{ followings.paginator.num_pages }}</a></li>
117+
</ul>
118+
</nav>
76119
</div>
77120
</div>
78121
{% endblock %}

0 commit comments

Comments
 (0)