This website works better with JavaScript.
Home
Help
Sign In
nomis
/
jdr-server
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
✨
CharacterSheet can create javascript
master
n0m1s
6 years ago
parent
96d770ecb1
commit
f8e6f1f447
Signed by:
nomis
GPG Key ID:
BC0454CAD76FE803
3 changed files
with
8 additions
and
0 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+4
-0
jdr/sheet.go
+1
-0
main.go
+3
-0
templates/player.html
+ 4
- 0
jdr/sheet.go
View File
@ -83,6 +83,10 @@ type CharacterSheet struct {
Pages
[
]
*
Page
Pages
[
]
*
Page
}
}
func
(
self
*
CharacterSheet
)
Script
(
)
template
.
JS
{
return
template
.
JS
(
""
)
}
func
(
self
*
CharacterSheet
)
Render
(
)
template
.
HTML
{
func
(
self
*
CharacterSheet
)
Render
(
)
template
.
HTML
{
ret
:=
template
.
HTML
(
""
)
ret
:=
template
.
HTML
(
""
)
+ 1
- 0
main.go
View File
@ -25,6 +25,7 @@ func playerPageHandler(w http.ResponseWriter, r *http.Request) {
}
}
err
=
templates
.
ExecuteTemplate
(
w
,
"player.html"
,
map
[
string
]
interface
{
}
{
err
=
templates
.
ExecuteTemplate
(
w
,
"player.html"
,
map
[
string
]
interface
{
}
{
"Script"
:
sheet
.
Script
(
)
,
"Sheet"
:
sheet
.
Render
(
)
,
"Sheet"
:
sheet
.
Render
(
)
,
}
)
}
)
if
err
!=
nil
{
if
err
!=
nil
{
+ 3
- 0
templates/player.html
View File
@ -2,6 +2,9 @@
<
html
>
<
html
>
<
head
>
<
head
>
<
meta
charset
=
"utf-8"
/
>
<
meta
charset
=
"utf-8"
/
>
<
script
>
{{.Script}}
<
/
script
>
<
/
head
>
<
/
head
>
<
body
>
<
body
>
<
form
>
<
form
>
Write
Preview
Loading…
Cancel
Save