diff options
| author | rubenwardy <rw@rubenwardy.com> | 2019-11-15 23:51:42 +0000 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2019-11-15 23:51:42 +0000 |
| commit | 64f131ae27a7332245b5a4eb8e1e4879d7d99578 (patch) | |
| tree | a0b4101ca9c2132a072f1586c0df693583c91cf7 /app/templates/macros | |
| parent | 015abe5a2507ad02273bc89953016c386aae4457 (diff) | |
| download | cheatdb-64f131ae27a7332245b5a4eb8e1e4879d7d99578.tar.xz | |
Refactor endpoints to use blueprints instead
Diffstat (limited to 'app/templates/macros')
| -rw-r--r-- | app/templates/macros/threads.html | 12 | ||||
| -rw-r--r-- | app/templates/macros/topics.html | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/app/templates/macros/threads.html b/app/templates/macros/threads.html index fd7b648..16b67a0 100644 --- a/app/templates/macros/threads.html +++ b/app/templates/macros/threads.html @@ -4,7 +4,7 @@ {% for r in thread.replies %} <li class="row my-2 mx-0"> <div class="col-md-1 p-1"> - <a href="{{ url_for('user_profile_page', username=r.author.username) }}"> + <a href="{{ url_for('users.profile', username=r.author.username) }}"> <img class="img-responsive user-photo img-thumbnail img-thumbnail-1" src="{{ r.author.getProfilePicURL() }}"> </a> </div> @@ -12,11 +12,11 @@ <div class="card"> <div class="card-header"> <a class="author {{ r.author.rank.name }}" - href="{{ url_for('user_profile_page', username=r.author.username) }}"> + href="{{ url_for('users.profile', username=r.author.username) }}"> {{ r.author.display_name }} </a> <a name="reply-{{ r.id }}" class="text-muted float-right" - href="{{ url_for('thread_page', id=thread.id) }}#reply-{{ r.id }}"> + href="{{ url_for('threads.view', id=thread.id) }}#reply-{{ r.id }}"> {{ r.created_at | datetime }} </a> </div> @@ -43,7 +43,7 @@ </div> {% if current_user.canCommentRL() %} - <form method="post" action="{{ url_for('thread_page', id=thread.id)}}" class="card-body"> + <form method="post" action="{{ url_for('threads.view', id=thread.id)}}" class="card-body"> <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" /> <textarea class="form-control markdown" required maxlength=500 name="comment"></textarea><br /> <input class="btn btn-primary" type="submit" value="Comment" /> @@ -65,14 +65,14 @@ {% for t in threads %} <li {% if list_group %}class="list-group-item"{% endif %}> {% if list_group %} - <a href="{{ url_for('thread_page', id=t.id) }}"> + <a href="{{ url_for('threads.view', id=t.id) }}"> {% if t.private %}🔒 {% endif %} {{ t.title }} by {{ t.author.display_name }} </a> {% else %} {% if t.private %}🔒 {% endif %} - <a href="{{ url_for('thread_page', id=t.id) }}">{{ t.title }}</a> + <a href="{{ url_for('threads.view', id=t.id) }}">{{ t.title }}</a> by {{ t.author.display_name }} {% endif %} </li> diff --git a/app/templates/macros/topics.html b/app/templates/macros/topics.html index a6d0a42..987f810 100644 --- a/app/templates/macros/topics.html +++ b/app/templates/macros/topics.html @@ -18,14 +18,14 @@ {% if topic.wip %}[WIP]{% endif %} </td> {% if show_author %} - <td><a href="{{ url_for('user_profile_page', username=topic.author.username) }}">{{ topic.author.display_name}}</a></td> + <td><a href="{{ url_for('users.profile', username=topic.author.username) }}">{{ topic.author.display_name}}</a></td> {% endif %} <td>{{ topic.name or ""}}</td> <td>{{ topic.created_at | date }}</td> <td class="btn-group"> {% if current_user == topic.author or topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %} <a class="btn btn-primary" - href="{{ url_for('create_edit_package_page', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}"> + href="{{ url_for('packages.create_edit', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}"> Create </a> {% endif %} @@ -56,10 +56,10 @@ {% if topic.wip %}[WIP]{% endif %} {% if topic.name %}[{{ topic.name }}]{% endif %} {% if show_author %} - by <a href="{{ url_for('user_profile_page', username=topic.author.username) }}">{{ topic.author.display_name }}</a> + by <a href="{{ url_for('users.profile', username=topic.author.username) }}">{{ topic.author.display_name }}</a> {% endif %} {% if topic.author == current_user or topic.author.checkPerm(current_user, "CHANGE_AUTHOR") %} - | <a href="{{ url_for('create_edit_package_page', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">Create</a> + | <a href="{{ url_for('packages.create_edit', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">Create</a> {% endif %} </li> {% endfor %} |
