-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1202 from girder/config-metadata
Allow configuring which metadata can be added to items
- Loading branch information
Showing
8 changed files
with
780 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
girder/girder_large_image/web_client/stylesheets/metadataWidget.styl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.g-widget-metadata-key-edit | ||
font-weight bold | ||
|
||
.g-widget-metadata-row.editing .g-widget-metadata-value-input.g-widget-metadata-lientry | ||
height inherit |
22 changes: 22 additions & 0 deletions
22
girder/girder_large_image/web_client/templates/metadataWidget.pug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
if (accessLevel >= AccessType.WRITE) | ||
.btn-group.pull-right | ||
button.g-widget-metadata-add-button.btn.btn-sm.btn-primary.btn-default.dropdown-toggle(data-toggle="dropdown", title="Add Metadata") | ||
i.icon-plus | ||
ul.dropdown-menu.pull-right(role="menu") | ||
if limetadata | ||
for entry in limetadata | ||
if entry && entry.value | ||
li.li-metadata-menuitem(role="presentation") | ||
a.li-add-metadata(metadata-key=entry.value) | ||
= entry.title || entry.value | ||
li(role="presentation") | ||
a.g-add-simple-metadata(role="menuitem") | ||
| Simple | ||
li(role="presentation") | ||
a.g-add-json-metadata | ||
| JSON | ||
|
||
.g-widget-metadata-header | ||
i.icon-tags | ||
| #{title} | ||
.g-widget-metadata-container |
30 changes: 30 additions & 0 deletions
30
girder/girder_large_image/web_client/templates/metadatumEditWidget.pug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
if !lientry | ||
input.input-sm.form-control.g-widget-metadata-key-input(type="text", value=key, placeholder="Key") | ||
else | ||
span.g-widget-metadata-key-edit.g-widget-metadata-key-input(key=key) | ||
= lientry.title || key | ||
|
||
if !lientry | ||
- var rows = value.length <= 40 ? 1 : (value.length <= 100 ? 3 : 5) | ||
textarea.input-sm.form-control.g-widget-metadata-value-input(placeholder="Value", rows=rows) | ||
= value | ||
else | ||
if lientry.enum | ||
select.input-sm.form-control.g-widget-metadata-value-input.g-widget-metadata-lientry(title=lientry.description) | ||
for enumval in lientry.enum | ||
option(value=enumval, selected=enumval === value ? 'selected' : null) | ||
= enumval | ||
else | ||
input.input-sm.form-control.g-widget-metadata-value-input.g-widget-metadata-lientry(placeholder=lientry.description || "Value", value=value, title=lientry.description) | ||
|
||
button.btn.btn-sm.btn-warning.g-widget-metadata-cancel-button(title="Cancel") | ||
i.icon-cancel | ||
button.btn.btn-sm.btn-primary.g-widget-metadata-save-button(title="Accept") | ||
i.icon-ok | ||
if !newDatum | ||
if !lientry | ||
button.btn.btn-sm.btn-primary.g-widget-metadata-toggle-button(title="Convert to JSON") | ||
i.icon-cog | ||
if !lientry || !lientry.required | ||
button.btn.btn-sm.btn-danger.g-widget-metadata-delete-button(title="Delete") | ||
i.icon-trash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.