|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
extends ./template
|
|
|
|
|
block content
|
|
|
|
|
extends ./editor_template
|
|
|
|
|
block header
|
|
|
|
|
.inject
|
|
|
|
|
if errors
|
|
|
|
|
each error in errors
|
|
|
|
|
p(style='color: red; font-weight: bold;') #{error}
|
|
|
|
@ -82,10 +83,12 @@ block content
|
|
|
|
|
if snippet && user && is_owner && readonly
|
|
|
|
|
a.btn(href='/dash/v1/snippet/share/'+snippet.id style='margin-left: 20px') Share Snippet
|
|
|
|
|
a.btn(href='/dash/v1/project/snippet/'+project.id+'/edit/'+snippet.uuid style='margin-left: 10px') Edit
|
|
|
|
|
block content
|
|
|
|
|
pre#editor #{ snippet ? snippet.data : '' }
|
|
|
|
|
input#preset_mode(type='hidden' value=snippet ? snippet.mode : 'ace/mode/javascript')
|
|
|
|
|
block footer
|
|
|
|
|
if (!readonly)
|
|
|
|
|
button.btn(onclick='submitSnippet()') #{ snippet ? 'Update Snippet' : 'Create Snippet' }
|
|
|
|
|
input#preset_mode(type='hidden' value=snippet ? snippet.mode : 'ace/mode/javascript')
|
|
|
|
|
|
|
|
|
|
block scripts
|
|
|
|
|
script(src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.5/ace.js")
|
|
|
|
|