Skip to content

Commit

Permalink
Updating file's structure and implementing information banner Hyperto…
Browse files Browse the repository at this point in the history
  • Loading branch information
hafid-d committed Jun 15, 2017
1 parent 745bcaf commit e357b29
Show file tree
Hide file tree
Showing 64 changed files with 234 additions and 99 deletions.
Binary file removed .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.couchapprc

npm-debug.log
.DS_Store
7 changes: 7 additions & 0 deletions couchdb/.couchappignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
// filenames matching these regexps will not be pushed to the database
// uncomment to activate; separate entries with ","
// ".*~$"
// ".*\\.swp$"
// ".*\\.bak$"
]
1 change: 1 addition & 0 deletions couchdb/.couchapprc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 51 additions & 1 deletion _attachments/main.css → couchdb/_attachments/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ body {
}

.menu {
position: fixed;
width: 100%;
background-color: black;
padding: 2px 8px;
Expand Down Expand Up @@ -104,3 +103,54 @@ body {
.sorted {
font-weight: bold
}

/* Styles you want to copy across begin here */

.slider {
font-family: 'Georgia', serif;
background-color: #f5f5f5;
overflow: hidden;
width: 100%;
}

.slider ul {
list-style: none;
position: relative;
display: flex;
align-items: center;
overflow: hidden;
padding: 0;
}

.slider ul li {
display: inline-block;
padding: 1rem;
position: relative;
text-align: center;
width: 100vw;
}

.slider ul li p {
max-width: 600px;
margin: 1rem auto;
width: 50%;
}

.slider-control {
background-color: rgba(255,255,255,0.2);
display: flex;
justify-content: center;
}

.slider-control i {
cursor: pointer;
padding: 1.3rem;
}

#navigation_arrows {
text-align: center;
}

.slider {
border: 1px solid black;
}
File renamed without changes.
File renamed without changes.
10 changes: 9 additions & 1 deletion i18n.json → couchdb/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@
"i_modify": "Modifier",
"i_done": "Terminé",
"i_record": "Notice",
"i_records": "Publications"
"i_records": "Publications",
"i_question_export": "Comment importer une notice au format BibTex ?",
"i_answer_export": "Lorsque vous consultez votre publication sur le site SCOPUS : cliquez sur 'Export', cochez le format 'BibTex', les cases 'Bibliographical information' et 'Publisher' et décochez 'Abstract'. Une fois exportée, utilisez un éditeur de texte (ex: Notepad) et copiez les informations présentes à partir de la ligne 3. Enfin, lors de la création d'une notice, cliquez sur le bouton 'Importer' et collez les informations au format BibTex.",
"i_question_doublons": "Comment vérifier la présence de doublons dans les notices ?",
"i_answer_doublons": "Sur la page d'accueil, cliquez sur le bouton 'Vérifier les titres'.",
"i_question_import": "Comment exporter une notice au format BibTex ?",
"i_answer_import": "Lorsque vous consultez une notice, cliquez sur le bouton 'Exporter' situé en bas de page.",
"i_question_rights": "Comment peut-on vérifier le respect des droits de diffusion de l'éditeur ?",
"i_answer_rights": "Lors de la consultation ou de l'édition d'une notice, le bouton 'Consulter les droits de cet éditeur' vous permet de vérifier cela directement à partir du site SHERPA/RoMEO."
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
162 changes: 162 additions & 0 deletions couchdb/templates/activity_html.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<html>
{{#i18n}}
<head>
<link rel="stylesheet" type="text/css" href="included/main.css" />
<link rel="stylesheet" type="text/css" href="included/lib/chosen.css" />
<script src="script/jquery.js"></script>
<title>{{#query.by}}{{query.by}} — {{/query.by}}{{i_records}}</title>
</head>
<body>
<div id="container">
{{>filter_form}}
<section class="slider">
<ul id="slider-ul">
<li>
<p><b>{{ i_question_export }}</b></p>
<small><i>{{ i_answer_export }}</i></small>
</li>
<li>
<p><b>{{ i_question_doublons }}</b></p>
<small><i>{{ i_answer_doublons }}</i></small>
</li>
<li>
<p><b>{{ i_question_import }}</b></p>
<small><i>{{ i_answer_import }}</i></small>
</li>
<li>
<p><b>{{ i_question_rights }}</b></p>
<small><i>{{ i_answer_rights }}</i></small>
</li>
</ul>
<div id="navigation_arrows">
<a id="slider-l"><b><</b></a>
<a id="slider-r"><b>></b></a>
</div>
</section>
<div id="content">
{{#types}}
<h1>{{label}}</h1>
<ol>
{{#papers}}
<li>
<div>{{#creators}}{{.}}, {{/creators}}</div>
{{^ispartof}}
<div><a href="{{_id}}"><i>{{title}}.</i></a></div>
{{/ispartof}}
{{#ispartof}}
<div><a href="{{_id}}">{{title}}.</a></div>
<div><i>{{ispartof}}{{#volume}}
<b>{{volume}}{{#issue}}({{issue}}){{/issue}}</b>{{/volume}}</i>{{#spage}},
{{spage}}{{#epage}}–{{epage}}{{/epage}}{{/spage}}.
</div>
{{/ispartof}}
<div>{{#publisher}}{{publisher}}, {{/publisher}}{{issued}}.</div>
<div>
{{#indexed}}<img height="20" src="included/{{.}}.png" title="{{i_referenced}} {{.}}" />{{/indexed}}
</div>
</li>
{{/papers}}
</ol>
{{/types}}
</div>
<form id="footer" class="menu">
<button type="button" id="create">{{i_create}}</button>
<button type="button" id="export">{{i_export}}</button>
<button type="button" id="count">{{i_count}}</button>
<button type="button" id="check_creators">{{i_check_creators}}</button>
<button type="button" id="check_titles">{{i_check_titles}}</button>
</form>
</div>
</body>
{{/i18n}}
<script type="text/javascript">

$('#create').on('click', function() {
$.ajax({
url: ".",
type: "POST",
dataType: "json",
contentType: "application/json",
data: "{}",
success: function(data) {location.replace(data.id+"?form")}
});
});

$('#export').on('click', function() {
self.location = "?bibtex&by={{{query.by}}}&since={{{query.since}}}";
});

$('#count').on('click', function() {
self.location = "dashboard?by={{{query.by}}}&since={{{query.since}}}";
});

$('#check_creators').on('click', function() {
self.location = "authors?by={{{query.by}}}";
});

$('#check_titles').on('click', function() {
self.location = "titles?by={{{query.by}}}";
});


// Handling slider with information text
var sliderLeftButton = $("#slider-l");
var sliderRightButton = $("#slider-r");

// Get number of <li> elements in the si
var sliderItemCount = document.getElementById('slider-ul').querySelectorAll('li').length;

// Set length based on the itemCount
var sliderWidth = sliderItemCount * 100 + "vw";
$(".slider ul").css("width", sliderWidth);

var sliderPosition = 0;

// Handling right and left button event
sliderRightButton.click(function() {
if (sliderPosition < (sliderItemCount - 1)) {
sliderPosition++;
var m = "-" + (100 * sliderPosition) + "vw";
$(".slider ul").animate({
"left": m
}, 500);
greyButton();
}
});

sliderLeftButton.click(function() {
if (sliderPosition > 0) {
sliderPosition--;
var m = "-" + (100 * sliderPosition) + "vw";
$(".slider ul").animate({
"left": m
}, 500);
greyButton();
}
});

// This function aims to update arrow's color (depends if this is the first or last information of the slider)
var greyButton = function() {
if (sliderPosition == 0) {
sliderLeftButton.css("opacity", "0.3");
sliderLeftButton.css("cursor", "default");
} else if (sliderPosition == (sliderItemCount - 1)) {
sliderRightButton.css("opacity", "0.3");
sliderRightButton.css("cursor", "default");
} else {
sliderRightButton.css("opacity", "1");
sliderRightButton.css("cursor", "pointer");
sliderLeftButton.css("opacity", "1");
sliderLeftButton.css("cursor", "pointer");
}
}

greyButton();

// If there is one information, we don't display arrows
if ( sliderItemCount == 1 ) {
$('.slider-control').css('display','none');
}

</script>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 0 additions & 19 deletions npm-debug.log

This file was deleted.

78 changes: 0 additions & 78 deletions templates/activity_html.html

This file was deleted.

0 comments on commit e357b29

Please sign in to comment.