finish snippets

This commit is contained in:
2019-07-24 12:05:27 -05:00
parent 5bff5407a5
commit c00a05262d
10 changed files with 196 additions and 43 deletions

View File

@@ -1,6 +1,6 @@
html
head
title Project Invitation | DevBug
title Sharing Invitation | DevBug
link(rel='stylesheet' href='/assets/dash_v1.css')
script(src='/assets/dash_v1.js')
body
@@ -11,8 +11,8 @@ html
li.navli
a.nava(href='/dash/v1') Dashboard Login
.spacer
p You've been invited to view the debugging project "#{project.name}" by #{user.username}.
p To accept this invitation, you must have a DevBug account. You will be redirected to the registration portal.
p You've been invited to view the debugging #{invite.api_type} "#{project.name}" by #{user.username}.
p To accept this invitation, you must have a DevBug account. You may be redirected to the registration portal.
a.btn(href='/api/v1/invitation/'+invite.id+'/accept') Accept
br
h3 What's DevBug?

View File

@@ -52,3 +52,31 @@ block content
a.action(href='/dash/v1/project/view/'+project.id) View
li
a.action(href='/dash/v1/project/share/'+project.id+'/revoke/'+user.uuid) Remove
if shared_snippets.view || shared_snippets.edit
h3 Snippets Shared With Me
table
thead
tr
th(scope='col' style='min-width: 250px') Name
th(scope='col') Actions
tbody
each snippet in shared_snippets.edit
tr
td #{snippet.name}
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
li
a.action(href='/dash/v1/project/snippet/'+snippet.project_id+'/view/'+snippet.uuid) View
li
a.action(href='/dash/v1/snippet/share/'+snippet.id+'/revoke/'+user.uuid+'/edit') Remove
li
a.action(href='/dash/v1/project/snippet/'+snippet.project_id+'/edit/'+snippet.uuid) Edit
each snippet in shared_snippets.view
tr
td #{snippet.name}
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
li
a.action(href='/dash/v1/project/snippet/'+snippet.project_id+'/view/'+snippet.uuid) View
li
a.action(href='/dash/v1/snippet/share/'+snippet.id+'/revoke/'+user.uuid) Remove

View File

@@ -79,8 +79,9 @@ block content
option(value='ace/mode/xml') XML
option(value='ace/mode/yaml') YAML
input#snippet_value(type='hidden' name='data' required)
if snippet && user.uuid === snippet.user_id
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
pre#editor #{ snippet ? snippet.data : '' }
if (!readonly)
button(onclick='submitSnippet()') #{ snippet ? 'Update Snippet' : 'Create Snippet' }

View File

@@ -5,8 +5,9 @@ html
script(src='/assets/dash_v1.js')
block head
body
- var e_project = (user && project && devbug.permission.project.sync_edit(project, user))
.page-header
.devbug-header DevBug | v#{devbug.version} #{(user ? " | User: "+user.username : "")} #{(project ? " | Project: "+project.name+" | API: "+project.uuid : "")} #{((_flitter.config('server.environment') === 'development') ? " | Development" : "" )}
.devbug-header DevBug | v#{devbug.version} #{(user ? " | User: "+user.username : "")} #{(e_project ? " | Project: "+project.name+" | API: "+project.uuid : "")} #{((_flitter.config('server.environment') === 'development') ? " | Development" : "" )}
if title_small
h3 #{(title ? title : 'Dashboard')}
else

View File

@@ -9,6 +9,21 @@ block content
tr
th(scope='col' style='min-width: 250px') Title
th(scope='col') Actions
tbody
each snippet in snippets
tr
td #{snippet.name}
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
li.action-li
a.action(href='/dash/v1/project/snippet/'+project.id+'/view/'+snippet.uuid) View
if ( devbug.permission.snippet.edit(snippet, user) )
li.action-li
a.action(href='/dash/v1/project/snippet/'+project.id+'/delete/'+snippet.uuid) Delete
li.action-li
a.action(href='/dash/v1/project/snippet/'+project.id+'/edit/'+snippet.uuid) Edit
li.action-li
a.action(href='/dash/v1/snippet/share/'+snippet.id) Share
h2 Development Outputs
table