-
Notifications
You must be signed in to change notification settings - Fork 1
Add category index on homepage #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
angrynode
merged 1 commit into
angrynode:axum
from
Gabatxo1312:add-category-view-as-homepage
Dec 15, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <div class="dropdown"> | ||
| <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> | ||
| Actions | ||
| </button> | ||
| <ul class="dropdown-menu"> | ||
| <li><a class="dropdown-item" href="/categories/new">Create category</a></li> | ||
| </ul> | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| {% extends "layouts/file_system_base.html" %} | ||
|
|
||
| {% block breadcrumb %} | ||
| <li class="breadcrumb-item"> | ||
| <a href="/"> | ||
| Categories | ||
| </a> | ||
| </li> | ||
|
|
||
| <li class="breadcrumb-item"> | ||
| <a href="/folders/{{ category.name }}"> | ||
| {{ category.name }} | ||
| </a> | ||
| </li> | ||
| {% endblock %} | ||
|
|
||
| {% block folder_title %} | ||
| {{ category.name }} | ||
| {% endblock%} | ||
|
|
||
| {% block additional_buttons %} | ||
| <a class="btn btn-dark" href="/"> | ||
| Go up | ||
| </a> | ||
| {% endblock %} | ||
|
|
||
| {% block system_list %} | ||
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,71 +1,43 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block main %} | ||
| <div class="container"> | ||
| <h1>Download files</h1> | ||
|
|
||
| {% if state.free_space.free_space_percent < 5 %} | ||
| <div class="alert alert-warning mt-4"> | ||
| The disks are almost full : <span class="fw-bold">{{ state.free_space.free_space_gib }} GiB left</span> | ||
| </div> | ||
| {% endif %} | ||
| {% extends "layouts/file_system_base.html" %} | ||
|
|
||
| {% block breadcrumb %} | ||
| <li class="breadcrumb-item"> | ||
| <a href="/"> | ||
| Categories | ||
| </a> | ||
| </li> | ||
| {% endblock %} | ||
|
|
||
| <form method="POST" action="/upload" enctype="multipart/form-data" accept-charset="utf-8"> | ||
| <div class="card mt-4"> | ||
| <div class="card-body"> | ||
| <div class="form-group"> | ||
| <label for="collection" class="form-label mb-0">Category</label> | ||
| <div id="collection" class="form-text mb-1">Choose the type of content you want to download.</div> | ||
| <select class="form-select" aria-label="Choose the type of content you want to download" name="collection">{#{% set post_tag = post.tag %} TODO #} | ||
| <option disabled {#{% if post_tag is not defined %}selected{% endif %}#}>Genre</option> | ||
| {% for tag in categories %} | ||
| <option {#{% if post_tag == tag %}selected {% endif %}#}value="{{ tag }}">{{ tag }}</option> | ||
| {% endfor %} | ||
| </select> | ||
| {% block folder_title %} | ||
| All categories | ||
| {% endblock%} | ||
|
|
||
| {% block actions_buttons %} | ||
| {% include "categories/dropdown_actions.html" %} | ||
| {% endblock actions_buttons %} | ||
|
|
||
| {% block system_list %} | ||
| {% for category in categories %} | ||
| <li class="list-group-item py-3"> | ||
| <a class="d-block text-decoration-none" href="/folders/{{ category.name }}"> | ||
| <div class="row"> | ||
| <div class="col-9"> | ||
| <div class="d-flex align-items-center"> | ||
| <i class="fa fa-folder text-info me-3"></i> | ||
| <h5 class="mb-0"> | ||
| {{ category.name }} <code class="ms-2"span><small>{{ category.path }}</small></code> | ||
| </h5> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="row mt-4"> | ||
| <div class="col-sm"> | ||
| {% include "sources/magnet.html" %} | ||
| </div> | ||
|
|
||
| <div class="col-md-1 mt-3 mt-sm-0"> | ||
| <div class="d-flex align-items-center h-100 justify-content-center"> | ||
| <h2>OR</h2> | ||
| <div class="col-3"> | ||
| <p class="mb-0 fst-italic text-end"> | ||
| <i class="fa fa-chevron-right"></i> | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </a> | ||
| </li> | ||
| {% endfor %} | ||
| {% endblock %} | ||
|
|
||
| <div class="col-sm mt-3 mt-sm-0"> | ||
| {% include "sources/torrent.html" %} | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="text-center mt-4"> | ||
| <input type="Submit" class="btn btn-success btn-lg" value="Next"> | ||
| </div> | ||
| </form> | ||
|
|
||
| {% if categories.len() == 0 %} | ||
| <div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="false"> | ||
| <div class="modal-dialog modal-dialog-centered"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h1 class="modal-title fs-5" id="staticBackdropLabel">Oops, you don't have any categories yet</h1> | ||
| </div> | ||
| <div class="modal-body"> | ||
| {% include "categories/form.html" %} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <script> | ||
| window.addEventListener("load", (event) => { | ||
| const modal = new bootstrap.Modal('#staticBackdrop').show() | ||
| }); | ||
| </script> | ||
| {% endif %} | ||
| </div> | ||
| {% endblock %} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| {% extends "base.html" %} | ||
|
|
||
| {% block main %} | ||
| <div class="container"> | ||
| <h1>File System</h1> | ||
|
|
||
| {% block alert_message %}{% endblock alert_message %} | ||
|
|
||
| {% if state.free_space.free_space_percent < 5 %} | ||
| <div class="alert alert-warning mt-4"> | ||
| The disks are almost full : <span class="fw-bold">{{ state.free_space.free_space_gib }} GiB left</span> | ||
| </div> | ||
| {% endif %} | ||
|
|
||
| <div class="row align-items-center"> | ||
| <div class="col-md-10"> | ||
| <nav aria-label="breadcrumb"> | ||
| <ol class="breadcrumb mb-0"> | ||
| {% block breadcrumb %}{% endblock breadcrumb %} | ||
| </ol> | ||
| </nav> | ||
| </div> | ||
|
|
||
| <div class="col-md-2 text-end"> | ||
| {% block actions_buttons %}{% endblock actions_buttons %} | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="card mt-4"> | ||
| <div class="card-body"> | ||
| <div class="p-4"> | ||
| <div class="d-flex align-items-center mb-4"> | ||
| <h4 class="mb-0">{% block folder_title %}{% endblock folder_title %}</h4> <div class="ms-4">{% block additional_buttons %}{% endblock additional_buttons %}</div> | ||
| </div> | ||
|
|
||
| <ul class="list-group"> | ||
| {% block system_list %}{% endblock system_list %} | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="modal fade" id="createSubFolder" tabindex="-1" aria-labelledby="createSubFolderLabel" aria-hidden="false"> | ||
| <div class="modal-dialog"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h1 class="modal-title fs-5" id="staticBackdropLabel">Create sub-folder</h1> | ||
| </div> | ||
| <div class="modal-body"> | ||
| {% block content_folder_form %}{% endblock content_folder_form %} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.