Skip to content

Commit

Permalink
fixing what is lost interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
dcnb committed May 6, 2024
1 parent fc9198e commit 389c602
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 32 deletions.
4 changes: 2 additions & 2 deletions _data/what-is-lost.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
objectid,parentid,prevobjectid,prevlink,nextobjectid,nextlink,filename,title,date,description,narrative,subject,location,latitude,longitude,source,identifier,type,format,language,rights,rightsstatement,display_template,object_location,image_small,image_thumb
war-eagle005,war-eagle,,/,sundance-mountain010,,mark_lost.mp4,What is Lost in the Transition Away from Human Staffed Lookouts,2021-08-20,Mark Shreiter explains what is lost as the Forest Service and other agencies move away from fire lookout use.,,Aldo Leopold; McCall; Payette National Forest;,Payette National Forest,45.32173,-115.79478,,,image;MovingImage,video/mp4,eng,,,video,https://cdil.lib.uidaho.edu/keeping-watch/objects/videos/mark_lost.mp4,https://cdil.lib.uidaho.edu/keeping-watch/objects/small/mark_lost_sm.jpg,https://cdil.lib.uidaho.edu/keeping-watch/objects/thumbs/mark_lost_th.jpg
sundance-mountain010,sundance-mountain,war-eagle005,,spot-mountain005,,pam_lost.mp4,What is Lost in the Transition Away from Human Staffed Lookouts?,2021-06-18,Pam Aunan discusses what is lost as the Forest Service and other agencies move away from lookout use.,,L-4; Priest Lake; Selkirk Mountains; Volunteer lookouts; Idaho Department of Lands; Sundance Fire,Priest Lake,48.49076,-116.75149,,,image;MovingImage,video/mp4,eng,,,video,https://cdil.lib.uidaho.edu/keeping-watch/objects/videos/pam_lost.mp4,https://cdil.lib.uidaho.edu/keeping-watch/objects/small/pam_lost_sm.jpg,https://cdil.lib.uidaho.edu/keeping-watch/objects/thumbs/pam_lost_th.jpg
war-eagle002,war-eagle,,/,sundance-mountain010,,mark_lost.mp4,What is Lost in the Transition Away from Human Staffed Lookouts,2021-08-20,Mark Shreiter explains what is lost as the Forest Service and other agencies move away from fire lookout use.,,Aldo Leopold; McCall; Payette National Forest;,Payette National Forest,45.32173,-115.79478,,,image;MovingImage,video/mp4,eng,,,video,https://cdil.lib.uidaho.edu/keeping-watch/objects/videos/mark_lost.mp4,https://cdil.lib.uidaho.edu/keeping-watch/objects/small/mark_lost_sm.jpg,https://cdil.lib.uidaho.edu/keeping-watch/objects/thumbs/mark_lost_th.jpg
sundance-mountain010,sundance-mountain,war-eagle002,,spot-mountain005,,pam_lost.mp4,What is Lost in the Transition Away from Human Staffed Lookouts?,2021-06-18,Pam Aunan discusses what is lost as the Forest Service and other agencies move away from lookout use.,,L-4; Priest Lake; Selkirk Mountains; Volunteer lookouts; Idaho Department of Lands; Sundance Fire,Priest Lake,48.49076,-116.75149,,,image;MovingImage,video/mp4,eng,,,video,https://cdil.lib.uidaho.edu/keeping-watch/objects/videos/pam_lost.mp4,https://cdil.lib.uidaho.edu/keeping-watch/objects/small/pam_lost_sm.jpg,https://cdil.lib.uidaho.edu/keeping-watch/objects/thumbs/pam_lost_th.jpg
spot-mountain005,spot-mountain,sundance-mountain010,,sheep-hill003,,moaks_lost.mp4,What is Lost in the Transition Away from the Human Staffed Lookout?,2021-09-25,The Moaks discusses what is lost as the Forest Service and other agencies move away from lookout use.,,Staffed Lookouts; legitimate smokes; trigger point; man-wife lookouts; patrol points; blow-up; water dog,Magruder Corridor,45.78728,-114.85466,,,image;MovingImage,video/mp4,eng,,,video,https://cdil.lib.uidaho.edu/keeping-watch/objects/videos/moaks_lost.mp4,https://cdil.lib.uidaho.edu/keeping-watch/objects/small/moaks_lost_sm.jpg,https://cdil.lib.uidaho.edu/keeping-watch/objects/thumbs/moaks_lost_th.jpg
sheep-hill003,sheep-hill,spot-mountain005,,roughneck-peak003,,betsy_lost.mp4,What is Lost in the Transition Away from the Human Staffed Lookout?,2021-06-01,Betsy Booth discusses what is lost as the Forest Service and other agencies move away from lookout use.,,Sheep Hill; Staffed Lookouts; R-6; ,Frank Church River of No Return Wilderness,45.58851,-115.0882,,,image;MovingImage,video/mp4,eng,,,video,https://cdil.lib.uidaho.edu/keeping-watch/objects/videos/betsy_lost.mp4,https://cdil.lib.uidaho.edu/keeping-watch/objects/small/betsy_lost_sm.jpg,https://cdil.lib.uidaho.edu/keeping-watch/objects/thumbs/betsy_lost_th.jpg
roughneck-peak003,roughneck-peak,sheep-hill003,,pilot-peak003,,andy_lost.mp4,What is Lost in the Transition Away from the Human Staffed Fire Lookout?,2021-08-23,Andy Baca discusses what is lost as the Forest Service and other agencies move away from lookout use.,,Earthquake Activity; Terminator; A River Runs Through It; Geist; Staffed Lookouts; ruffneck peak,Frank Church River of No Return Wilderness,44.48270554,-115.155742,,,image;MovingImage,video/mp4,eng,,,video,https://cdil.lib.uidaho.edu/keeping-watch/objects/videos/andy_lost.mp4,https://cdil.lib.uidaho.edu/keeping-watch/objects/small/andy_lost_sm.jpg,https://cdil.lib.uidaho.edu/keeping-watch/objects/thumbs/andy_lost_th.jpg
Expand Down
15 changes: 9 additions & 6 deletions _includes/js/mapitem-js.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{%- assign fields = site.data.config-metadata -%}
{%- assign stubs = site.data.config-nav | map: 'stub' | join: ';' -%}
{%- assign mapitems = site.data.what-is-lost | where_exp: 'item','item.latitude != nil and item.longitude != nil and item.object_location != nil' -%}
<script src="{{ '/assets/lib/lightgallery/js/lightgallery-all.min.js' | relative_url }}"></script>
<script>
/* add item data */
/* mapitem-js.html */
var items = {
{%- for mapitem in mapitems -%}
{{ mapitem.objectid | jsonify }} : { {% for f in fields %}{% if mapitem[f.field] %}{{ f.field | escape | jsonify }}: {{ mapitem[f.field] | escape | jsonify }}, {% endif %}{% endfor %}{% if mapitem.prevobjectid %} "prevobjectid": {{ mapitem.prevobjectid | jsonify }},{% else %} "prevlink": {{ mapitem.prevlink | relative_url | jsonify }},{% endif %}{% if mapitem.nextobjectid %} "nextobjectid": {{ mapitem.nextobjectid | jsonify }}, {% else %} "nextlink": {{ mapitem.nextlink | relative_url | jsonify }},{% endif %}{% if mapitem.youtubeid %} "youtube": {{ mapitem.youtubeid | jsonify }}, {% endif %}"image_small": {{ mapitem.image_small | jsonify }}, "latlong": "{{ mapitem.latitude }},{{ mapitem.longitude }}" , "filename": {{ mapitem.object_location | jsonify }} }{% unless forloop.last %}, {% endunless %}{% endfor %}
{{ mapitem.objectid | jsonify }} : { {% for f in fields %}{% if mapitem[f.field] %}{{ f.field | escape | jsonify }}: {{ mapitem[f.field] | escape | jsonify }}, {% endif %}{% endfor %}{% if mapitem.prevobjectid %} "prevobjectid": {{ mapitem.prevobjectid | jsonify }},{% else %} "prevlink": {{ mapitem.prevlink | relative_url | jsonify }},{% endif %}{% if mapitem.nextobjectid %} "nextobjectid": {{ mapitem.nextobjectid | jsonify }}, {% else %} "nextlink": {{ mapitem.nextlink | relative_url | jsonify }},{% endif %}{% if mapitem.youtubeid %} "youtube": {{ mapitem.youtubeid | jsonify }}, {% endif %}"image_small": {{ mapitem.image_small | jsonify }}, "latlong": "{{ mapitem.latitude }},{{ mapitem.longitude }}" , "filename": {{ mapitem.object_location | jsonify }} ,{% if mapitem.parentid %}"parent": {{ mapitem.parentid | jsonify }}, {%- endif -%}
"id":{{ mapitem.objectid | jsonify }} }{% unless forloop.last %}, {% endunless %}{% endfor %}
};
/* get query id from URL */
var queryString = window.location.search.substring(1).split("id=")[1];
Expand All @@ -25,6 +25,7 @@
var format = record.format;
var objectFile = record.filename;
var objectLink = record.image_small;
var itemHref = `{{ '/items/' | relative_url }}${ record.parent ? record.parent + ".html" : record.id + ".html"}`;
var itemImage, itemLink;
if (format.includes('image')) {
itemImage= '<div class="gallery-img" data-src="' + objectFile + '" id="item-content"><img class="img-fluid" src="' + objectLink + '" alt="' + objectTitle + '"><p><small class="text-white">Click to view full screen</small></p></div>';
Expand Down Expand Up @@ -81,7 +82,7 @@
});
}

