aboutsummaryrefslogtreecommitdiff
path: root/captain/external.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-03-30 10:52:12 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-03-30 10:52:12 -0400
commitfbfd194941de48affaa92522ceaff97010abc1c2 (patch)
tree9be8f652bfaaeb6bc2e11134275098dec23ce92e /captain/external.f90
parentfde763f60465b28d33260479b64d9555abc5bcbb (diff)
downloadlevitating-fbfd194941de48affaa92522ceaff97010abc1c2.tar.gz
levitating-fbfd194941de48affaa92522ceaff97010abc1c2.zip
Fixed outstanding issues in template variable assignment and player content building. Removed unnecessary logging calls.
Diffstat (limited to 'captain/external.f90')
-rw-r--r--captain/external.f9029
1 files changed, 23 insertions, 6 deletions
diff --git a/captain/external.f90 b/captain/external.f90
index 0aefdf8..146060f 100644
--- a/captain/external.f90
+++ b/captain/external.f90
@@ -21,8 +21,7 @@ contains
res = "None Yet"
else
-
- res = "## Existing Players"
+
players => get_player_names()
nsize = 1024
@@ -31,15 +30,21 @@ contains
end do
allocate(character(len=nsize) :: res)
+ res = "## Existing Players"
+
do i = 1, n
one_player = "=> /players/"//trim(players(i))//".gmi "//trim(players(i))
- res = trim(res)//new_line(res(1:1))//trim(one_player)
+ if(i == 1) then
+ res = trim(res)//new_line(res(1:1))//new_line(res(1:1))//trim(one_player)
+ else
+ res = trim(res)//new_line(res(1:1))//trim(one_player)
+ end if
end do
deallocate(players)
end if
- res = trim(res)//new_line(res(1:1))//"## Management"// &
+ res = trim(res)//new_line(res(1:1))//new_line(res(1:1))//"## Management"// &
new_line(res(1:1))//"=> /players/add.gmi Add Player"
end function generate_players_gemini
@@ -178,10 +183,14 @@ contains
! Open the base template
call template_filepath("index.gmi", template_file)
call page%init(trim(template_file))
+
+ call write_log("Processing request")
if(trim(req%location) == "/" .or. trim(req%location) == "/index.gmi") then
+ call write_log("Assign")
call page%assign('title', 'Home')
+ call write_log("Assign done")
else if(trim(req%location) == "/releases.gmi") then
@@ -208,11 +217,14 @@ contains
call page%assign('title', 'Not Found')
end if
-
+
call page%assign('project', project)
+
+ call write_log("Rendering page for "//req%location)
call page%render()
-
+
+ call write_log("Finalizing response")
resp%temporary_file = .true.
resp%body_filename => page%output_filename
resp%body_mimetype = "text/gemini"
@@ -222,21 +234,26 @@ contains
function external_request_gemini(req) result(resp)
use server_response
+ use logging
implicit none
class(request), intent(in)::req
type(response)::resp
if(is_input_provided_request(req)) then
+ call write_log("Input request")
resp = external_input_request_gemini(req)
else if(is_input_required_request(req)) then
+ call write_log("Input required")
resp = external_input_required_gemini(req)
else if(is_request_static(req)) then
+ call write_log("Req static")
resp = external_request_static(req)
else
+ call write_log("Req template")
resp = external_request_templated(req)
end if