mirror of
https://onedev.site.tesses.net/crosslang/crosslangextras
synced 2026-02-08 09:05:46 +00:00
Fix templates
This commit is contained in:
BIN
Templates/web/res/image.png
Normal file
BIN
Templates/web/res/image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
26
Templates/web/src/pages/about.tcross
Normal file
26
Templates/web/src/pages/about.tcross
Normal file
@@ -0,0 +1,26 @@
|
||||
func Pages.About()
|
||||
{
|
||||
var pages = [
|
||||
{
|
||||
active = false,
|
||||
route = "/",
|
||||
text = "Home"
|
||||
},
|
||||
{
|
||||
active = false,
|
||||
route = "/counter",
|
||||
text = "Counter"
|
||||
},
|
||||
{
|
||||
active = true,
|
||||
route = "/about",
|
||||
text = "About"
|
||||
}
|
||||
];
|
||||
return Components.Shell(
|
||||
"About Me",
|
||||
pages,
|
||||
<null><img src="./image.png"><p>{ipsum}</p></null>
|
||||
);
|
||||
}
|
||||
var ipsum="";
|
||||
25
Templates/web/src/pages/counter.tcross
Normal file
25
Templates/web/src/pages/counter.tcross
Normal file
@@ -0,0 +1,25 @@
|
||||
func Pages.Counter()
|
||||
{
|
||||
var pages = [
|
||||
{
|
||||
active = false,
|
||||
route = "/",
|
||||
text = "Home"
|
||||
},
|
||||
{
|
||||
active = true,
|
||||
route = "/counter",
|
||||
text = "Counter"
|
||||
},
|
||||
{
|
||||
active = false,
|
||||
route = "/about",
|
||||
text = "About"
|
||||
}
|
||||
];
|
||||
return Components.Shell(
|
||||
"Counter",
|
||||
pages,
|
||||
<null><h1>This is a counter</h1><raw(Components.Counter())></null>
|
||||
);
|
||||
}
|
||||
32
Templates/web/src/pages/echo.tcross
Normal file
32
Templates/web/src/pages/echo.tcross
Normal file
@@ -0,0 +1,32 @@
|
||||
func Pages.Echo(text)
|
||||
{
|
||||
var pages = [
|
||||
{
|
||||
active = false,
|
||||
route = "/",
|
||||
text = "Home"
|
||||
},
|
||||
{
|
||||
active = false,
|
||||
route = "/counter",
|
||||
text = "Counter"
|
||||
},
|
||||
{
|
||||
active = false,
|
||||
route = "/about",
|
||||
text = "About"
|
||||
}
|
||||
];
|
||||
return Components.Shell(
|
||||
"Echo",
|
||||
pages,
|
||||
<if(text != null)>
|
||||
<true>
|
||||
<p>{text}</p>
|
||||
</true>
|
||||
<false>
|
||||
<p>No text available</p>
|
||||
</false>
|
||||
</if>
|
||||
);
|
||||
}
|
||||
27
Templates/web/src/pages/index.tcross
Normal file
27
Templates/web/src/pages/index.tcross
Normal file
@@ -0,0 +1,27 @@
|
||||
func Pages.Index()
|
||||
{
|
||||
var pages = [
|
||||
{
|
||||
active = true,
|
||||
route = "/",
|
||||
text = "Home"
|
||||
},
|
||||
{
|
||||
active = false,
|
||||
route = "/counter",
|
||||
text = "Counter"
|
||||
},
|
||||
{
|
||||
active = false,
|
||||
route = "/about",
|
||||
text = "About"
|
||||
}
|
||||
];
|
||||
return Components.Shell("Main Page",pages,<section>
|
||||
<form action="./echo" method="GET">
|
||||
<input type="text" name="text" placeholder="Text to echo">
|
||||
<input type="submit" value="Echo it">
|
||||
</form>
|
||||
<p>1 John 4:4: You, dear children, are from God and have overcome them, because the one who is in you is greater than the one who is in the world.</p>
|
||||
</section>);
|
||||
}
|
||||
Reference in New Issue
Block a user