Skip to content

Commit

Permalink
Merge pull request #347 from datalad/asset-updates
Browse files Browse the repository at this point in the history
Fine tuning of HTML rendering
  • Loading branch information
jsheunis authored Sep 22, 2023
2 parents 5a9671c + 9a1ae7b commit 75cd669
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions datalad_catalog/catalog/templates/dataset-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h3>Cite dataset</h3>
<b-button pill disabled size="sm" variant="outline-dark" v-for="keyword in selectedDataset.keywords">{{keyword}}</b-button>
</b-card-text>

<b-card-text>
<b-card-text v-if="selectedDataset.subdatasets_available_count || selectedDataset.top_display">
<strong>Properties:</strong> <br>
<span v-if="selectedDataset.subdatasets_available_count"><b-button disabled size="sm" variant="outline-dark">Subdatasets: {{selectedDataset.subdatasets_available_count}}</b-button>&nbsp;</span>
<span v-if="selectedDataset.top_display && selectedDataset.top_display.length">
Expand Down Expand Up @@ -300,7 +300,7 @@ <h5>{{pub.title}}</h5>
<small>
Published: {{pub.datePublished}} <br>
DOI: <span v-if="pub.doi"><a :href="pub.doi" target="_blank">{{pub.doi.replace("https://doi.org/", "")}}</a></span> <br>
Journal: {{pub.publicationOutlet}}
<span v-if="pub.publicationOutlet">Journal: {{pub.publicationOutlet}}</span>
</small>
</b-col>
</b-row>
Expand All @@ -324,8 +324,9 @@ <h5>{{pub.title}}</h5>
<span class="xxlfont"><i class="fas fa-dollar-sign "></i></span>
</b-col>
<b-col class="text-muted" md="11">
<h5><span v-if="fund.name">{{fund.name}}</span><span v-else><em>(fund name missing)</em></span></h5>
<small><strong>Grant identifier:</strong> {{fund["identifier"]}}<br><strong>Description:</strong> {{fund["description"]}}</small><br>
<h5><span v-if="fund.name">{{fund.name}}</span><span v-else><em>(fund name not specified)</em></span></h5>
<span v-if="fund['identifier']"><small><strong>Grant identifier:</strong> {{fund["identifier"]}}</small><br></span>
<span v-if="fund['description']"><small><strong>Description:</strong> {{fund["description"]}}</small><br></span>
</b-col>
</b-col>
</b-row>
Expand Down Expand Up @@ -464,7 +465,18 @@ <h5><span v-if="fund.name">{{fund.name}}</span><span v-else><em>(fund name missi
<tbody>
<tr v-for="content_key in Object.keys(new_tab.content)">
<td><strong>{{ content_key.charAt(0).toUpperCase() + content_key.slice(1) }}</strong></td>
<td>{{ new_tab.content[content_key] }}</td>
<td>
<span v-if="!new_tab.content[content_key]"><em>not specified</em></span>
<span v-else-if="Array.isArray(new_tab.content[content_key])">
<span v-for="val in new_tab.content[content_key]">{{val}}<br></span>
</span>
<span v-else-if="typeof new_tab.content[content_key] === 'object'">
<span v-for="k in Object.keys(new_tab.content[content_key])">
<em>{{k}}:</em> {{new_tab.content[content_key][k]}} <br>
</span>
</span>
<span v-else>{{ new_tab.content[content_key] }}</span>
</td>
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 75cd669

Please sign in to comment.