-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.html
164 lines (153 loc) · 5.96 KB
/
template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<style>
#tutorial-btn {
margin-bottom: 20px;
}
@media (min-width: 1200px) {
#image-container {
width: calc(1170px/2);
}
}
@media (min-width: 992px) and (max-width: 1199px) {
#image-container {
width: calc(970px/2);
}
}
@media (min-width: 768px) and (max-width: 991px) {
#image-container {
width: calc(750px/2);
}
}
@media (min-width: 768px) {
#image-container {
position: fixed;
left: inherit;
padding-left: inherit;
padding-right: inherit;
}
#tutorial-btn {
float: right;
margin-top: 30px;
}
}
</style>
<!-- Image -->
<div class="row skeleton margin-top-lg">
<div class="col-xs-12 col-sm-6 col-sm-push-6">
<div id="image-container">
<a href="#" id="photo-link"><img alt="Loading" id="photo" src="https://i.imgur.com/GeHxzb7.png"></a>
</div>
</div>
<!-- Question and Answer -->
<div class="col-xs-12 col-sm-6 col-sm-pull-6">
<div class="row">
<div class="col-xs-12 col-sm-8">
<h1 id="question">What is this item?</h1>
</div>
<div class="col-xs-12 col-sm-4">
<a href="../tutorial" id="tutorial-btn" class="btn btn-inverse"><span class="fa fa-book"></span> Tutorial</a>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<form id="transcription-form" role="form">
<div class="form-group">
<label for="title">Title/s:</label>
<span rel="popover" data-content="Copy the play's title, with any accents, including any articles such as 'the' at the front. *see the tutorial page to find out how to add accents." class="fa fa-question-circle question-popover"></span>
<input type="text" id="title" class="form-control" placeholder="Copy the play's title, with any accents, including any articles such as 'the' at the front." autofocus>
</div>
<div class="form-group">
<label for="author">Author/s:</label>
<span rel="popover" data-content="Copy the authors as shown, separating any multiple authors with a semi colon." class="fa fa-question-circle question-popover"></span>
<input type="text" id="author" class="form-control" placeholder="Copy the authors as shown, separating any multiple authors with a semi colon.">
</div>
<div class="form-group">
<label for="date">Date:</label>
<span rel="popover" data-content="Copy the date as shown (e.g. '6 May 2016')." class="fa fa-question-circle question-popover"></span>
<input type="text" id="date" class="form-control" placeholder="Copy the date as shown (e.g. '6 May 2016').">
</div>
<div class="form-group">
<label for="reference">Reference Number:</label>
<span rel="popover" data-content="A five digit number, followed by folio numbers or a capital letter (examples: '47300 ff. 941-961' or '43800 B')." class="fa fa-question-circle question-popover"></span>
<input type="text" id="reference" class="form-control" placeholder="A five digit number, followed by folio numbers or a capital letter.">
</div>
<div class="form-group">
<label for="former_reference">License Number and/or Year and Volume:</label>
<span rel="popover" data-content="Examples: 'License number 43' and/or '1915/42'." class="fa fa-question-circle question-popover">
</span>
<input type="text" class="form-control" id="former_reference" placeholder="'License number 43' and/or '1915/42'.">
</div>
<div class="form-group">
<label for="other_information">Other Information:</label>
<span rel="popover" data-content="Transcribe any/all other information here." class="fa fa-question-circle question-popover">
</span>
<input type="text" class="form-control" id="other_information" placeholder="Transcribe any/all other information here.">
</div>
<hr>
<div class="text-right" role="group">
<button class="btn btn-success btn-answer" value="Done"><span class="fa fa-thumbs-o-up"></span> Done</button>
</div>
</form>
<!-- Feedback items for the user -->
<div class="text-center">
<p>You are working on task: <span class="label label-default" id="task-id">#</span></p>
</div>
</div>
</div>
</div>
</div>
<script>
/** Load the task. */
pybossa.taskLoaded(function(task, deferred) {
if (!$.isEmptyObject(task)) {
var img = $('<img />');
img.load(function() {
deferred.resolve(task);
});
img.attr('src', task.info.url_b + "?now=" + new Date().getTime());
img.addClass('img-thumbnail img-responsive');
task.info.image = img;
} else {
deferred.resolve(task);
}
});
/** Add Latin character map to title and author. */
$(document).ready(function() {
$('#transcription-form #title').specialedit('latin');
$('#transcription-form #author').specialedit('latin');
});
/** Present the task. */
pybossa.presentTask(function(task, deferred) {
if (!$.isEmptyObject(task)) {
$('#photo-link').html('').append(task.info.image);
$("#photo-link").attr("href", task.info.link);
$('#task-id').html(task.id);
$('#transcription-form').trigger("reset");
$('html, body').animate({scrollTop:0});
$('.btn-answer').off('click').on('click', function(evt) {
evt.preventDefault();
if (typeof $(this).attr("value") != 'undefined') {
task.answer = {
'title': $("#title").val(),
'author': $('#author').val(),
'date': $('#date').val(),
'reference': $('#reference').val(),
'former_reference': $('#former_reference').val(),
'other_information': $('#other_information').val()
}
pybossa.saveTask(task.id, task.answer).done(function() {
deferred.resolve();
pybossaNotify('Answer saved!', 'success', true);
}).fail(function(xhr, status, error) {
pybossaLogError(new Error(error));
});
} else {
pybossaNotify('Error: Answer undefined', 'danger');
}
});
} else {
$(".skeleton").hide();
pybossaNotify('Congratulations! You have participated in all available tasks!', 'success');
}
});
pybossa.run('lord_chamberlins_plays');
</script>