/* add item metadata */
/* add item metadata
var fields = '<dl>';
{% for f in fields %}{% if f.browse_link == "true" %}
if (record[{{ f.field | escape | jsonify }}]) {
Expand All @@ -98,7 +99,8 @@
if (record[{{ f.field | escape | jsonify }}]) { fields += '<dt class="field">{{ f.display_name }}:</dt> <dd class="field-value">' + record[{{ f.field | escape | jsonify }}] + '</dd>'; }
{% endif %}{% endfor %}
fields += '<dt class="field">Lat-Long:</dt> <dd class="field-value">' + record["latlong"] + '</dd></dl>';
document.getElementById("item-metadata").innerHTML = fields;
document.getElementById("item-metadata").innerHTML = fields;*/
document.getElementById("go-to-firetower").href = itemHref;

{% if site.data.theme.browse-buttons == true %}
/* add prev/next nav */
Expand Down Expand Up @@ -234,7 +236,7 @@
});
}

/* add item metadata */
/* add item metadata
var fields = '<dl>';
{% for f in fields %}{% if f.browse_link == "true" %}
if (record[{{ f.field | escape | jsonify }}]) {
Expand All @@ -252,6 +254,8 @@
{% endif %}{% endfor %}
fields += '</dl>';
document.getElementById("item-metadata").innerHTML = fields;
*/
document.getElementById("go-to-firetower").href = itemHref;

