Skip to content

Commit

Permalink
add hidden abstract to publication main site (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult authored Jan 24, 2024
1 parent 3fc7555 commit 7d592d5
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion pubs/templates/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,32 @@ <h2>Selected Publications:</h2>
</span>
</div>
{% if pub.get('abstract', '') %}
<div class="abstract_div">Abstract: <div class="abstract">{{ pub['abstract'] }}</div></div>
<div class="abstract_div">Abstract:
<button>Show</button>
<div class="abstract">{{ pub['abstract'] }}</div>
</div>
{% end %}
</article>
{% end %}
</div>
{% end %}

{% block scripts %}
<script src="https://code.jquery.com/jquery-3.7.1.slim.min.js" integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8=" crossorigin="anonymous"></script>
<script>
$( document ).ready(function() {
$(".abstract_div").each(function(i){
let ab = $(this).find('.abstract');
ab.hide();
$(this).find('button').on('click', function(){
ab.toggle();
if ($(this).text() == 'Show') {
$(this).text('Hide');
} else {
$(this).text('Show');
}
});
});
});
</script>
{% end %}

0 comments on commit 7d592d5

Please sign in to comment.