2018-04-16 09:21:20 +00:00
{ { extends "../_layouts/default" } }
{ { import "../_modules/form" } }
2017-09-26 12:50:09 +00:00
{ { block style ( ) } }
2017-11-08 10:36:13 +00:00
< link rel = "stylesheet" href = "/assets/codemirror/codemirror.css?v=5.30" >
2017-09-26 12:50:09 +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-09-26 12:50:09 +00:00
{ { end } }
{ { 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 >
< div class = "container" >
< nav class = "breadcrumb has-succeeds-separator is-small is-marginless" aria - label = "breadcrumbs" >
< ul >
2018-03-16 08:50:03 +00:00
< li > < a href = "/" > { { i18n ( "menu.home" ) } } < / a > < / li >
2018-04-16 09:21:20 +00:00
< li > < a href = "/stack/" > { { i18n ( "menu.stack" ) } } < / a > < / li >
2017-10-12 09:30:21 +00:00
< li class = "is-active" > < a > { { i18n ( "menu.edit" ) } } < / a > < / li >
2017-09-26 12:50:09 +00:00
< / ul >
< / nav >
< / div >
< section class = "hero is-small is-light" >
< div class = "hero-body" >
< div class = "container" >
< h2 class = "title is-2" >
2018-04-16 09:21:20 +00:00
{ { . Stack . Name } }
2017-09-26 12:50:09 +00:00
< / h2 >
< / div >
< / div >
< / section >
< nav class = "navbar has-shadow" >
< div class = "container" >
< div class = "navbar-brand" >
2018-04-16 09:21:20 +00:00
< a class = "navbar-item is-tab" href = "/stack/{{.Stack.Name}}/detail" > { { i18n ( "menu.detail" ) } } < / a >
< a class = "navbar-item is-tab is-active" href = "/stack/{{.Stack.Name}}/edit" > { { i18n ( "menu.edit" ) } } < / a >
2017-09-26 12:50:09 +00:00
< / div >
< / div >
< / nav >
< section class = "section" >
2017-11-14 08:05:46 +00:00
< div id = "div-form" class = "container" >
< div class = "field" >
< label class = "label" > { { i18n ( "field.name" ) } } < / label >
< div class = "control" >
2018-04-16 09:21:20 +00:00
< input id = "name" name = "name" class = "input" value = "{{ .Stack.Name }}" 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" ) } }
2017-09-26 12:50:09 +00:00
< / div >
2017-11-14 08:05:46 +00:00
< / div >
< div id = "div-input" class = "field" >
< label class = "label" > Content < / label >
< div class = "control" >
2018-04-16 09:21:20 +00:00
< textarea id = "txt-content" name = "content" class = "textarea" rows = "20" placeholder = "Compose file content" data - v - rule = "content" data - v - arg - content = "input" required > { { . Stack . Content } } < / textarea >
2017-11-14 08:05:46 +00:00
< / 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 >
2017-09-26 12:50:09 +00:00
< / div >
2017-11-14 08:05:46 +00:00
< / div >
< div class = "field is-grouped" >
< div class = "control" >
< button id = "btn-submit" type = "submit" class = "button is-primary" data - url = "update" > { { i18n ( "button.submit" ) } } < / button >
< / div >
< div class = "control" >
2018-04-16 09:21:20 +00:00
< a href = "/stack/" class = "button is-link" > { { i18n ( "button.cancel" ) } } < / a >
2017-11-14 08:05:46 +00:00
< / div >
< / div >
2017-09-26 12:50:09 +00:00
< / div >
< / section >
{ { end } }