Skip to content

Commit

Permalink
ui: add license description drop down
Browse files Browse the repository at this point in the history
  • Loading branch information
yolile committed Mar 23, 2022
1 parent d2c863e commit 10e135d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion data_registry/templates/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,15 @@ <h4>{% translate "Overview" %}</h4>
<span class="value">
<template v-if="data.license_custom">
<a :href="data.license_custom.url" target="_blank">[[ data.license_custom.name ]]</a>
<markdown-box class="small" :content="data.license_custom.description"></markdown-box>
<button v-if="!licenseExpanded" class="btn btn-link text-info description-long-btn" @click="() => licenseExpanded = true">
{% translate "Show more" %}
</button>
<button v-if="licenseExpanded" class="btn btn-link text-info description-long-btn" @click="() => licenseExpanded = false">
{% translate "Show less" %}
</button>
<div v-if="licenseExpanded">
<markdown-box class="small" :content="data.license_custom.description"></markdown-box>
</div>
</template>
<template v-else-if="activeJob">[[ activeJob.license ]]</template>
</span>
Expand Down
1 change: 1 addition & 0 deletions data_registry/vue/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ if (document.getElementById("detail_app")) {
data: function() {
return {
descriptionExpanded: false,
licenseExpanded: false,
feedbackType: null,
feedback: null,
feedbackSent: false,
Expand Down

0 comments on commit 10e135d

Please sign in to comment.