]> git.lizzy.rs Git - cheatdb.git/commitdiff
Improve tags page layout and add link to profile
authorrubenwardy <rw@rubenwardy.com>
Tue, 14 Jul 2020 23:54:26 +0000 (00:54 +0100)
committerrubenwardy <rw@rubenwardy.com>
Tue, 14 Jul 2020 23:54:26 +0000 (00:54 +0100)
app/templates/todo/tags.html
app/templates/users/profile.html

index 04f270adc58a803a4d5794ce15a79a141a760bfb..a61f77ff09ee817337cfcfb96e6085d59765241f 100644 (file)
@@ -6,21 +6,10 @@
 
 {% block content %}
 
-<style>
-       table {
-               width:auto;
-       }
-       td {
-               white-space:nowrap;
-       }
-       table td:last-child {
-               width: 100%;
-       }
-</style>
-
 <table class="table">
        <tr>
                <th>Package</th>
+               <th></th>
                <th>Tags</th>
        </tr>
        {% for package in packages %}
 
                                by {{ package.author.display_name }}
                        </td>
+                       <td>
+                               {% if package.checkPerm(current_user, "EDIT_PACKAGE") %}
+                                       <a class="btn btn-link btn-sm py-0" href="{{ package.getEditURL() }}">
+                                               <i class="fas fa-edit"></i>
+                                       </a>
+                               {% endif %}
+                       </td>
                        <td class="tags">
                                {% for tag in package.tags %}
                                        <span class="badge badge-primary mr-1">{{ tag.title }}</span>
index 4af1c1de5741286c0460f57b4def283c1f49cc02..64102b9f6cc24143c046db289ddbdbde61ba9a03 100644 (file)
@@ -16,6 +16,7 @@
 {% endif %}
 
 <div class="row mb-3">
+
        <div class="col-sm-6">
                <div class="card">
                        <h2 class="card-header">{{ user.display_name }}</h2>
 {% endif %}
 </div>
 
+{% if current_user == user or (current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.EDITOR)) %}
+<a class="float-right btn btn-sm btn-primary"
+               href="{{ url_for('todo.tags', author=user.username) }}">
+       View list of tags
+</a>
+{% endif %}
 
 <h2 class="my-3">{{ _("Packages") }}</h2>