Skip to content

Commit

Permalink
more elaborate tooltips #5253
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Jul 18, 2019
1 parent 29ec5b7 commit 0cc3a78
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
25 changes: 15 additions & 10 deletions src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1214,22 +1214,27 @@ dataset.exportBtn.itemLabel.dataciteOpenAIRE=OpenAIRE
metrics.title=Metrics
metrics.title.tip=View more metrics information

metrics.title.dataset=Dataset Metrics
metrics.title.file=File Metrics

metrics.title.tip.default=Metrics collecting download counts.
metrics.title.tip.makedatacount=Metrics collected and integrated with Make Data Count standards.

metrics.dataset.title=Dataset Metrics
metrics.dataset.tip.default=Aggregated metrics for this dataset.
metrics.dataset.tip.makedatacount=Metrics collected using Make Data Count standards.
# Views are only tracked by Make Data Count, not "default" (out of the box).
metrics.dataset.views.tip=Dataset views are combined with aggregated file views.
metrics.dataset.downloads.default.tip=Total aggregated downloads of files in this dataset.
metrics.dataset.downloads.makedatacount.tip=Each file download (single or multiple files) increments the download count.
# Citations are only tracked by Make Data Count, not "default" (out of the box).
metrics.dataset.citations.tip=Click for a list of citation URLs.

metrics.file.title=File Metrics
metrics.file.tip.default=Metrics for this individual file.
metrics.file.tip.makedatacount=Individual file downloads are tracked but this is not part of the Make Data Count standard.
metrics.file.downloads.tip=Total downloads of this file.

