refonte de la section tests

This commit is contained in:
2022-08-06 16:51:49 -04:00
parent d040b3b893
commit 46ca5ca67a
131 changed files with 56926 additions and 118 deletions
+18 -1
View File
@@ -1,5 +1,22 @@
import templates
import ../code/web_utils
proc templ_title* (title: string): string = tmpli html"""
<h2>$title!</h2>
<h2>$title</h2>
"""
proc status_joplin_green* (): string = tmpli html"""
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="#3bed18" class="bi bi-caret-right-square-fill" viewBox="0 0 16 16">
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm5.5 10a.5.5 0 0 0 .832.374l4.5-4a.5.5 0 0 0 0-.748l-4.5-4A.5.5 0 0 0 5.5 4v8z"/>
</svg>
"""
proc status_joplin_red* (): string = tmpli html"""
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="#C9404D" class="bi bi-caret-right-square-fill" viewBox="0 0 16 16">
<path d="M0 2a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2zm5.5 10a.5.5 0 0 0 .832.374l4.5-4a.5.5 0 0 0 0-.748l-4.5-4A.5.5 0 0 0 5.5 4v8z"/>
</svg>
"""
proc checkStatus_joplinSyncro* (): string = tmpli html"""
"""
-23
View File
@@ -1,23 +0,0 @@
#? stdtmpl | standard
# import snippet_html
#proc test_notebooks(c: var TData, all_notebooks: var joplin_notebooks): string =
# result = ""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/styles.css">
<script src="js/script.js" defer></script>
</head>
<body>
# var title = templ_title("NOTEBOOKS")
<div> ${title} </div>
# for i in all_notebooks.title:
<h4> ${i} </h4>
# end for
</body>
</html>
#end proc
+25
View File
@@ -0,0 +1,25 @@
#? stdtmpl | standard
#proc test_homepage(c: var TData): string =
# result = ""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/progress.css">
<script src="js/script.js" defer></script>
</head>
<body>
<h1>TEST Home Page</h1>
<a href="/test_pingjoplin" class="test_ping"><h3>Test ping Joplin</h3></a>
<a href="/test_notebooks" class="test_notebooks"><h3>Test joplin Notebooks</h3></a>
<a href="/test_notes" class="test_notes"><h3>Test Joplin Notes</h3></a>
<a href="/test_tags" class="test_tags"><h3>Test Joplin Tags</h3></a>
<a href="/test_viewtree" class="test_viewtree"><h3>Test View Tree</h3></a>
</body>
</html>
#end proc
+34
View File
@@ -0,0 +1,34 @@
#? stdtmpl | standard
# import ../snippet_html
#proc test_notebooks(c: var TData, columnLeftInfo: var ColomnLeftData): string =
# result = ""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/styles.css">
<script src="js/script.js" defer></script>
</head>
<body>
<h1>TEST Joplin Notebooks Page</h1>
<div>
<a href="/test" class="test_ping"><h4>Back to Test Home page ...</h4></a>
</div>
# var title = templ_title("NOTEBOOKS")
<div><h2> ${title} </h2></div>
<lu>
# var count: int = 1
# for i in columnLeftInfo.j_notebooks.title:
<li> ${count} : ${i} </li>
# count += 1
# end for
</lu>
<div>
<a href="/test" class="test_ping"><h4>Back to Test Home page ...</h4></a>
</div>
</body>
</html>
# end proc
+34
View File
@@ -0,0 +1,34 @@
#? stdtmpl | standard
# import ../snippet_html
#proc test_notes(c: var TData, columnLeftInfo: var ColomnLeftData): string =
# result = ""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/styles.css">
<script src="js/script.js" defer></script>
</head>
<body>
<h1>TEST Joplin Notes Page</h1>
<div>
<a href="/test" class="test_ping"><h4>Back to Test Home page ...</h4></a>
</div>
# var title = templ_title("NOTES")
<div> ${title} </div>
<lu>
# var count: int = 1
# for i in columnLeftInfo.j_notes.title:
<li> ${count} : ${i} </li>
# count += 1
# end for
</lu>
<div>
<a href="/test" class="test_ping"><h4>Back to Test Home page ...</h4></a>
</div>
</body>
</html>
# end proc
+30
View File
@@ -0,0 +1,30 @@
#? stdtmpl | standard
# import ../snippet_html
#
#proc test_ping(c: var TData, ping: joplin_ping): string =
# result = ""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/progress.css">
<script src="js/script.js" defer></script>
</head>
<body>
<h1>TEST Ping Joplin Page</h1>
<div>
<a href="/test" class="test_ping"><h4>Back to Test Home page ...</h4></a>
</div>
<h3>Joplin ping status : ${ping.ping_status}</h3>
<h3>Joplin Ping result : ${ping.ping_result}</h3>
<div>
<a href="/test" class="test_ping"><h4>Back to Test Home page ...</h4></a>
</div>
</body>
</html>
#end proc
+34
View File
@@ -0,0 +1,34 @@
#? stdtmpl | standard
# import ../snippet_html
#proc test_tags(c: var TData, columnLeftInfo: var ColomnLeftData): string =
# result = ""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/styles.css">
<script src="js/script.js" defer></script>
</head>
<body>
<h1>TEST Joplin Tags Page</h1>
<div>
<a href="/test" class="test_ping"><h4>Back to Test Home page ...</h4></a>
</div>
# var title = templ_title("TAGS")
<div> ${title} </div>
<lu>
# var count: int = 1
# for i in columnLeftInfo.j_tags.title:
<li> ${count} : ${i} </li>
# count += 1
# end for
</lu>
<div>
<a href="/test" class="test_ping"><h4>Back to Test Home page ...</h4></a>
</div>
</body>
</html>
# end proc
+35
View File
@@ -0,0 +1,35 @@
#? stdtmpl | standard
#
#proc test_viewtree(c: var TData): string =
# result = ""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/styles.css">
<link href="js/viewtree/skin-win8/ui.fancytree.css" class="skinswitcher" rel="stylesheet">
<script src="js/viewtree.js" defer></script>
<script src="//code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="js/viewtree/jquery.fancytree-all-deps.min.js"></script>
</head>
<body>
<h2>TEST ViewTree Page</h2>
<div>
<a href="/test" class="test_ping"><h4>Back to Test Home page ...</h4></a>
</div>
<p>
<a id="button1" href="#">Toggle 'The Hobbit'</a>
</p>
<div id="tree"></div>
<div id="statusLine">Fancytree Demo - Click any node!</div>
<div>
<a href="/test" class="test_ping"><h4>Back to Test Home page ...</h4></a>
</div>
</body>
</html>
#end proc
+1 -1
View File
@@ -86,7 +86,7 @@
<script src="js/main.js"></script>
#else:
<div class="notification is-danger" style="text-align: center">
<meta http-equiv="refresh" content="0; URL=./secret" />
<meta http-equiv="refresh" content="0; URL=./secret?msg=notes" />
</div>
# end if
+118 -28
View File
@@ -9,7 +9,7 @@
#
# import snippet_html
# import snippet_icons
#proc genSecret(c: var TData, all_notebooks: var joplin_notebooks): string =
#proc genSecret(c: var TData, columnLeftInfo: var ColomnLeftData): string =
# result = ""
<!DOCTYPE html>
<html lang="en">
@@ -20,6 +20,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/progress.css">
<script src="js/script.js" defer></script>
</head>
@@ -35,17 +36,41 @@
<div class="container">
<aside class="sidebar" data-sidebar>
<div class="top-sidebar">
<a href="#" class="channel-logo"><img src="images/logo.png" alt="Channel Logo" width="30"
height="30"></a>
<a href="#" class="channel-logo"><img src="images/logo.png" alt="Channel Logo" width="15"
height="15"></a>
<div class="hidden-sidebar your-channel">Joplin</div>
<div class="hidden-sidebar channel-name">The New Web</div>
</div>
<div class="middle-sidebar">
<ul class="sidebar-list">
<li class="sidebar-list-item active">
## Change the visual active option on the sidebar
# var active_newNote: string = ""
# var active_search: string = ""
# var active_shortcuts: string = ""
# var active_notes: string = ""
# var active_notebooks: string = ""
# var active_tags: string = ""
# var active_settings: string = ""
# var active_sendFeedBack: string = ""
# if columnLeftInfo.option == newNote:
# active_newNote = "active"
# elif columnLeftInfo.option == search:
# active_search = "active"
# elif columnLeftInfo.option == shortcuts:
# active_shortcuts = "active"
# elif columnLeftInfo.option == notes:
# active_notes = "active"
# elif columnLeftInfo.option == notebooks:
# active_notebooks = "active"
# elif columnLeftInfo.option == tags:
# active_tags = "active"
# end if
<li class="sidebar-list-item ${active_newNote}">
<!-- Nouvelle Note dans la bar de navigation -->
<a href="#" class="sidebar-link">
<a href="/secret?msg=newNote" class="sidebar-link">
# var icon_newNote = NewNote_icon()
${icon_newNote}
@@ -53,10 +78,10 @@
<div class="hidden-sidebar">New Note</div>
</a>
</li>
<li class="sidebar-list-item">
<li class="sidebar-list-item ${active_search}">
<!-- Recherche dans la bar de navigation -->
<a href="#" class="sidebar-link">
<a href="/secret?msg=search" class="sidebar-link">
# var icon_search = Search_icon()
${icon_search}
@@ -66,8 +91,8 @@
</li>
<!--Favoris dans la bar de navigation -->
<li class="sidebar-list-item">
<a href="#" class="sidebar-link">
<li class="sidebar-list-item ${active_shortcuts}">
<a href="/secret?msg=shortcuts" class="sidebar-link">
# var icon_shortcuts = Shortcuts_icon()
${icon_shortcuts}
@@ -77,8 +102,8 @@
</li>
<!--Notes dans la bar de navigation -->
<li class="sidebar-list-item">
<a href="#" class="sidebar-link">
<li class="sidebar-list-item ${active_notes}">
<a href="/secret?msg=notes" class="sidebar-link">
# var icon_Notes = Notes_icon()
${icon_Notes}
@@ -88,8 +113,8 @@
</li>
<!--Notebooks dans la bar de navigation -->
<li class="sidebar-list-item">
<a href="#" class="sidebar-link">
<li class="sidebar-list-item ${active_notebooks}">
<a href="/secret?msg=notebooks" class="sidebar-link">
# var icon_Notebooks = Notebooks_icon()
${icon_Notebooks}
@@ -99,8 +124,8 @@
</li>
<!--Tags dans la bar de navigation -->
<li class="sidebar-list-item">
<a href="#" class="sidebar-link">
<li class="sidebar-list-item ${active_tags}">
<a href="/secret?msg=tags" class="sidebar-link">
# var icon_Tags = Tags_icon()
${icon_Tags}
@@ -112,11 +137,11 @@
</div>
<div class="bottom-sidebar">
<ul class="sidebar-list">
<li class="sidebar-list-item">
<a href="#" class="sidebar-link">
<li class="sidebar-list-item ${active_settings}">
<a href="/secret?msg=settings" class="sidebar-link">
# var icon_Settings = Settings_icon()
${icon_Tags}
${icon_Settings}
<div class="hidden-sidebar">Settings</div>
</a>
@@ -131,9 +156,22 @@
<div class="hidden-sidebar">Logout</div>
</a>
</li>
<li class="sidebar-list-item ">
<a href="#" class="sidebar-link">
# if columnLeftInfo.j_status:
# var status_green = status_joplin_green()
${status_green}
# else:
# var status_red = status_joplin_red()
${status_red}
# end if
<div class="hidden-sidebar">Joplin Status</div>
</a>
</li>
<li class="sidebar-list-item">
<a href="#" class="sidebar-link">
<li class="sidebar-list-item ${active_sendFeedBack}">
<a href="/secret?msg=sendFeedBack" class="sidebar-link">
# var icon_SendFeedback = SendFeedback_icon()
${icon_SendFeedback}
@@ -146,15 +184,67 @@
</aside>
<div class="row">
<div class="column left">
<div class="scrollbar scrollbar-primary">
<div class="force-overflow">
# var title = templ_title("NOTEBOOKS")
${title}
# for i in all_notebooks.title:
<p> ${i} </p>
# end for
# if columnLeftInfo.option == newNote:
<h2>New Note</h2>
<div class="scrollbar scrollbar-primary">
<div class="force-overflow">
<div class="ColomnLeftJoplinNewNote">
<h5>Todo ...</h5>
</div>
</div>
</div>
</div>
# elif columnLeftInfo.option == search:
<h2>Search</h2>
<div class="scrollbar scrollbar-primary">
<div class="force-overflow">
<div class="ColomnLeftJoplinSearch">
<h5>Todo ...</h5>
</div>
</div>
</div>
# elif columnLeftInfo.option == shortcuts:
<h2>Shortcuts</h2>
<div class="scrollbar scrollbar-primary">
<div class="force-overflow">
<div class="ColomnLeftJoplinShortcuts">
<h5>Todo ...</h5>
</div>
</div>
</div>
# elif columnLeftInfo.option == notes:
<h2>Notes</h2>
<div class="scrollbar scrollbar-primary">
<div class="force-overflow">
<div class="ColomnLeftJoplinNotes">
# for i in columnLeftInfo.j_notes.title:
<p> ${i} </p>
# end for
</div>
</div>
</div>
# elif columnLeftInfo.option == notebooks:
<h2>Notebooks</h2>
<div class="scrollbar scrollbar-primary">
<div class="force-overflow">
<div class="ColomnLeftJoplinNotebooks">
# for i in columnLeftInfo.j_notebooks.title:
<p> ${i} </p>
# end for
</div>
</div>
</div>
# elif columnLeftInfo.option == tags:
<h2>Tags</h2>
<div class="scrollbar scrollbar-primary">
<div class="force-overflow">
<div class="ColomnLeftJoplinTags">
# for i in columnLeftInfo.j_tags.title:
<p> ${i} </p>
# end for
</div>
</div>
</div>
# end if
</div>
<div class="column right" style="background-color:#bbb;">
<h2>Column 2</h2>