{% if site.data.theme.browse-buttons == true %}
/* add prev/next nav */
Expand Down Expand Up @@ -339,7 +343,6 @@
var longitudeHash = hashfilter.split(',')[1]
var map = L.map('map').setView([latitudeHash,longitudeHash],16);
} else if (window.location.href.indexOf("?id") > -1) {
console.log(record.longitude + ", " + record.latitude)
var map = L.map('map').setView([ record.latitude,record.longitude],15);

}
Expand Down
29 changes: 5 additions & 24 deletions _layouts/mapitem.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,30 +64,11 @@ <h2 id="item-title" class="d-none"></h2>
<div class="row mt-3">
<div class="col-md-6 offset-md-3" >
<div class="text-center mb-5">
<button class="btn btn-lg btn-outline-light" type="button" data-toggle="modal" data-target="#metadataModal" aria-expanded="false" aria-controls="metadataModal">
More Item Info
</button>
<a class="btn btn-lg btn-outline-light" role="button" id="go-to-firetower">
Go to Firetower
</a>
</div>
<div class="modal fade" id="metadataModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Item Metadata</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div id="item-metadata" class="metadata">

</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>

</div>
</div>

Expand All @@ -106,7 +87,7 @@ <h5 class="modal-title" id="exampleModalLabel">Item Metadata</h5>

<div class="col-12 mt-4 text-center">

<a class="btn btn-outline-light btn-sm text-white align-self-center " href="#" data-toggle="modal" data-target="#nav-modal">How to Navigate</a>
<a class="d-none btn btn-outline-light btn-sm text-white align-self-center " href="#" data-toggle="modal" data-target="#nav-modal">How to Navigate</a>
</div>

</div>
Expand Down

0 comments on commit 389c602

Please sign in to comment.