diff --git a/public/css/main.css b/public/css/main.css index 435fcd38af209871ac8ed6cb56b89f3aee043467..8aaabda75f1e84a91b61aca86266b9364fedace3 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -178,15 +178,50 @@ a:hover { } .previous { - background-color: #f1f1f1; - color: black; - margin-left:42%; + background-color: #cccccc; + color: #0f0f0f; + + margin-left:40%; + cursor: pointer; + border-radius: .2rem; + border: none; + border: 0px; + width: 6em; + height: 2em; } - +.previous:disabled, +.previous[disabled]{ + cursor: not-allowed; + background-color: #f1f1f1; + color: #666666; +} +.next:disabled, +.next[disabled]{ + background-color: #0069d970; + color: #666666; + cursor: not-allowed; +} +#papercount{ + text-align: center; +} .next { - background-color: #04AA6D; + /* background-color: #2196f3 !important; */ color: white; + cursor: pointer; + border-radius: .2rem; + color: #fff; + border: none; + border: 0px; + background-color: #0069d9; + width: 6em; + height: 2em; + +} +.next:hover{ + background-color: #005bbd !important; + border: none; + border: 0px; } .round { diff --git a/public/index.html b/public/index.html index 7953f03fe353916a656d94423d61493bd6c038f3..e35ea2a99a1f029b62f355e8daa78cbce286fad8 100644 --- a/public/index.html +++ b/public/index.html @@ -265,8 +265,10 @@ </div> </div> - <div class="container" style="margin-top:1em;"><a href="#" class="previous">« Previous</a> - <a href="#" class="next">Next »</a></div> + <div id="nextblock" class="container" style="margin-top:1em;"><p id="papercount">1 - 6 (45)</p> + <button onclick="pagecountback()" id="previousbutton" class="previous" type="button" disabled>« Previous</button> + <!-- <a onclick="pagecountback()" id="previousbutton" class="previous"> Previous</a> --> + <button onclick="pagecount()" id="nextbutton" class="next" type="button">Next »</button></div> <hr> <div class="container"> @@ -422,8 +424,12 @@ <link rel="stylesheet" href="./css/search.css"> <link rel="stylesheet" href="./css/language.css"> <script src="js/search.js"></script> + + <script src="js/paper_nextpage.js"></script> + <script src="js/citationSheetParse.js"></script> + </body> </html> diff --git a/public/js/citationSheetParse.js b/public/js/citationSheetParse.js index 5f73cae84f51bb8448cfd04c8744e28b23dfee35..9f5f21dd1543c3833a521e44835235b7ededc07c 100644 --- a/public/js/citationSheetParse.js +++ b/public/js/citationSheetParse.js @@ -177,7 +177,7 @@ load_excel_citation(function () { var arrayLength = stuff_paper.length; for (var i = 0; i < arrayLength; i++) { - if (Math.abs(arrayLength - i) <= max_paper_list) { + if (i < max_paper_list && i <= arrayLength) { addpaper(stuff_paper[i]); } //Do something diff --git a/public/js/language.js b/public/js/language.js index 52f90c6cd970a568e212f0fdd9de762c6db94ab2..ba6728dbc6a5247fcd5e5c9fea2f8c1e1e3ca29f 100644 --- a/public/js/language.js +++ b/public/js/language.js @@ -34,6 +34,8 @@ function language(lang){ var rgc_ourteam = document.getElementById("rgc_ourteam") var rgc_teamdesc = document.getElementById("rgc_teamdesc") var rgc_backtotop = document.getElementById("rgc_backtotop") + var rgc_button_next = document.getElementById("nextbutton") + var rgc_button_previous = document.getElementById("previousbutton") if (lang == "1"){ rgc_about.innerHTML = "About" rgc_group.innerHTML = "Details about our group to be inserted here... " @@ -43,10 +45,12 @@ function language(lang){ rgc_application.innerHTML = "<i class='fas fa-laptop-code'></i> Our Applications" rgc_applicationdesc.innerHTML = "Research Short Introduction ...." rgc_publication.innerHTML = "<i class='fas fa-book'></i> Our Publication" - rgc_publicationdesc.innerHTML = "Our Publication ..." + // rgc_publicationdesc.innerHTML = "Our Publication ..." rgc_ourteam.innerHTML = "<i class='fas fa-user-friends'></i> Our amazing team" rgc_teamdesc.innerHTML = "Team Description ...." rgc_backtotop.innerHTML = "Back to top" + rgc_button_next.innerHTML = "Next" + rgc_button_previous.innerHTML = "Previous" } else if (lang == "2"){ rgc_about.innerHTML = "About" rgc_group.innerHTML = "Details über unsere Gruppe... " @@ -56,10 +60,12 @@ function language(lang){ rgc_application.innerHTML = "<i class='fas fa-laptop-code'></i> Unsere Anwendungen" rgc_applicationdesc.innerHTML = "Forschung Kurzvorstellung ...." rgc_publication.innerHTML = "<i class='fas fa-book'></i> Unsere Veröffentlichungen" - rgc_publicationdesc.innerHTML = "Unsere Veröffentlichungen ..." + // rgc_publicationdesc.innerHTML = "Unsere Veröffentlichungen ..." rgc_ourteam.innerHTML = "<i class='fas fa-user-friends'></i> Unser Team" rgc_teamdesc.innerHTML = "Team Beschreibung ...." rgc_backtotop.innerHTML = "Zurück an den Anfang" + rgc_button_next.innerHTML = "Weiter" + rgc_button_previous.innerHTML = "Zurück" } } \ No newline at end of file diff --git a/public/js/paper_nextpage.js b/public/js/paper_nextpage.js new file mode 100644 index 0000000000000000000000000000000000000000..1810b70003dc1e8a22c2de47a2c8da3a8bc1f53c --- /dev/null +++ b/public/js/paper_nextpage.js @@ -0,0 +1,60 @@ +var pagenumb = 0 +function pagecount(){ +pagenumb = pagenumb + max_paper_list +nextpage() +} + + +function pagecountback(){ +pagenumb = pagenumb - (max_paper_list) +if (pagenumb <= 0){ + pagenumb = 0 +} +nextpage() +} + + +var nextpage = function() { + // $.getJSON("./content/content.json", function (result) { + // stuff = result; + // var new_row = document.getElementById("row_main") + // new_row.innerHTML = ""; + // var arrayLength = stuff.length; + // for (var i = 0; i < arrayLength; i++) { + // addcontent(stuff[i]); + // //Do something + // } + // }); + document.getElementById("previousbutton").disabled = false; + document.getElementById("nextbutton").disabled = false; + // get paper from the Sabo result + stuff_paper = jsonContent; + var new_row = document.getElementById("cont_paper") + new_row.innerHTML = ""; + var arrayLength = stuff_paper.length; + for (var i = 0; i < arrayLength; i++) { + if (i >= pagenumb && i < (pagenumb + max_paper_list) && i<= arrayLength){ + // if (Math.abs(arrayLength - i) <= (max_paper_list)) { + console.log("close to " + i) + addpaper(stuff_paper[i]); + var startnumb = pagenumb + var endnumb = startnumb + max_paper_list + if (pagenumb <= 0){ + startnumb = 0 + document.getElementById("previousbutton").disabled = true; + } + startnumb += 1 + endnumb += 1 + if (endnumb >= stuff_paper.length){ + endnumb = stuff_paper.length + document.getElementById("nextbutton").disabled = true; + } + document.getElementById("papercount").innerHTML = startnumb + " - " + endnumb + " (" + stuff_paper.length + ")"; + // } + } + + //Do something + } + + //json_to_bib(stuff_paper) +} \ No newline at end of file diff --git a/public/js/search.js b/public/js/search.js index d4b7575c822cf6155ca1dd082ed0fd32d9b7cb64..b8f21fbbc51c5608d528335a9eef47fe2a3f7c4a 100644 --- a/public/js/search.js +++ b/public/js/search.js @@ -36,7 +36,7 @@ function search() { function search_paper() { const fuse = new Fuse(stuff_paper, options_paper); searchanswer_paper = fuse.search(document.getElementById("search-input_paper").value) - + document.getElementById("nextblock").style.display = "none"; var new_row = document.getElementById("cont_paper") new_row.innerHTML = ""; var searchLength = searchanswer_paper.length; @@ -158,7 +158,8 @@ function searchToggle_paper(obj, evt) { new_row.innerHTML = ""; var arrayLength = stuff_paper.length; for (var i = 0; i < arrayLength; i++) { - if (Math.abs(arrayLength - i) <= 2) { + document.getElementById("nextblock").style.display = "block"; + if (i <= max_paper_list) { addpaper(stuff_paper[i]); } diff --git a/readme.md b/readme.md index 2a7fdc68329a982c777b8a0ea65f599a2c44d659..c2bc8699046727ad03912b7af35cd0b22302ee9e 100644 --- a/readme.md +++ b/readme.md @@ -15,9 +15,9 @@ Website for Geoinformatic Research Group (Prof. Coors) ## Meeting Note 27-04-2021 ### Tasks for Patrick: -- [ ] In the current "add_paper.js", all BIBTEX buttons share the same ID and not work yet. I will hide this feature for now and add it back when the BIBTEX is read made. -- [ ] Currently, I have set in the public/js/config.js the max number of the paper lists. We have to implement the "show more"/ "Pagination" feature. -- [ ] Make sure the Search feature works. +- [ ] In the current "add_paper.js", all BIBTEX buttons share the same ID and not work yet. I will hide this feature for now and add it back when the BIBTEX is read made. (for later) +- [x] Currently, I have set in the public/js/config.js the max number of the paper lists. We have to implement the "show more"/ "Pagination" feature. (Patrick) +- [x] Make sure the Search feature works. (Patrick) - [ ] Currently, the "public\js\language.js" only translate some part of the webpage.(later..) ### Tasks for Joe: @@ -33,4 +33,5 @@ Website for Geoinformatic Research Group (Prof. Coors) - [x] Citation Sheet to BIBTEX. [public/js/parse_json_to_bib.js](public/js/parse_json_to_bib.js) ## Issue -- [ ] The GitLab Page does not load the image under the img folder correctly e.g. https://ugl.hft-stuttgart.de/img/Schneider_2018_02.jpg which is stored at https://transfer.hft-stuttgart.de/gitlab/ugl/website/-/tree/master/public/img \ No newline at end of file +- [x] The GitLab Page does not load the image under the img folder correctly e.g. https://ugl.hft-stuttgart.de/img/Schneider_2018_02.jpg which is stored at as Schneider_2018_02.JPG (Fixed by saving as either .jpg or .JPG everywhere) [03-05-2021] +- [ ] The flag still does not work yet. May be we can use this feature: https://mojoaxel.github.io/bootstrap-select-country/index.html (To be observed)