aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/guff/handlers.cr7
-rw-r--r--src/guff/views/logout-page.cr5
-rw-r--r--src/guff/views/pages/admin.cr (renamed from src/guff/views/admin-page.cr)10
-rw-r--r--src/guff/views/pages/login.cr (renamed from src/guff/views/login-page.cr)6
-rw-r--r--src/guff/views/pages/logout.cr5
-rw-r--r--src/views/pages/admin.ecr (renamed from src/views/admin-page.ecr)0
-rw-r--r--src/views/pages/login.ecr (renamed from src/views/login-page.ecr)0
-rw-r--r--src/views/pages/logout.ecr (renamed from src/views/logout-page.ecr)0
8 files changed, 17 insertions, 16 deletions
diff --git a/src/guff/handlers.cr b/src/guff/handlers.cr
index 2670f89..8c3e550 100644
--- a/src/guff/handlers.cr
+++ b/src/guff/handlers.cr
@@ -215,7 +215,7 @@ module Guff::Handlers
context.response.headers["x-frame-options"] = "SAMEORIGIN"
context.response.content_type = "text/html; charset=utf-8"
context.response.status_code = 200
- Views::AdminPageView.new(@context).to_s(context.response)
+ Views::Pages::Admin.new(@context).to_s(context.response)
else
call_next(context)
end
@@ -278,7 +278,8 @@ module Guff::Handlers
response.headers["x-frame-options"] = "SAMEORIGIN"
response.content_type = "text/html; charset=utf-8"
response.status_code = 200
- Views::LoginPageView.new(@context, error).to_s(response)
+
+ Views::Pages::Login.new(@context, error).to_s(response)
end
private def login(body : String?)
@@ -340,7 +341,7 @@ module Guff::Handlers
context.response.status_code = 200
# draw page
- Views::LogoutPageView.new(@context).to_s(context.response)
+ Views::Pages::Logout.new(@context).to_s(context.response)
else
call_next(context)
end
diff --git a/src/guff/views/logout-page.cr b/src/guff/views/logout-page.cr
deleted file mode 100644
index 164faf7..0000000
--- a/src/guff/views/logout-page.cr
+++ /dev/null
@@ -1,5 +0,0 @@
-require "./view"
-
-class Guff::Views::LogoutPageView < Guff::Views::HTMLView
- ECR.def_to_s("src/views/logout-page.ecr")
-end
diff --git a/src/guff/views/admin-page.cr b/src/guff/views/pages/admin.cr
index 63ebec2..15d82dc 100644
--- a/src/guff/views/admin-page.cr
+++ b/src/guff/views/pages/admin.cr
@@ -1,8 +1,8 @@
-require "./html"
-require "./dialogs/*"
-require "./panes/*"
+require "../html"
+require "../dialogs/*"
+require "../panes/*"
-class Guff::Views::AdminPageView < Guff::Views::HTMLView
+class Guff::Views::Pages::Admin < Guff::Views::HTMLView
TITLE = "Guff Admin"
STYLES = %w{
@@ -96,5 +96,5 @@ class Guff::Views::AdminPageView < Guff::Views::HTMLView
{ post_types: POST_TYPES}.to_json
end
- ECR.def_to_s("src/views/admin-page.ecr")
+ ECR.def_to_s("src/views/pages/admin.ecr")
end
diff --git a/src/guff/views/login-page.cr b/src/guff/views/pages/login.cr
index 892f3c1..dae1a82 100644
--- a/src/guff/views/login-page.cr
+++ b/src/guff/views/pages/login.cr
@@ -1,6 +1,6 @@
-require "./view"
+require "../html"
-class Guff::Views::LoginPageView < Guff::Views::HTMLView
+class Guff::Views::Pages::Login < Guff::Views::HTMLView
def initialize(context : Context, @error : String? = nil)
super(context)
end
@@ -9,5 +9,5 @@ class Guff::Views::LoginPageView < Guff::Views::HTMLView
@context.models.csrf.create_token
end
- ECR.def_to_s("src/views/login-page.ecr")
+ ECR.def_to_s("src/views/pages/login.ecr")
end
diff --git a/src/guff/views/pages/logout.cr b/src/guff/views/pages/logout.cr
new file mode 100644
index 0000000..e04a916
--- /dev/null
+++ b/src/guff/views/pages/logout.cr
@@ -0,0 +1,5 @@
+require "../html"
+
+class Guff::Views::Pages::Logout < Guff::Views::HTMLView
+ ECR.def_to_s("src/views/pages/logout.ecr")
+end
diff --git a/src/views/admin-page.ecr b/src/views/pages/admin.ecr
index 1eb030a..1eb030a 100644
--- a/src/views/admin-page.ecr
+++ b/src/views/pages/admin.ecr
diff --git a/src/views/login-page.ecr b/src/views/pages/login.ecr
index 16f63a4..16f63a4 100644
--- a/src/views/login-page.ecr
+++ b/src/views/pages/login.ecr
diff --git a/src/views/logout-page.ecr b/src/views/pages/logout.ecr
index b3c2eae..b3c2eae 100644
--- a/src/views/logout-page.ecr
+++ b/src/views/pages/logout.ecr