Skip to content

Commit

Permalink
feat: Improve view dataset GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
drorganvidez committed Jul 9, 2024
1 parent bc6837e commit a626f74
Show file tree
Hide file tree
Showing 5 changed files with 250 additions and 100 deletions.
188 changes: 115 additions & 73 deletions app/modules/dataset/templates/dataset/view_dataset.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@

</div>

<h1 class="h3 mb-3">View dataset: {{ dataset.ds_meta_data.title }}</h1>

<div class="row">

<div class="col-xl-8 col-lg-12 col-md-12 col-sm-12">

<div class="card">
<div class="card-body">
<div class="d-flex align-items-center justify-content-between">
<h2>{{ dataset.ds_meta_data.title }}</h2>
<h1><b>{{ dataset.ds_meta_data.title }}</b></h1>
<div>
<span class="badge bg-secondary">{{ dataset.get_cleaned_publication_type() }}</span>
</div>
Expand Down Expand Up @@ -95,10 +93,10 @@ <h2>{{ dataset.ds_meta_data.title }}</h2>

</div>

{% if dataset.ds_meta_data.publication_doi %}
<div class="row mb-2">

<div class="col-md-4 col-12">
<span class=" text-secondary">
<span class="text-secondary">
Publication DOI
</span>
</div>
Expand All @@ -107,53 +105,37 @@ <h2>{{ dataset.ds_meta_data.title }}</h2>
{{ dataset.ds_meta_data.publication_doi }}
</a>
</div>

</div>

<!--
<div class="row mb-2">
<div class="col-md-4 col-12">
<span class=" text-secondary">
Dataset DOI (Zenodo)
</span>
</div>
<div class="col-md-8 col-12">
<a href="http://www.doi.org/{{ dataset.ds_meta_data.dataset_doi }}" target="_blank">
https://www.doi.org/{{ dataset.ds_meta_data.dataset_doi }}
</a>
<div id="dataset_doi" style="display: none">
https://www.doi.org/{{ dataset.ds_meta_data.dataset_doi }}
</div>
<i data-feather="clipboard" class="center-button-icon"
style="cursor: pointer"
onclick="copyText('dataset_doi')"></i>
</div>
</div>
-->
{% endif %}

<div class="row mb-2">

<div class="col-md-4 col-12">
<span class=" text-secondary">
Dataset DOI
Zenodo record
</span>
</div>
<div class="col-md-8 col-12">
<a href="{{ dataset.get_uvlhub_doi() }}">
{{ dataset.get_uvlhub_doi() }}
</a>

<div id="dataset_doi_uvlhub" style="display: none">
{{ dataset.get_uvlhub_doi() }}
{% if FLASK_ENV == 'production' %}
<div class="col-md-8 col-12">
<a href="https://zenodo.org/records/{{ dataset.ds_meta_data.deposition_id }}" target="_blank">
https://zenodo.org/records/{{ dataset.ds_meta_data.deposition_id }}
</a>
</div>
{% elif FLASK_ENV == 'development' %}
<div class="col-md-8 col-12">
<a href="https://sandbox.zenodo.org/records/{{ dataset.ds_meta_data.deposition_id }}" target="_blank">
https://sandbox.zenodo.org/records/{{ dataset.ds_meta_data.deposition_id }}
</a>
</div>
{% else %}
<div class="col-md-8 col-12">
<a href="https://zenodo.org/records/{{ dataset.ds_meta_data.deposition_id }}" target="_blank">
https://sandbox.zenodo.org/records/{{ dataset.ds_meta_data.deposition_id }}
</a>
</div>
{% endif %}

<i data-feather="clipboard" class="center-button-icon" style="cursor: pointer"
onclick="copyText('dataset_doi_uvlhub')"></i>
</div>

</div>

Expand All @@ -172,51 +154,111 @@ <h2>{{ dataset.ds_meta_data.title }}</h2>

</div>



</div>

<div class="card-body" style="padding-top: 0px">

<div id="dataset_doi_uvlhub" style="display: none">
{{ dataset.get_uvlhub_doi() }}
</div>

<button type="button" class="btn doi_button btn-sm" onclick="copyText('dataset_doi_uvlhub')">
<span class="button_doi_id">
<i data-feather="clipboard" class="center-button-icon" style="cursor: pointer"></i>
<b>DOI</b>
</span>
<span class="doi_text">
{{ dataset.get_uvlhub_doi() }}
</span>
</button>

