aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-05-12 14:21:05 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-05-12 14:21:05 -0400
commitc5a514ac0d29a58a79a708771fe4b2a16d400031 (patch)
tree20840ea805ed2c9998575e239c7cb7644fae8531
parent9ac19f108c1b69025572bf32e310b332ef098c98 (diff)
downloadlevitating-c5a514ac0d29a58a79a708771fe4b2a16d400031.tar.gz
levitating-c5a514ac0d29a58a79a708771fe4b2a16d400031.zip
Added some CSS styling. Fixed checks for zero-length pointers since it seems to freak out Fortran.
-rw-r--r--captain/example/static/style.css98
-rw-r--r--captain/postutils.f904
-rw-r--r--captain/requtils.f9018
-rw-r--r--captain/templates/index.html2
-rw-r--r--captain/web.f909
5 files changed, 119 insertions, 12 deletions
diff --git a/captain/example/static/style.css b/captain/example/static/style.css
new file mode 100644
index 0000000..0a7a556
--- /dev/null
+++ b/captain/example/static/style.css
@@ -0,0 +1,98 @@
+body {
+ font-family: Sans-Serif;
+ margin:0;
+ padding:0;
+ font-size: 1.0em;
+}
+
+.heading {
+ background-color: #ddd;
+ margin:0;
+ padding:0;
+ border-bottom: 1px solid #333333;
+ width:100%;
+ top: 0px;
+ font-weight: 600;
+ position: fixed;
+}
+
+
+.heading li a:link, #headerlinks li a:active {
+ color: #000;
+ text-decoration: none;
+}
+
+.heading li a:visited {
+ color: #000;
+}
+
+.heading ul {
+ margin-left: 0px;
+ padding-left: 0px;
+ margin-right:1.2em;
+ list_style: none;
+ float: right;
+}
+
+.heading li {
+ margin-left: 0px;
+ padding-left: 5px;
+ padding-right: 5px;
+ display: inline;
+}
+
+.heading h1 {
+ margin-top: 0.2em;
+ margin-bottom: 0px;
+ padding: 0;
+ margin-left:5px;
+ margin-right:5px;
+ font-size:1.8em;
+}
+
+
+.content {
+ margin-top: 80px;
+ clear:both;
+ margin-left: 1em;
+ margin-right: 1em;
+ margin-bottom: 30px;
+}
+
+.footing {
+ border-top: 1px solid #333333;
+ text-align: center;
+ font-size: small;
+}
+
+.joblist {
+ list-style-type: none;
+}
+
+.job_result_listitem {
+ font-size: small;
+ border: 1px solid #333333;
+ width: 300px;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+.failure {
+ background-color: #fcc;
+}
+
+.success {
+ background-color: #cfc;
+}
+
+.working {
+ background-color: #ffc;
+}
+
+@media only screen and (max-width: 590px) {
+ .heading h1 {
+ display:none;
+ }
+}
diff --git a/captain/postutils.f90 b/captain/postutils.f90
index 2961f98..1d4c666 100644
--- a/captain/postutils.f90
+++ b/captain/postutils.f90
@@ -22,14 +22,12 @@ contains
else
content_length = 0
end if
- call write_log("Content Length is: "//trim(header_info), LOG_DEBUG)
call get_environment_variable("CONTENT_TYPE", header_info, status=istat)
if(content_length > 0 .and. &
istat == 0 .and. &
trim(header_info) == content_type_required) &
then
- call write_log("Processing post", LOG_DEBUG)
allocate(character(len=content_length) :: transfered)
@@ -42,8 +40,6 @@ contains
deallocate(transfered)
end if
-
- call write_log("Content Type is: "//trim(header_info), LOG_DEBUG)
end function read_post_contents
diff --git a/captain/requtils.f90 b/captain/requtils.f90
index cb52113..d2ffb29 100644
--- a/captain/requtils.f90
+++ b/captain/requtils.f90
@@ -231,7 +231,7 @@ contains
if(gemini_mode) then
res = " "
else
- res ="<ul>"
+ res ='<ul class="joblist">'
end if
do i = first, last
@@ -248,7 +248,21 @@ contains
res = trim(res)//nl//nl//trim(link)
else
- res = trim(res)//nl//' <li><div class="job_result_listitem">'
+ res = trim(res)//nl//' <li><div class="job_result_listitem'
+
+ select case(jobs(i)%status)
+ case(JOB_STATUS_SUCCESS)
+ res = trim(res)//' success">'
+ case(JOB_STATUS_FAILURE)
+ res = trim(res)//' failure">'
+ case(JOB_STATUS_WORKING)
+ res = trim(res)//' working">'
+ case(JOB_STATUS_PENDING)
+ res = trim(res)//' working">'
+ case default
+ res = trim(res)//'">'
+ end select
+
link = ' <p><strong><a href="'//trim(int_link_prefix)//'jobs/'// &
trim(adjustl(int_text))//'.html" >'// &
diff --git a/captain/templates/index.html b/captain/templates/index.html
index 6a41d0d..ae87e72 100644
--- a/captain/templates/index.html
+++ b/captain/templates/index.html
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8"/>
<title>{{ title }} - I'm Levitating!</title>
- <link rel="stylsheet" href="/static/style.css" />
+ <link rel="stylesheet" href="{{ base_url }}/static/style.css" />
</head>
<body>
diff --git a/captain/web.f90 b/captain/web.f90
index dab017a..66718b5 100644
--- a/captain/web.f90
+++ b/captain/web.f90
@@ -546,6 +546,7 @@ contains
use server_response, only:request, response
use http, only: HTTP_CODE_SUCCESS, HTTP_CODE_NOTFOUND
use request_utils, only: get_job_page_title, handle_instruction_command
+ use captain_db, only: scan_instructions_for_db
implicit none
type(request), intent(in)::req
@@ -596,9 +597,9 @@ contains
else if(trim(req%location) == "/instructions.html") then
- if(associated(req%query_string) .and. len_trim(req%query_string) > 0) then
+ if(associated(req%query_string) ) then
if(trim(req%query_string) == "scan") then
-
+ call scan_instructions_for_db()
end if
end if
@@ -608,7 +609,7 @@ contains
else if(trim(first) == "instructions") then
- if(associated(req%query_string) .and. len_trim(req%query_string) > 0) then
+ if(associated(req%query_string)) then
call handle_instruction_command(req)
end if
@@ -676,12 +677,10 @@ contains
call req%path_component(1, category)
if(trim(category) == "players") then
call req%path_component(2, second)
- call write_log("Handling command for players: "//trim(second), LOG_INFO)
! Add a player
if(trim(second) == "add.html") then
-
call add_player_db(posted%get_value("name"))
call page%assign('destination', 'players.html')