From e662708d2f2f1ba05daefe1db50ee08c5439aadc Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 30 Sep 2013 11:12:53 +0200 Subject: [PATCH] move former myslice/viewutils.py, to gether with the contents of former views/ subdir, all together into a new ui/ subdir --- README | 10 +++++----- debug_platform/views.py | 2 +- myslice/settings.py | 2 +- portal/accountview.py | 2 +- portal/contactview.py | 4 ++-- portal/dashboardview.py | 2 +- portal/homeview.py | 2 +- portal/platformsview.py | 2 +- portal/platformview.py | 2 +- portal/portalpage.py | 2 +- portal/registrationview.py | 2 +- portal/slicerequestview.py | 2 +- portal/sliceview.py | 2 +- portal/views.py | 2 +- sample/views.py | 2 +- trash/dashboard.py | 4 ++-- trash/pluginview.py | 4 ++-- trash/sampleviews.py | 4 ++-- {views => ui}/__init__.py | 0 {views => ui}/static/css/layout-unfold2.css | 0 {views => ui}/static/css/topmenu.css | 0 {views => ui}/static/img/favicon.ico | Bin {views => ui}/static/img/myslice-icon.png | Bin {views => ui}/static/img/myslice-logo.png | Bin {views => ui}/static/img/onelab-logo.png | Bin {views => ui}/templates/base.html | 0 {views => ui}/templates/layout-unfold1.html | 0 {views => ui}/templates/layout-unfold2.html | 0 .../templates/messages-transient-header.html | 0 {views => ui}/templates/messages-transient.html | 0 {views => ui}/templates/view-unfold1.html | 0 {views => ui}/templates/view-unfold2.html | 0 {views => ui}/templates/widget-topmenu.html | 0 myslice/viewutils.py => ui/topmenu.py | 1 - 34 files changed, 26 insertions(+), 27 deletions(-) rename {views => ui}/__init__.py (100%) rename {views => ui}/static/css/layout-unfold2.css (100%) rename {views => ui}/static/css/topmenu.css (100%) rename {views => ui}/static/img/favicon.ico (100%) rename {views => ui}/static/img/myslice-icon.png (100%) rename {views => ui}/static/img/myslice-logo.png (100%) rename {views => ui}/static/img/onelab-logo.png (100%) rename {views => ui}/templates/base.html (100%) rename {views => ui}/templates/layout-unfold1.html (100%) rename {views => ui}/templates/layout-unfold2.html (100%) rename {views => ui}/templates/messages-transient-header.html (100%) rename {views => ui}/templates/messages-transient.html (100%) rename {views => ui}/templates/view-unfold1.html (100%) rename {views => ui}/templates/view-unfold2.html (100%) rename {views => ui}/templates/widget-topmenu.html (100%) rename myslice/viewutils.py => ui/topmenu.py (99%) diff --git a/README b/README index cae4a287..79ca81c9 100644 --- a/README +++ b/README @@ -112,6 +112,11 @@ package is published) for how to use a separate authentication system, as well as settings.py for how to enable it +* ui/ + provides building blocks for the UI, especially layouts (1 or 2 columns) as + well as the topmenu widget + + some global static files (css, js, images..) + * portal/ this is where the first implementation of myslice, with complete user-management including registration, is taking place @@ -120,11 +125,6 @@ package is published) rough/preliminary scaffolding views are in here as the name suggests this is temporary -* views/ - will receive actual views over time - currently has some global html templates as well - + some global static files (css, js, images..) - * insert_above: a third-party django app for adding on-the-fly mentions to css or js files that need to go in the header diff --git a/debug_platform/views.py b/debug_platform/views.py index f56661b3..e6b0c955 100644 --- a/debug_platform/views.py +++ b/debug_platform/views.py @@ -29,7 +29,7 @@ from django.views.generic.base import TemplateView from django.shortcuts import render from manifold.core.query import Query from unfold.page import Page -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user from django.http import HttpResponseRedirect from plugins.debug_platform import DebugPlatform diff --git a/myslice/settings.py b/myslice/settings.py index 93d044cc..4878c0de 100644 --- a/myslice/settings.py +++ b/myslice/settings.py @@ -174,7 +174,7 @@ INSTALLED_APPS = ( # plugins 'plugins', # views - more or less stable - 'views', + 'ui', # managing database migrations 'south', # Uncomment the next line to enable the admin: diff --git a/portal/accountview.py b/portal/accountview.py index af0d03ea..d97126fd 100644 --- a/portal/accountview.py +++ b/portal/accountview.py @@ -4,7 +4,7 @@ from manifold.core.query import Query from manifold.manifoldapi import execute_query from portal.actions import manifold_update_user, manifold_update_account # -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user # from django.http import HttpResponse, HttpResponseRedirect from django.contrib import messages diff --git a/portal/contactview.py b/portal/contactview.py index 8272fe0e..0f2e4010 100644 --- a/portal/contactview.py +++ b/portal/contactview.py @@ -1,9 +1,9 @@ from django.shortcuts import render -from django.template.loader import render_to_string +from django.template.loader import render_to_string from django.views.generic import View from django.core.mail import send_mail -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user from portal.forms import ContactForm diff --git a/portal/dashboardview.py b/portal/dashboardview.py index bbd19411..01478c7d 100644 --- a/portal/dashboardview.py +++ b/portal/dashboardview.py @@ -5,7 +5,7 @@ from plugins.lists.simplelist import SimpleList from unfold.loginrequired import LoginRequiredAutoLogoutView -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user #This view requires login class DashboardView (LoginRequiredAutoLogoutView): diff --git a/portal/homeview.py b/portal/homeview.py index 592bc932..b5e47fe6 100644 --- a/portal/homeview.py +++ b/portal/homeview.py @@ -7,7 +7,7 @@ from django.template import RequestContext from django.shortcuts import render_to_response from manifold.manifoldresult import ManifoldResult -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user from myslice.config import Config class HomeView (View): diff --git a/portal/platformsview.py b/portal/platformsview.py index 71011642..ddc96892 100644 --- a/portal/platformsview.py +++ b/portal/platformsview.py @@ -3,7 +3,7 @@ from django.views.generic.base import TemplateView from manifold.core.query import Query from unfold.page import Page -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user from plugins.hazelnut import Hazelnut diff --git a/portal/platformview.py b/portal/platformview.py index a432bc19..16148ee2 100644 --- a/portal/platformview.py +++ b/portal/platformview.py @@ -3,7 +3,7 @@ from django.views.generic.base import TemplateView from manifold.core.query import Query from unfold.page import Page -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user from plugins.hazelnut import Hazelnut diff --git a/portal/portalpage.py b/portal/portalpage.py index 3cc5ab98..b5470fd2 100644 --- a/portal/portalpage.py +++ b/portal/portalpage.py @@ -2,7 +2,7 @@ from django.template import RequestContext from django.shortcuts import render_to_response from unfold.page import Page -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user class PortalPage(Page): def __init__(self, request): diff --git a/portal/registrationview.py b/portal/registrationview.py index e756c3fd..aefdaa71 100644 --- a/portal/registrationview.py +++ b/portal/registrationview.py @@ -7,7 +7,7 @@ from django.template.loader import render_to_string from django.shortcuts import render from unfold.page import Page -from myslice.viewutils import topmenu_items +from ui.topmenu import topmenu_items from manifold.manifoldapi import execute_query from manifold.core.query import Query diff --git a/portal/slicerequestview.py b/portal/slicerequestview.py index 6589e8a1..de1f83df 100644 --- a/portal/slicerequestview.py +++ b/portal/slicerequestview.py @@ -9,7 +9,7 @@ from portal.models import PendingSlice from portal.actions import authority_get_pi_emails from portal.forms import SliceRequestForm from unfold.loginrequired import LoginRequiredAutoLogoutView -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user class SliceRequestView (LoginRequiredAutoLogoutView): diff --git a/portal/sliceview.py b/portal/sliceview.py index f640b322..175a40e6 100644 --- a/portal/sliceview.py +++ b/portal/sliceview.py @@ -6,7 +6,7 @@ from unfold.loginrequired import LoginRequiredAutoLogoutView from unfold.page import Page from manifold.core.query import Query, AnalyzedQuery -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user from plugins.raw import Raw from plugins.stack import Stack diff --git a/portal/views.py b/portal/views.py index 60f16137..997dbfb0 100644 --- a/portal/views.py +++ b/portal/views.py @@ -28,7 +28,7 @@ from django.views.generic.base import TemplateView from django.shortcuts import render from django.template.loader import render_to_string -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user from portal.event import Event # presview is put in observation for now diff --git a/sample/views.py b/sample/views.py index c134269f..a0f0cf82 100644 --- a/sample/views.py +++ b/sample/views.py @@ -21,7 +21,7 @@ # Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. from django.views.generic.base import TemplateView -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user class WebSocketsView(TemplateView): template_name = "websockets.html" diff --git a/trash/dashboard.py b/trash/dashboard.py index 20bc15f7..08a630db 100644 --- a/trash/dashboard.py +++ b/trash/dashboard.py @@ -16,10 +16,10 @@ from plugins.lists.slicelist import SliceList from plugins.querycode import QueryCode from plugins.quickfilter import QuickFilter -from trash.trashutils import quickfilter_criterias +from trash.trashutils import quickfilter_criterias # -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user @login_required def dashboard_view (request): diff --git a/trash/pluginview.py b/trash/pluginview.py index 366c1310..0b22e119 100644 --- a/trash/pluginview.py +++ b/trash/pluginview.py @@ -19,8 +19,8 @@ from plugins.raw import Raw from plugins.messages import Messages from plugins.hazelnut import Hazelnut -from myslice.viewutils import topmenu_items, the_user -from trash.trashutils import hard_wired_slice_names, hard_wired_list, lorem_p, lorem, quickfilter_criterias +from ui.topmenu import topmenu_items, the_user +from trash.trashutils import hard_wired_slice_names, hard_wired_list, lorem_p, lorem, quickfilter_criterias #might be useful or not depending on the context #@login_required diff --git a/trash/sampleviews.py b/trash/sampleviews.py index 0207d4da..ad8571da 100644 --- a/trash/sampleviews.py +++ b/trash/sampleviews.py @@ -6,9 +6,9 @@ from django.contrib.auth.decorators import login_required from unfold.prelude import Prelude -from myslice.viewutils import topmenu_items, the_user +from ui.topmenu import topmenu_items, the_user # tmp -from trash.trashutils import lorem, hard_wired_slice_names +from trash.trashutils import lorem, hard_wired_slice_names @login_required def tab_view (request): diff --git a/views/__init__.py b/ui/__init__.py similarity index 100% rename from views/__init__.py rename to ui/__init__.py diff --git a/views/static/css/layout-unfold2.css b/ui/static/css/layout-unfold2.css similarity index 100% rename from views/static/css/layout-unfold2.css rename to ui/static/css/layout-unfold2.css diff --git a/views/static/css/topmenu.css b/ui/static/css/topmenu.css similarity index 100% rename from views/static/css/topmenu.css rename to ui/static/css/topmenu.css diff --git a/views/static/img/favicon.ico b/ui/static/img/favicon.ico similarity index 100% rename from views/static/img/favicon.ico rename to ui/static/img/favicon.ico diff --git a/views/static/img/myslice-icon.png b/ui/static/img/myslice-icon.png similarity index 100% rename from views/static/img/myslice-icon.png rename to ui/static/img/myslice-icon.png diff --git a/views/static/img/myslice-logo.png b/ui/static/img/myslice-logo.png similarity index 100% rename from views/static/img/myslice-logo.png rename to ui/static/img/myslice-logo.png diff --git a/views/static/img/onelab-logo.png b/ui/static/img/onelab-logo.png similarity index 100% rename from views/static/img/onelab-logo.png rename to ui/static/img/onelab-logo.png diff --git a/views/templates/base.html b/ui/templates/base.html similarity index 100% rename from views/templates/base.html rename to ui/templates/base.html diff --git a/views/templates/layout-unfold1.html b/ui/templates/layout-unfold1.html similarity index 100% rename from views/templates/layout-unfold1.html rename to ui/templates/layout-unfold1.html diff --git a/views/templates/layout-unfold2.html b/ui/templates/layout-unfold2.html similarity index 100% rename from views/templates/layout-unfold2.html rename to ui/templates/layout-unfold2.html diff --git a/views/templates/messages-transient-header.html b/ui/templates/messages-transient-header.html similarity index 100% rename from views/templates/messages-transient-header.html rename to ui/templates/messages-transient-header.html diff --git a/views/templates/messages-transient.html b/ui/templates/messages-transient.html similarity index 100% rename from views/templates/messages-transient.html rename to ui/templates/messages-transient.html diff --git a/views/templates/view-unfold1.html b/ui/templates/view-unfold1.html similarity index 100% rename from views/templates/view-unfold1.html rename to ui/templates/view-unfold1.html diff --git a/views/templates/view-unfold2.html b/ui/templates/view-unfold2.html similarity index 100% rename from views/templates/view-unfold2.html rename to ui/templates/view-unfold2.html diff --git a/views/templates/widget-topmenu.html b/ui/templates/widget-topmenu.html similarity index 100% rename from views/templates/widget-topmenu.html rename to ui/templates/widget-topmenu.html diff --git a/myslice/viewutils.py b/ui/topmenu.py similarity index 99% rename from myslice/viewutils.py rename to ui/topmenu.py index f00a4515..bcf74b1c 100644 --- a/myslice/viewutils.py +++ b/ui/topmenu.py @@ -40,4 +40,3 @@ def the_user (request): return '' else: return request.user.email - -- 2.43.0