add back to project button; pre-filled inline snippets from projects

This commit is contained in:
2019-08-07 13:01:05 -05:00
parent 84e3e94920
commit 1c0bdffc68
8 changed files with 85 additions and 8 deletions

View File

@@ -2,4 +2,4 @@ extends ./template
block content
p #{text}
form(method='post' action=destination)
button(type='submit') Yes, I'm sure.
button.btn(type='submit') Yes, I'm sure.

View File

@@ -26,8 +26,11 @@ html
a#navbar-usage(href='/dash/v1/using_devbug/main') Using DevBug
li.navbar-right
a#navbar-logout(href='/auth/logout') Logout
if show_back
if show_back && (!project || window_back)
li.navbar-right
a#navbar-back(href='javascript:window.history.back()') Back
else if show_back && project
li.navbar-right
a#navbar-back(href='/dash/v1/project/view/'+project.id) Back to Project
script(src="/assets/dash_v1.js")
block scripts

View File

@@ -0,0 +1,17 @@
extends ./editor_template
block content
pre#editor #{ editor_code ? editor_code : '' }
input#preset_mode(type='hidden' value=editor_lang ? editor_lang : 'ace/mode/text')
block scripts
script(src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.5/ace.js")
script.
const readonly = #{!!readonly}
const preset_mode = document.getElementById('preset_mode').value
const editor = ace.edit('editor');
editor.setTheme(window.devbug_editor_theme);
console.log('preset mode: ', preset_mode);
editor.session.setMode(preset_mode);
if ( readonly ){
editor.setOption('readOnly', true)
}

View File

@@ -17,9 +17,12 @@ html
block navbar-left
li.navbar-right
a#navbar-logout(href='/auth/logout') Logout
if show_back
if show_back && (!project || window_back)
li.navbar-right
a#navbar-back(href='javascript:window.history.back()') Back
else if show_back && project
li.navbar-right
a#navbar-back(href='/dash/v1/project/view/'+project.id) Back to Project
block navbar-right
.content
block content

View File

@@ -2,6 +2,21 @@ extends ./template
block content
h3 Project API Key: #{project.uuid}
h2 Inline Helpers
p You can use the links below to generate inline helper scripts which are pre-configured for this project.
ul(style='list-style-type: none; margin: 0; padding: 0;')
li.action-li
a.btn(href=project.id+'/inline/node') Node.js
//li.action-li
// a.btn(href=project.id+'/inline/ecma') JavaScript (Web)
li.action-li
a.btn(href=project.id+'/inline/php') PHP
//li.action-li
// a.btn(href=project.id+'/inline/api') DevBug API
br
br
h2 Code Snippets
a.btn(href='/dash/v1/project/snippet/'+project.id+'/new') +
table