cyclic structure resolution & edit sharing

This commit is contained in:
2019-07-10 14:10:36 -05:00
parent 2dafb07cea
commit a078b768da
11 changed files with 395 additions and 77 deletions

View File

@@ -17,11 +17,8 @@ block content
| function.
pre
code #{devbug.code.php}
h2 JavaScript (Web)
p
| This snippet works by loading jQuery via a script tag when a breakpoint is triggered.
pre
code #{devbug.code.js}
h2
a(href="/assets/agents/web.js" target="_blank") JavaScript (Web)
h2 Using the API
p You can post output to DevBug projects from anywhere using the DevBug API. Here's how:
pre

View File

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

View File

@@ -1,48 +1,88 @@
extends ./template
block content
h2 Shared With
h2 Owned By
table
thead
tr
th(scope='col' style='min-width: 250px') Username
th(scope='col') Actions
tbody
each user in sharing.shared
tr
td #{(sharing.current_owns ? `You (${sharing.owner.username})` : sharing.owner.username)}
if sharing.read.length > 0
br
h2 Shared With (Read-Only)
table
thead
tr
td #{(user.uuid === project.user_id ? user.username + " (Owner)" : user.username)}
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
if !(user.uuid === project.user_id)
li
a.action(href='/dash/v1/project/share/'+project.id+'/revoke/'+user.uuid) Revoke
li
a.action(href='/dash/v1/project/share/'+project.id+'/transfer/'+user.uuid) Transfer Ownership
else
li
strike Revoke
li
strike Transfer Ownership
th(scope='col' style='min-width: 250px') Username
th(scope='col') Actions
tbody
each user in sharing.read
tr
td #{(user.uuid === project.user_id ? user.username + " (Owner)" : user.username)}
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
if !(user.uuid === project.user_id)
li
a.action(href='/dash/v1/project/share/'+project.id+'/revoke/'+user.uuid) Revoke
li
a.action(href='/dash/v1/project/share/'+project.id+'/transfer/'+user.uuid) Transfer Ownership
else
li
strike Revoke
li
strike Transfer Ownership
if sharing.edit.length > 0
br
h2 Shared With (Edit)
table
thead
tr
th(scope='col' style='min-width: 250px') Username
th(scope='col') Actions
tbody
each user in sharing.edit
tr
td #{(user.uuid === project.user_id ? user.username + " (Owner)" : user.username)}
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
if !(user.uuid === project.user_id)
li
a.action(href='/dash/v1/project/share/'+project.id+'/revoke/'+user.uuid+'/edit') Revoke
li
a.action(href='/dash/v1/project/share/'+project.id+'/transfer/'+user.uuid) Transfer Ownership
else
li
strike Revoke
li
strike Transfer Ownership
br
h2 Share With New User
a.btn(href='/dash/v1/project/share/'+project.id+'/invite') Generate Sharing Link
br
br
table
thead
tr
th(scope='col' style='min-width: 250px') Username
th(scope='col') Actions
tbody
each user in sharing.to_share
if sharing.other.length > 0
br
br
table
thead
tr
td #{(user.uuid === project.user_id ? user.username + " (Owner)" : user.username)}
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
if !(user.uuid === project.user_id)
th(scope='col' style='min-width: 250px') Username
th(scope='col') Actions
tbody
each user in sharing.other
tr
td #{(user.uuid === project.user_id ? user.username + " (Owner)" : user.username)}
td
ul(style='list-style-type: none; margin: 0; padding: 0;')
if !(user.uuid === project.user_id)
li
a.action(href='/dash/v1/project/share/' + project.id + '/share/'+user.uuid) Share (View)
li
a.action(href='/dash/v1/project/share/' + project.id + '/share/'+user.uuid+'/edit') Share (Edit)
else
li
strike Share
li
a.action(href='/dash/v1/project/share/' + project.id + '/share/'+user.uuid) Share
else
li
strike Share
li
a.action(href='/dash/v1/project/share/' + project.id + '/transfer/' + user.uuid) Transfer Ownership
a.action(href='/dash/v1/project/share/' + project.id + '/transfer/' + user.uuid) Transfer Ownership

View File

@@ -16,5 +16,6 @@ block content
ul(style='list-style-type: none; margin: 0; padding: 0;')
li
a.action(href='/dash/v1/out/view/'+out.id) View
li
a.action(href='/dash/v1/out/delete/'+out.id+'/'+project.id) Delete
if ( devbug.permission.project.edit(project, user) )
li
a.action(href='/dash/v1/out/delete/'+out.id+'/'+project.id) Delete