Skip to content

Commit

Permalink
Use carousel for expert distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Collins committed Jun 19, 2023
1 parent e57f544 commit a7f5f61
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 12 deletions.
2 changes: 1 addition & 1 deletion grails-app/assets/javascripts/species.show.js
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ function prevDistribution() {

function showDistribution() {
$("#expertDistroDiv img").attr("src", distributions[distributionsIdx].url);
$("#dataResourceAreaName").text(distributions[distributionsIdx].name)
$("#dataResourceAreaName").text((distributionsIdx + 1) + ": " + distributions[distributionsIdx].name)
if (distributions[distributionsIdx].dr) {
var attr = $('<a>').attr('href', SHOW_CONF.collectoryUrl + '/public/show/' + distributions[distributionsIdx].dr).text(distributions[distributionsIdx].providerName)
$("#expertDistroDiv #dataResource").html(attr);
Expand Down
21 changes: 20 additions & 1 deletion grails-app/assets/stylesheets/atlas.css
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,23 @@ html, body {height:100%;}

.margin-bottom-30 {
margin-bottom: 30px;
}
}

/* expertDistro */
.carousel-button {
height:316px;
font-size:30px;
color:gray;
background: #3a3a3a;
border:0;
}

.carousel-button:hover {
color:white;
/*background: #7a7a7a;*/
}

.carousel-button:disabled {
opacity: 0.0;
}

30 changes: 20 additions & 10 deletions grails-app/views/species/_overview.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,28 @@

<div class="col-md-6">
<div id="expertDistroDiv" style="display:none;margin-bottom: 20px;">
<h3><g:message code="overview.map.occurrence.compile.mapa.attribution"/><span id="expertDistroCount"></span>
<button id="expertDistroPrev" onclick="prevDistribution()" disabled> &lt; </button>
<button id="expertDistroNext" onclick="nextDistribution()" disabled> &gt; </button>
</h3>
<img id="distroMapImage" src="${resource(dir: 'images', file: 'noImage.jpg')}" class="distroImg"
style="width:316px;" alt="occurrence map" onerror="this.style.display = 'none'"/>
<h3><g:message code="overview.map.occurrence.compile.mapa.attribution"/><span id="expertDistroCount"></span></h3>

<div>
<div style="background-color: #3a3a3a;text-align-last: center">

<img id="distroMapImage" src="${resource(dir: 'images', file: 'noImage.jpg')}" class="distroImg"
style="width:316px;" alt="occurrence map" onerror="this.style.display = 'none'"/>

<button id="expertDistroPrev" onclick="prevDistribution()" disabled class="carousel-button" style="float:left;">
<span> &lt; </span>
</button>

<button id="expertDistroNext" onclick="nextDistribution()" disabled class="carousel-button" style="float:right;">
<span> &gt; </span>
</button>
</div>
<p class="mapAttribution">
<span id="dataResourceAreaName" style="font-weight: bold;font-style: italic;"></span>
<g:message code="overview.map.occurrence.mapa.attribution.01"/>
<span id="dataResource">[<g:message code="overview.map.occurrence.mapa.attribution.02"/>]</span></p>
</div>

<p class="mapAttribution">
<span id="dataResourceAreaName" style="font-weight: bold;font-style: italic;"></span>
<g:message code="overview.map.occurrence.mapa.attribution.01"/>
<span id="dataResource">[<g:message code="overview.map.occurrence.mapa.attribution.02"/>]</span></p>
</div>

<div class="taxon-map">
Expand Down

0 comments on commit a7f5f61

Please sign in to comment.