Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add bootstrap tour to explain how to use FAIRshake #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions FAIRshakeHub/static/scripts/tour.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
var tour = new Tour({
name: "FAIRshake Tour",
debug: true,
backdrop: true,
steps: [
{
path: '/',
element: "#search",
title: "Searching FAIRshake",
content: "FAIRshake lets you search everything from the home page, let's try searching for flybase!",
onNext: function() {
document.location.href = '/?q=flybase';
return (new $.Deferred()).promise();
},
},
{
// path: '/?q=flybase',
element: ".panel:first",
title: "Search results",
content: "FAIRshake presents the results as cards for each element in the database",
},
{
// path: '/?q=flybase',
element: ".panel:first .image-link img",
title: "Image",
content: "The image is registered by users for quickly identifying objects",
},
{
// path: '/?q=flybase',
element: ".panel:first .caption",
title: "Description",
content: "A short title and description is provided to further identify the object.",
},
{
// path: '/?q=flybase',
element: ".panel:first .label",
title: "Object Type",
content: "The type of Digital Object is identified.",
},
{
// path: '/?q=flybase',
element: ".panel:first .insignia",
title: "Insignia",
content: "The FAIRshake Insignia is displayed illustrating how FAIR the object is, red boxes indicate metrics which could not be asserted, while blue boxes indicate those which could.",
},
],
});
3 changes: 3 additions & 0 deletions FAIRshakeHub/static/style/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,6 @@ h1 {
color: dimgray;
}

.tour-backdrop {
opacity: .2;
}
3 changes: 3 additions & 0 deletions FAIRshakeHub/templates/fairshake/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{% block head %}
<link rel="shortcut icon" href="{% static 'image/favicon.ico' %}">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.11.0/css/bootstrap-tour.min.css" />
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">

<title>{% block title %}{% endblock %}</title>
Expand Down Expand Up @@ -136,6 +137,8 @@
{% block script %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-tour/0.11.0/js/bootstrap-tour.min.js"></script>
<script src='{% static "scripts/tour.js" %}'></script>
<script>
function render_insignia(q) {
if (q === undefined)
Expand Down
24 changes: 12 additions & 12 deletions FAIRshakeHub/templates/fairshake/generic/element.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
></div>
{% endif %}
</div>
{% if item.type %}
<span
class="label"
style="background-color:#666666;color:white;font-size:10px;position:absolute;top:164px;right:25px;"
>
{% if model == "project" %}
project
{% else %}
{{ item.type }}
{% endif %}
</span>
{% endif %}
<div class="caption text-left">
<p class="item-title" style="margin-right:60px;">
{{ item.title|limit:45 }}
</p>
{% if item.type %}
<span
class="label"
style="background-color:#666666;color:white;font-size:10px;position:absolute;top:164px;right:25px;"
>
{% if model == "project" %}
project
{% else %}
{{ item.type }}
{% endif %}
</span>
{% endif %}
<p>{{ item.description|limit:100 }}</p>
<div style="position:absolute;bottom:30px;margin-right:60px;">
<div style="font-size:10px;color:gray;margin-top:5px;">
Expand Down
1 change: 1 addition & 0 deletions FAIRshakeHub/templates/fairshake/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ <h4>A System to Evaluate Digital Objects</h4>
style="display: flex; flex-direction:row"
>
<input
id="search"
aria-label="Search"
autofocus
class="form-control"
Expand Down