metrics.views={0, choice, 0#Views|1#View|2#Views}
metrics.views.tip=Count of views
metrics.downloads={0, choice, 0#Downloads|1#Download|2#Downloads}
metrics.downloads.tip=Count of downloads
metrics.citations={0, choice, 0#Citations|1#Citation|2#Citations}
metrics.citations.tip=Count of citations

metrics.citations.dialog.header=Dataset Citations
metrics.citations.dialog.help=This list of citations for this dataset was generated by Make Data Count. For more information, check out our User Guides.
metrics.citations.dialog.help=Citations for this dataset are retrieved from Crossref via DataCite a using Make Data Count standards.


dataset.publish.btn=Publish
Expand Down
12 changes: 7 additions & 5 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -377,32 +377,34 @@
<!-- Metrics -->
<div id="metrics-block" class="col-sm-3" jsf:rendered="#{!(settingsWrapper.rsyncDownload or DatasetPage.workingVersion.deaccessioned)}">
<div id="metrics-heading">
#{bundle['metrics.title.dataset']}
#{bundle['metrics.dataset.title']}
<span class="glyphicon glyphicon-question-sign tooltip-icon" data-toggle="tooltip" data-placement="auto top"
data-original-title="#{empty settingsServiceBean.get(':MDCLogPath') ? bundle['metrics.title.tip.default'] : bundle['metrics.title.tip.makedatacount']}"></span>
data-original-title="#{empty settingsServiceBean.get(':MDCLogPath') ? bundle['metrics.dataset.tip.default'] : bundle['metrics.dataset.tip.makedatacount']}"></span>
</div>
<div id="metrics-content">
<!-- Classic downloads -->
<div class="metrics-count-block" jsf:rendered="#{empty settingsServiceBean.get(':MDCLogPath')}">
<h:outputFormat value="{0} #{bundle['metrics.downloads']}">
<f:param value="#{guestbookResponseServiceBean.getCountGuestbookResponsesByDatasetId(DatasetPage.dataset.id)}"/>
</h:outputFormat>
<span class="glyphicon glyphicon-question-sign tooltip-icon"
data-toggle="tooltip" data-placement="auto top" data-original-title="#{bundle['metrics.dataset.downloads.default.tip']}"></span>
</div>
<!-- Make Data Count views -->
<div class="metrics-count-block" jsf:rendered="#{not empty settingsServiceBean.get(':MDCLogPath')}">
<h:outputFormat value="{0} #{bundle['metrics.views']}">
<f:param value="#{datasetMetricsServiceBean.getMetrics(DatasetPage.dataset).getViewsTotal()}"/>
</h:outputFormat>
<span class="glyphicon glyphicon-question-sign tooltip-icon"
data-toggle="tooltip" data-placement="auto top" data-original-title="#{bundle['metrics.views.tip']}"></span>
data-toggle="tooltip" data-placement="auto top" data-original-title="#{bundle['metrics.dataset.views.tip']}"></span>
</div>
<!-- Make Data Count downloads -->
<div class="metrics-count-block" jsf:rendered="#{not empty settingsServiceBean.get(':MDCLogPath')}">
<h:outputFormat value="{0} #{bundle['metrics.downloads']}">
<f:param value="#{datasetMetricsServiceBean.getMetrics(DatasetPage.dataset).getDownloadsTotal()}"/>
</h:outputFormat>
<span class="glyphicon glyphicon-question-sign tooltip-icon"
data-toggle="tooltip" data-placement="auto top" data-original-title="#{bundle['metrics.downloads.tip']}"></span>
data-toggle="tooltip" data-placement="auto top" data-original-title="#{bundle['metrics.dataset.downloads.makedatacount.tip']}"></span>
</div>
<!-- Make Data Count citations (DOIs only, not Handles) -->
<div class="metrics-count-block" jsf:rendered="#{not empty settingsServiceBean.get(':MDCLogPath') and settingsServiceBean.get(':Protocol') == 'doi'}">
Expand All @@ -414,7 +416,7 @@
</p:commandLink>

<span class="glyphicon glyphicon-question-sign tooltip-icon"
data-toggle="tooltip" data-placement="auto top" data-original-title="#{bundle['metrics.citations.tip']}"></span>
data-toggle="tooltip" data-placement="auto top" data-original-title="#{bundle['metrics.dataset.citations.tip']}"></span>

<p:dialog id="citationsDialog" styleClass="smallPopup" header="#{bundle['metrics.citations.dialog.header']}" widgetVar="citationsDialog" modal="true">
<p class="help-block">#{bundle['metrics.citations.dialog.help']}</p>
Expand Down
8 changes: 5 additions & 3 deletions src/main/webapp/file.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -317,24 +317,26 @@
<!-- Metrics -->
<div id="metrics-block" jsf:rendered="#{!(widgetWrapper.widgetView or FilePage.fileMetadata.dataFile.filePackage or FilePage.fileMetadata.datasetVersion.deaccessioned)}">
<div id="metrics-heading">
#{bundle['metrics.title.file']}
#{bundle['metrics.file.title']}
<span class="glyphicon glyphicon-question-sign tooltip-icon" data-toggle="tooltip" data-placement="auto top"
data-original-title="#{empty settingsServiceBean.get(':MDCLogPath') ? bundle['metrics.title.tip.default'] : bundle['metrics.title.tip.makedatacount']}"></span>
data-original-title="#{empty settingsServiceBean.get(':MDCLogPath') ? bundle['metrics.file.tip.default'] : bundle['metrics.file.tip.makedatacount']}"></span>
</div>
<div id="metrics-content">
<!-- Classic downloads -->
<div class="metrics-count-block" jsf:rendered="#{empty settingsServiceBean.get(':MDCLogPath')}">
<h:outputFormat value="{0} #{bundle['metrics.downloads']}">
<f:param value="#{guestbookResponseServiceBean.getCountGuestbookResponsesByDataFileId(FilePage.fileId)}"/>
</h:outputFormat>
<span class="glyphicon glyphicon-question-sign tooltip-icon"
data-toggle="tooltip" data-placement="auto top" data-original-title="#{bundle['metrics.file.downloads.tip']}"></span>
</div>
<!-- Make Data Count downloads -->
<div class="metrics-count-block" jsf:rendered="#{not empty settingsServiceBean.get(':MDCLogPath')}">
<h:outputFormat value="{0} #{bundle['metrics.downloads']}">
<f:param value="#{guestbookResponseServiceBean.getCountGuestbookResponsesByDataFileId(FilePage.fileId)}"/>
</h:outputFormat>
<span class="glyphicon glyphicon-question-sign tooltip-icon"
data-toggle="tooltip" data-placement="auto top" data-original-title="#{bundle['metrics.downloads.tip']}"></span>
data-toggle="tooltip" data-placement="auto top" data-original-title="#{bundle['metrics.file.downloads.tip']}"></span>
</div>
</div>
</div>
Expand Down

0 comments on commit 0cc3a78

Please sign in to comment.