<div id="dataset_doi_uvlhub" style="display: none">
{{ dataset.get_uvlhub_doi() }}
</div>

</div>

</div>

</div>
<div class="card">

<div class="col-xl-4 col-lg-12 col-md-12 col-sm-12">
<div class="card-body">

<h1 class="h3 mb-3">UVL models ({{ dataset.get_files_count() }})</h1>
<h3> Related publication </h3>

David Romero-Organvidez, José A. Galindo, Chico Sundermann, Jose-Miguel Horcas, David Benavides,
<i>UVLHub: A feature model data repository using UVL and open science principles</i>,
Journal of Systems and Software,
2024,
112150,
ISSN 0164-1212,
<a href="https://doi.org/10.1016/j.jss.2024.112150" target="_blank">https://doi.org/10.1016/j.jss.2024.112150</a>

<table class="table">
<thead>
<tr>
<th style="width: 40%;">UVL title</th>
<th style="width: 20%;">Size</th>
<th style="width: 40%;">Options</th>
</tr>
</thead>
<tbody>
</div>

<div class="card-body mt-0 pt-0">

<button onclick="copyText('bibtex_cite')" class="btn btn-light btn-sm" style="border-radius: 5px; margin-right: 10px">
<i data-feather="clipboard" class="center-button-icon"></i>
Copy in BibTex
</button>

<button onclick="copyText('ris_cite')" class="btn btn-light btn-sm" style="border-radius: 5px;">
<i data-feather="clipboard" class="center-button-icon"></i>
Copy in RIS
</button>

<button onclick="copyText('apa_cite')" class="btn btn-light btn-sm" style="border-radius: 5px;">
<i data-feather="clipboard" class="center-button-icon"></i>
Copy in APA
</button>

<button onclick="copyText('text_cite')" class="btn btn-light btn-sm" style="border-radius: 5px;">
<i data-feather="clipboard" class="center-button-icon"></i>
Copy in text
</button>

</div>

{% for feature_model in dataset.feature_models %}
</div>


</div>

<div class="col-xl-4 col-lg-12 col-md-12 col-sm-12">

<h3 class="mb-3">UVL models ({{ dataset.get_files_count() }})</h3>

<div class="list-group">
{% for feature_model in dataset.feature_models %}
{% for file in feature_model.files %}
<tr>
<td>{{ file.name }}</td>
<td>{{ file.get_formatted_size() }}</td>
<td>
<a href="{{ url_for('dataset.download_file', file_id=file.id) }}"
class="btn btn-outline-primary btn-sm option-button" style="border-radius: 5px;">
<i data-feather="download"></i>
</a>
<button onclick="viewFile('{{ file.id }}')"
class="btn btn-outline-secondary btn-sm option-button" style="border-radius: 5px;">
<i data-feather="eye"></i>
</button>
</td>
</tr>
{% endfor %}
<div class="list-group-item d-flex justify-content-between align-items-center">
<div>
<i data-feather="file"></i> {{ file.name }}
<br>
<small class="text-muted">({{ file.get_formatted_size() }})</small>
</div>
<div>
<a href="{{ url_for('dataset.download_file', file_id=file.id) }}" class="btn btn-outline-primary btn-sm" style="border-radius: 5px;">
<i data-feather="download"></i>
</a>
<button onclick="viewFile('{{ file.id }}')" class="btn btn-outline-secondary btn-sm" style="border-radius: 5px;">
<i data-feather="eye"></i>
</button>
</div>
</div>
{% endfor %}
</tbody>
</table>

<a href="/dataset/download/{{ dataset.id }}" class="btn btn-primary" style="border-radius: 5px;">
{% endfor %}
</div>
<a href="/dataset/download/{{ dataset.id }}" class="btn btn-primary mt-3" style="border-radius: 5px;">
<i data-feather="download" class="center-button-icon"></i>
Download all ({{ dataset.get_file_total_size_for_human() }})
</a>
</div>

</div>

<!-- Modal-->
Expand Down
43 changes: 18 additions & 25 deletions app/modules/public/templates/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,44 +162,37 @@ <h4 class="h4" class="stats-color">
<div class="card">

<div class="card-body">


