Skip to content

Commit

Permalink
Adiciona template e js para seletor de ano de dados de citações
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelpezzuto committed Jun 26, 2022
1 parent 220c770 commit 43f216b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions analytics/templates/website/bibliometrics_datepicker.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## coding: utf-8
<div class="row container-fluid">
<form class="form-inline">
<div class="form-group">
<div class="input-group">
<label class="sr-only" for="seleted-year">Ano</label>
<div class="input-group-addon">
<span class="glyphicon glyphicon-calendar" aria-hidden="true"></span>
</div>
<input class="input-group-addon" id="selected-year" type="number" name="selected-year" min="1941" max="2023" value="2021"/>
<div class="input-group-addon">
<a href="#" onclick="updateData();" data-toggle="tooltip" data-placement="bottom" title="${_(u'Citações realizadas no ano selecionado')}">${_(u'aplicar')}</a>
</div>
<div class="input-group-addon">
<span class="glyphicon glyphicon-question-sign" data-toggle="popover" data-container="body" data-placement="bottom" title="${_(u'Seletor de ano de citações')}" data-content="${_(u'Utilize o campo para selecionar o ano das citações e clique em aplicar para atualizar os links.')}"></span>
</div>
</div>
</div>
</form>
</div>

<script language="javascript">
function updateData() {
csvLinks = ['link_citations_granted_count', 'link_citations_received_count', 'link_citations_received_cited_forms', 'link_citations_received_citing_pids', 'link_citations_received_standardized'];
for (var i = 0; i < csvLinks.length; i++){
changeLinkData(document.getElementById(csvLinks[i]));
}
}
function changeLinkData(element){
selected_year = document.getElementById("selected-year").value;
element.text = element.text.slice(0, -8) + selected_year + '.csv';
element.href = element.href.slice(0, -8) + selected_year + '.csv';
}
</script>

0 comments on commit 43f216b

Please sign in to comment.