Skip to content

Commit

Permalink
Merge pull request #150 from charvolant/master
Browse files Browse the repository at this point in the history
Show common names and favourites
  • Loading branch information
charvolant authored Apr 16, 2019
2 parents e02b359 + ac6ef31 commit 9586db7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 8 deletions.
7 changes: 7 additions & 0 deletions grails-app/assets/stylesheets/atlas.css
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ html, body {height:100%;}
.tag-tk-cv { }
.tag-tk-cs { }

/** Favourites */
.favourite { display: inline; padding: 2px 0.5ex; font-size: xx-small; vertical-align: super; }
.favourite-favourite { color: #228b22; }
.favourite-iconic { color: #228b22; }
.favourite-interest { color: #228b22; }
.favourite-preferred { color: #228b22; }


/* Media Queries
================================================== */
Expand Down
10 changes: 5 additions & 5 deletions grails-app/controllers/au/org/ala/bie/UrlMappings.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ package au.org.ala.bie
class UrlMappings {

static mappings = {
"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}
// Redirects for BIE web services URLs
"/geo"(controller: "species", action: "geoSearch")
"/species/$guid**"(controller: "species", action: "show")
Expand All @@ -21,6 +16,11 @@ class UrlMappings {
"/logout"(controller: "species", action: "logout")
"/i18n/$catalogue"(controller: "i18nMessages", action: "i18n")
"/search/auto.jso*"(controller:"externalSite", action: "proxyAutocomplete") // legacy URL
"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}
"/"(view:"/index")
"500"(view:'/error')
}
Expand Down
9 changes: 9 additions & 0 deletions grails-app/i18n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ facet.category_SA_m_s=SA Category
facet.category_WA_m_s=WA Category
facet.category_NT_m_s=NT Category

favourite.favourite=<span class="glyphicon glyphicon-thumbs-up"></span>
favourite.favourite.detail=Favourite species
favourite.iconic=<span class="glyphicon glyphicon-thumbs-up"></span>
favourite.iconic.detail=Iconic species
favourite.interest=
favourite.interest.detail=Species of interest
favourite.preferred=
favourite.preferred.detail=Preferred species

isLocatedInHubCountry_b.true=Yes
locatedInHubCountry.true=Yes
imageAvailable.no=No
Expand Down
17 changes: 14 additions & 3 deletions grails-app/views/species/search.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@

<h3>${result.rank}:
<a href="${acceptedPageLink}"><bie:formatSciName rankId="${result.rankID}" taxonomicStatus="${result.taxonomicStatus}" nameFormatted="${result.nameFormatted}" nameComplete="${result.nameComplete}" name="${result.name}" acceptedName="${result.acceptedConceptName}"/></a><%--
--%><g:if test="${result.commonNameSingle}"><span class="commonNameSummary">&nbsp;&ndash;&nbsp;${result.commonNameSingle}</span></g:if>
--%><g:if test="${result.commonNameSingle}"><span class="commonNameSummary">&nbsp;&ndash;&nbsp;${result.commonNameSingle}</span></g:if><%--
--%><g:if test="${result.favourite}"><span class="favourite favourite-${result.favourite}" title="<g:message code="favourite.${result.favourite}.detail"/>"><g:message code="favourite.${result.favourite}" encodeAs="raw"/></span></g:if>
</h3>

<g:if test="${result.commonName != result.commonNameSingle}"><p class="alt-names">${result.commonName}</p></g:if>
Expand All @@ -228,8 +229,18 @@
</g:if>
<g:elseif test="${result.has("idxtype") && result.idxtype == 'COMMON'}">
<g:set var="speciesPageLink">${request.contextPath}/species/${result.linkIdentifier?:result.taxonGuid}</g:set>
<h4><g:message code="idxtype.${result.idxtype}" default="${result.idxtype}"/>:
<a href="${speciesPageLink}">${result.name}</a></h4>
<g:if test="${result.image}">
<div class="result-thumbnail">
<a href="${speciesPageLink}">
<img src="${grailsApplication.config.image.thumbnailUrl}${result.image}" alt="">
</a>
</div>
</g:if>
<h3><g:message code="idxtype.${result.idxtype}" default="${result.idxtype}"/>:
<a class="commonNameSummary" href="${speciesPageLink}">${result.name}</a><%--
--%><g:if test="${result.acceptedConceptName}">&nbsp;&ndash;&nbsp;<bie:formatSciName rankId="${result.rankID}" taxonomicStatus="accepted" name="${result.acceptedConceptName}"/></g:if><%--
--%><g:if test="${result.favourite}"><span class="favourite favourite-${result.favourite}" title="<g:message code="favourite.${result.favourite}.detail"/>"><g:message code="favourite.${result.favourite}" encodeAs="raw"/></span></g:if>
</h3>
</g:elseif>
<g:elseif test="${result.has("idxtype") && result.idxtype == 'IDENTIFIER'}">
<g:set var="speciesPageLink">${request.contextPath}/species/${result.linkIdentifier?:result.taxonGuid}</g:set>
Expand Down

0 comments on commit 9586db7

Please sign in to comment.