2018-04-16 09:21:20 +00:00
{ { extends "../_layouts/default" } }
{ { import "../_modules/form" } }
2017-09-26 12:50:09 +00:00
2017-10-12 12:14:27 +00:00
{ { block style ( ) } }
2017-11-08 10:36:13 +00:00
< link rel = "stylesheet" href = "/assets/codemirror/codemirror.css?v=5.30" >
2017-10-12 12:14:27 +00:00
{ { end } }
{ { block script ( ) } }
2017-11-08 10:36:13 +00:00
< script src = "/assets/codemirror/codemirror.js?v=5.30" > < / script >
< script src = "/assets/codemirror/mode/yaml.js?v=5.30" > < / script >
2018-04-16 09:21:20 +00:00
< script > $ ( ( ) = > new Swirl . Stack . EditPage ( ) ) < / script >
2017-10-12 12:14:27 +00:00
{ { end } }
2017-09-26 12:50:09 +00:00
{ { block body ( ) } }
< section class = "hero is-info" >
< div class = "hero-body" >
< div class = "container has-text-centered" >
2017-10-12 09:30:21 +00:00
< h1 class = "title is-2 is-uppercase" > { { i18n ( "stack.title" ) } } < / h1 >
< h2 class = "subtitle is-5" > { { i18n ( "stack.description" ) } } < / h2 >
2017-09-26 12:50:09 +00:00
< / div >
< / div >
< / section >
< section class = "section" >
2017-11-14 08:05:46 +00:00
< div id = "div-form" class = "container" >
2017-09-26 12:50:09 +00:00
< h2 class = "title" > Create stack archive < / h2 >
< hr >
2017-11-14 08:05:46 +00:00
< div class = "field" >
< label class = "label" > { { i18n ( "field.name" ) } } < / label >
< div class = "control" >
< input id = "name" name = "name" class = "input" type = "text" placeholder = "" data - v - rule = "native;regex" data - v - arg - regex = "^[a-z0-9_-]+$" data - v - msg - regex = "Name can contain only letters, digits, '_' and '-'." required >
2017-09-26 12:50:09 +00:00
< / div >
2017-11-14 08:05:46 +00:00
< / div >
< div class = "field" >
< div class = "control" >
{ { yield radio ( name = "type" , value = "input" , label = "Input" , checked = "input" ) } }
{ { yield radio ( name = "type" , value = "upload" , label = "Upload" ) } }
< / div >
< / div >
< div id = "div-input" class = "field" >
< label class = "label" > Content < / label >
< div class = "control" >
< textarea id = "txt-content" name = "content" class = "textarea" rows = "20" placeholder = "Compose file content" data - v - rule = "content" data - v - arg - content = "input" required > < / textarea >
< / div >
< / div >
< div id = "div-upload" class = "field" style = "display: none" >
< label class = "label" > Content < / label >
< div class = "file has-name is-fullwidth" >
< label class = "file-label" >
< input id = "file-content" name = "content" class = "file-input" type = "file" data - v - rule = "content" data - v - arg - content = "upload" required >
< span class = "file-cta" >
< span class = "file-icon" >
2018-01-26 05:10:38 +00:00
< i class = "fas fa-upload" > < / i >
2017-11-14 08:05:46 +00:00
< / span >
< span class = "file-label" > Choose a file … < / span >
< / span >
< span id = "filename" class = "file-name" > < / span >
< / label >
< / div >
< / div >
< div class = "field is-grouped" >
< div class = "control" >
< button id = "btn-submit" type = "submit" class = "button is-primary" > { { i18n ( "button.submit" ) } } < / button >
2017-09-26 12:50:09 +00:00
< / div >
2017-11-14 08:05:46 +00:00
< div class = "control" >
2018-04-16 09:21:20 +00:00
< a href = "/stack/" class = "button is-link" > { { i18n ( "button.cancel" ) } } < / a >
2017-09-26 12:50:09 +00:00
< / div >
2017-11-14 08:05:46 +00:00
< / div >
2017-09-26 12:50:09 +00:00
< / div >
< / section >
{ { end } }