forked from mistressAlisi/ply
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ply-ng' of github.com:furrydelphia/ply into ply-ng
- Loading branch information
Showing
60 changed files
with
1,367 additions
and
174 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
30 changes: 30 additions & 0 deletions
30
communities/community/migrations/0038_alter_communitysidebarmenu_module.py
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,30 @@ | ||
# Generated by Django 5.0.1 on 2024-06-20 16:33 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("community", "0037_communityregistrypageview"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="communitysidebarmenu", | ||
name="module", | ||
field=models.TextField( | ||
choices=[ | ||
("communities.preferences", "communities.preferences"), | ||
("communities.community", "communities.community"), | ||
("communities.dashboards", "communities.dashboards"), | ||
("media.gallery.core", "media.gallery.core"), | ||
("ufls.event", "ufls.event"), | ||
("ufls.registrar", "ufls.registrar"), | ||
("ufls.staff", "ufls.staff"), | ||
], | ||
help_text="Application to Include in the Menus", | ||
max_length=200, | ||
verbose_name="Module/AppName:", | ||
), | ||
), | ||
] |
3 changes: 3 additions & 0 deletions
3
communities/community/static/communities.community/css/dashboard/base.css
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,3 @@ | ||
.drop-accept .badge { | ||
visibility: hidden; | ||
} |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from django.urls import path,include | ||
from django.urls import path, include | ||
from . import forge_api_views as views | ||
|
||
urlpatterns = [ | ||
|
||
path("studio/load/<uuid:dashboard>", views.load_dashboard), | ||
path("studio/widgets/load/<uuid:dashboard>",views.load_widgets_url) | ||
] |
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 |
---|---|---|
@@ -1,10 +1,50 @@ | ||
from django.shortcuts import render | ||
from django.contrib.auth.decorators import login_required | ||
|
||
from django.db.models import Q | ||
from django.http import JsonResponse, HttpResponse | ||
from django.core import serializers | ||
import ply | ||
from ply.toolkit import vhosts,profiles | ||
from communities.community.models import Friend_ExpLvl_View | ||
from ply.toolkit import vhosts, profiles | ||
from communities.community.models import ( | ||
Friend_ExpLvl_View, | ||
CommunityDashboardType, | ||
CommunityProfileDashboardRoles, | ||
CommunityRegistryPageView, | ||
) | ||
from communities.profiles.models import Profile | ||
from ply.toolkit.contexts import default_context, admin_context | ||
from core.dynapages.models import Page, PageWidget,Widget | ||
from ply.toolkit.dynapages import get_or_create_dynapage_node | ||
|
||
|
||
# Create your views here. | ||
@login_required | ||
def load_dashboard(request, dashboard): | ||
context, vhost, community, profile = admin_context(request) | ||
dynapage = Page.objects.get(pk=dashboard) | ||
widgets = PageWidget.objects.filter(page=dynapage) | ||
context.update( | ||
{ | ||
"dynapage": dynapage, | ||
"widgets": widgets, | ||
} | ||
) | ||
return render( | ||
request, "communities.dashboards/studio/render_dashboard.html", context | ||
) | ||
|
||
|
||
def load_widgets_url(request, dashboard): | ||
dynapage = Page.objects.get(pk=dashboard) | ||
filters = {} | ||
if dynapage.system == True: | ||
filters["system"] = True | ||
if dynapage.profile_page == True: | ||
filters["profile"] = True | ||
filters["system"] = False | ||
if dynapage.widget_mode != False: | ||
filters[f"{dynapage.widget_mode}"] = True | ||
filter_q = Q(**filters) | ||
aw = Widget.objects.filter(active=True).filter(filter_q) | ||
available_widgets = serializers.serialize("json",aw) | ||
return JsonResponse({"res": "ok","widgets":available_widgets}) |
5 changes: 5 additions & 0 deletions
5
communities/dashboards/static/communities.dashboards/css/dashboard/studio.css
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,5 @@ | ||
.widget-card { | ||
max-width: 250px; | ||
cursor: grab; | ||
|
||
} |
51 changes: 46 additions & 5 deletions
51
communities/dashboards/static/communities.dashboards/js/DashboardStudio/DashboardStudio.js
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
18 changes: 16 additions & 2 deletions
18
communities/dashboards/templates/communities.dashboards/studio/index.html
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 |
---|---|---|
@@ -1,13 +1,27 @@ | ||
{%extends "dashboard/dashboard_main_panel-95.html" %} | ||
{%block dashboard_name %} | ||
Dashboard Studio | ||
|
||
{%endblock%} | ||
|
||
{%block dashboard_content %} | ||
<link href="/static/communities.dashboards/css/dashboard/studio.css" rel="stylesheet"> | ||
<div id="studio_container" class="container-fluid"> | ||
Select Dashboard to load... | ||
<!-- <nav class="navbar navbar-dark bg-success">--> | ||
<!-- <div class="container-fluid">--> | ||
<!-- Dashboard Editor: <span id="dashboard_name_spn"></span>--> | ||
<!-- <div class="d-flex">--> | ||
|
||
<!-- <button class="btn btn-outline-light text-light" type="button"><i class="fa-solid fa-bars"></i></button>--> | ||
<!-- </div>--> | ||
<!-- </div>--> | ||
<!--</nav>--> | ||
|
||
<div id="dashboard_studio_container"> | ||
|
||
</div> | ||
</div> | ||
|
||
|
||
{% include "communities.dashboards/studio/offcanvas/widget_bar.html" %} | ||
{% include "communities.dashboards/studio/modals/select_dashboard.html" %} | ||
{%endblock%} |
15 changes: 15 additions & 0 deletions
15
communities/dashboards/templates/communities.dashboards/studio/offcanvas/widget_bar.html
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,15 @@ | ||
<div class="offcanvas offcanvas-bottom" data-bs-scroll="true" data-bs-backdrop="false" tabindex="-1" id="studio_offCanvas" aria-labelledby="studio_offCanvasLabel" class="studio_offcanvas"> | ||
<div class="offcanvas-header"> | ||
<h6 class="offcanvas-title" id="studio_offCanvasLabel">Widget Selector - <span style="font-size: 11px;" class="text-muted">Drag and drop widgets from this bar into the Dashboard area above. Changes are saved automatically.</span></h6> | ||
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button> | ||
</div> | ||
<div class="offcanvas-body small"> | ||
<div class="card-group" id="widget_cards_bar"> | ||
{% for widget in available_widgets %} | ||
<!-- {{widget.type}}--> | ||
{%include "dynapages_tools/widget_editor/widget_card.html" %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</div> | ||
|
10 changes: 10 additions & 0 deletions
10
communities/dashboards/templates/communities.dashboards/studio/render_dashboard.html
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 @@ | ||
{%extends "dashboard/dashboard_main_panel-95.html" %} | ||
{%block dashboard_content %} | ||
<div class="container-fluid main-container" id="dashboard_mainPanel"> | ||
|
||
{%with "dynapages/"|add:dynapage.template.filename as src %} | ||
{%include src %} | ||
{%endwith %} | ||
|
||
</div> | ||
{%endblock%} |
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,38 @@ | ||
# The PLY Appinfo class defines ply-specific details for the given application. | ||
PLY_APP_INFO = { | ||
"app_name": "Ply Preferences", | ||
"app_module": "communities.preferences", | ||
"version": { | ||
"release":2024, | ||
"major":0x7e8, | ||
"minor":0x3e9 | ||
}, | ||
"required_versions": { | ||
"featureset_major": 0x7e8, | ||
"featureset_minor": 0x3e9, | ||
}, | ||
|
||
"dashboard_modes": { | ||
"user":{ | ||
"privileged": False, | ||
"default": True, | ||
"active": True, | ||
"descr": "The default user dashboard!", | ||
"menu_class": "sidebar_menu", | ||
}, | ||
"forge":{ | ||
"privileged": True, | ||
"default": False, | ||
"active": True, | ||
"descr": "The WorldForge/World admin dashboard mode", | ||
"menu_class": "sidebar_forge", | ||
}, | ||
#"staff": { | ||
# "privileged": True, | ||
# "default": False, | ||
# "active": False, | ||
# "descr": "The Staff dashboard mode", | ||
# "menu_class": "sidebar_staff", | ||
# }, | ||
}, | ||
} |
Oops, something went wrong.