<div id="bibtex_cite" style="display: none">
@article{ROMEROORGANVIDEZ2024112150,
title = {UVLHub: A feature model data repository using UVL and open science principles},
journal = {Journal of Systems and Software},
pages = {112150},
year = {2024},
issn = {0164-1212},
doi = {https://doi.org/10.1016/j.jss.2024.112150},
url = {https://www.sciencedirect.com/science/article/pii/S016412122400195X},
author = {David Romero-Organvidez and José A. Galindo and Chico Sundermann and Jose-Miguel Horcas and David Benavides},
keywords = {Feature models, Software product line, Variability, Dataset, Uvl},
abstract = {Feature models are the de facto standard for modelling variabilities and commonalities in features and relationships in software product lines. They are the base artefacts in many engineering activities, such as product configuration, derivation, or testing. Concrete models in different domains exist; however, many are in private or sparse repositories or belong to discontinued projects. The dispersion of knowledge of feature models hinders the study and reuse of these artefacts in different studies. The Universal Variability Language (UVL) is a community effort textual feature model language that promotes a common way of serialising feature models independently of concrete tools. Open science principles promote transparency, accessibility, and collaboration in scientific research. Although some attempts exist to promote feature model sharing, the existing solutions lack open science principles by design. In addition, existing and public feature models are described using formats not always supported by current tools. This paper presents , a repository of feature models in UVL format. provides a front end that facilitates the search, upload, storage, and management of feature model datasets, improving the capabilities of discontinued proposals. Furthermore, the tool communicates with Zenodo –one of the most well-known open science repositories– providing a permanent save of datasets and following open science principles. includes existing datasets and is readily available to include new data and functionalities in the future. It is maintained by three active universities in variability modelling.}
}
</div>

<h2> <b>Cite us!</b> </h2>

<h2> <b>Related publication</b> </h2>

David Romero-Organvidez, José A. Galindo, Chico Sundermann, Jose-Miguel Horcas, David Benavides,
David Romero-Organvidez, José A. Galindo, Chico Sundermann, Jose-Miguel Horcas, David Benavides.
<i>UVLHub: A feature model data repository using UVL and open science principles</i>,
Journal of Systems and Software,
2024,
112150,
ISSN 0164-1212,
https://doi.org/10.1016/j.jss.2024.112150

<a href="https://doi.org/10.1016/j.jss.2024.112150" target="_blank">https://doi.org/10.1016/j.jss.2024.112150</a>
</div>

<div class="card-body mt-0 pt-0">

<button onclick="copyText('bibtex_cite')" class="btn btn-light" style="border-radius: 5px;">
<button onclick="copyText('bibtex_cite')" class="btn btn-light" style="border-radius: 5px; margin-right: 10px">
<i data-feather="clipboard" class="center-button-icon"></i>
Copy cite in Bibtex
Copy in BibTex
</button>


<button onclick="copyText('ris_cite')" class="btn btn-light" style="border-radius: 5px;">
<i data-feather="clipboard" class="center-button-icon"></i>
Copy in RIS
</button>

</div>

</div>


</div>

Expand Down
2 changes: 1 addition & 1 deletion app/static/css/app.css

Large diffs are not rendered by default.

61 changes: 60 additions & 1 deletion app/static/css/own.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,63 @@

.stats-color {
color: #009688;
}
}

.doi_button {
background-color: #147ABB;
border-color: #147ABB;
color: white;
display: flex;
align-items: center;
padding: 0;
border-radius: 5px;
overflow: hidden;
}

.doi_button:hover {
background-color: #075585;
border-color: #075585;
}

.button_doi_id {
background-color: #5C5C5C;
padding: 10px;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.3s ease, color 0.3s ease;
}

.doi_button:hover .button_doi_id {
background-color: #075585;
color: white;
}

.doi_text {
background-color: #147ABB;
padding: 10px;
display: flex;
align-items: center;
transition: background-color 0.3s ease;
}

.doi_button:hover .doi_text {
background-color: #4ebbff;
color: white;
}

.doi_button:active .doi_text {
background-color: #4ebbff;
color: white;
}

.doi_button:active .button_doi_id {
background-color: #075585;
color: white;
}

.center-button-icon {
margin-right: 5px;
}

Loading

0 comments on commit a626f74

Please sign in to comment.