-
-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Sort plugins alphabetically by name * Load plugin manifests + some tests * Commit new work on plugins * Test plugins meta loader * WIP plugins list in admin * Add tests for admin plugins list * Fix build * Fix plugins not being found on CI * Test empty plugins list * Tweak font awesome icon regex * Add tests * Update admin plugins list * Tweak spacing * Fix tests * Tweak test * Tweak plugin docs * Small doc tweak
- Loading branch information
Showing
30 changed files
with
892 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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 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 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,19 @@ | ||
// Admin media icon | ||
// | ||
// Used in content tables to represent an item | ||
|
||
.media-admin-icon { | ||
@extend .d-flex; | ||
@extend .align-items-center; | ||
@extend .justify-content-center; | ||
@extend .rounded; | ||
|
||
width: $admin-media-icon-size; | ||
height: $admin-media-icon-size; | ||
|
||
font-size: $font-size-base; | ||
line-height: $font-size-base; | ||
|
||
color: $admin-media-icon-color; | ||
background: $admin-media-icon-bg; | ||
} |
This file contains 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 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 |
---|---|---|
|
@@ -54,3 +54,4 @@ | |
@import "admin-table"; | ||
@import "admin-form"; | ||
@import "admin-error"; | ||
@import "admin-media-icon"; |
This file contains 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 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 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 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,19 @@ | ||
from django.urls import path | ||
from django.utils.translation import pgettext_lazy | ||
|
||
from .views import plugins_list | ||
|
||
|
||
class MisagoAdminExtension: | ||
def register_urlpatterns(self, urlpatterns): | ||
urlpatterns.namespace("plugins/", "plugins") | ||
|
||
urlpatterns.patterns("plugins", path("", plugins_list, name="index")) | ||
|
||
def register_navigation_nodes(self, site): | ||
site.add_node( | ||
name=pgettext_lazy("admin node", "Plugins"), | ||
icon="fa fa-cube", | ||
after="settings:index", | ||
namespace="plugins", | ||
) |
File renamed without changes.
This file contains 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,33 @@ | ||
from django.urls import reverse | ||
|
||
from ....test import assert_contains | ||
|
||
|
||
def test_plugins_list_contains_plugins(admin_client): | ||
response = admin_client.get(reverse("misago:admin:plugins:index")) | ||
|
||
assert_contains(response, "Example plugin") | ||
assert_contains(response, "empty_manifest_plugin") | ||
assert_contains(response, "invalid_manifest_plugin") | ||
assert_contains(response, "minimal_plugin") | ||
|
||
|
||
def test_plugins_list_contains_plugins_directories_and_packages(admin_client): | ||
response = admin_client.get(reverse("misago:admin:plugins:index")) | ||
|
||
assert_contains(response, "empty-manifest-plugin") | ||
assert_contains(response, "empty_manifest_plugin") | ||
assert_contains(response, "full-manifest-plugin") | ||
assert_contains(response, "full_manifest_plugin") | ||
assert_contains(response, "invalid-manifest-plugin") | ||
assert_contains(response, "invalid_manifest_plugin") | ||
assert_contains(response, "minimal-plugin") | ||
assert_contains(response, "minimal_plugin") | ||
|
||
|
||
def test_plugins_list_contains_plugins_metadata(admin_client): | ||
response = admin_client.get(reverse("misago:admin:plugins:index")) | ||
|
||
assert_contains(response, "Rafał Pitoń") | ||
assert_contains(response, "0.1DEV") | ||
assert_contains(response, "GNU GPL v2") |
This file contains 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,10 @@ | ||
from ...admin.views import render | ||
from ..metadata import plugins_metadata | ||
|
||
|
||
def plugins_list(request): | ||
return render( | ||
request, | ||
"misago/admin/plugins/list.html", | ||
{"plugins": plugins_metadata.get_metadata().values()}, | ||
) |
This file contains 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 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.