Skip to content

Commit

Permalink
Merge pull request #37 from CUAHSI/non-open-access-check
Browse files Browse the repository at this point in the history
Revise text/figure content in popup
  • Loading branch information
devincowan authored Jan 23, 2025
2 parents 8328d32 + 25bef65 commit d73bf9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/src/stores/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,28 @@ export const useMapStore = defineStore('map', () => {


const props = feature.properties;
const note = "This is not a public access article, see the url.";
const note = "Not open access, see article for ";
if (props.model_type.name === 'Text model') {
if(props.citation.attribution == "Not open-access"){
content += note
content += note + "text"
}else{
content += `<p>${feature.properties.textmodel_snipped}</p>`
}

if(((props.textmodel_section_name && props.textmodel_section_name != "N/A")
|| (props.textmodel_section_number && props.textmodel_section_number != "N/A"))
&& (props.textmodel_page_number && props.textmodel_page_number != "N/A")){
content += `<h5>${props.textmodel_section_number != "N/A" ? ("Section " + props.textmodel_section_number ) + ' ' : ''} ${props.textmodel_section_name != 'N/A' ? props.textmodel_section_name + ' ' : ''} ${props.textmodel_page_number != "N/A" ? ("(pg " + props.textmodel_page_number) + ')' : ''}</h5>`
content += `<p class="mt-1"><b>Section ${props.textmodel_section_number != "N/A" ? (props.textmodel_section_number ) + '</b> ' : '</b>'} ${props.textmodel_section_name != 'N/A' ? props.textmodel_section_name + ' ' : ''} ${props.textmodel_page_number != "N/A" ? ("(Page " + props.textmodel_page_number) + ')' : ''}</p>`
}
} else {
if(props.citation.attribution == "Not open-access"){
content += note
content += note + "figure"
}else{
content += `<img src="${feature.properties.figure_url}" style="width: 100%">`
}

if(props.figure_caption && props.figure_caption != "N/A"){
content += `<h5>${props.figure_num != "N/A" ? ("Figure " + props.figure_num + ' : ') : ''} ${props.figure_caption}</h5>`
content += `<p class="mt-1"><b>Figure ${props.figure_num != "N/A" ? (props.figure_num + ' :</b> ') : '</b>'} ${props.figure_caption}</p>`
}
}
content += '<hr><br>'
Expand Down

0 comments on commit d73bf9f

Please sign in to comment.