Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
Project Page
Commits
48b1b7aa
Commit
48b1b7aa
authored
Sep 04, 2020
by
Rosanny Sihombing
Browse files
add project counter
parent
61fa3ef4
Changes
1
Hide whitespace changes
Inline
Side-by-side
views/DE/project/projectList.pug
View file @
48b1b7aa
...
...
@@ -33,6 +33,7 @@ html(lang="de")
h3(class="mb-3 font-weight-bold") Projekte
div(class="container")
p#projectCounter #{project.length} Projekte werden angezeigt
| <div class="row">
for item in project
div(class="py-4 col-sm")
...
...
@@ -66,23 +67,27 @@ html(lang="de")
var input = document.getElementById("searchInput")
var filter = input.value.toUpperCase()
var cards = document.getElementsByClassName("col-sm")
var cards
Col
= document.getElementsByClassName("col-sm")
var cardTitle, cardText, titleValue, textValue
var i
for (i = 0; i < cards.length; i++) {
cardTitle = cards[i].getElementsByClassName("card-title-bottom-left");
cardBody = cards[i].getElementsByClassName("card-body");
cardText = cards[i].getElementsByClassName("card-text");
var counterBlock = 0
for (i = 0; i < cardsCol.length; i++) {
cardTitle = cardsCol[i].getElementsByClassName("card-title-bottom-left");
cardBody = cardsCol[i].getElementsByClassName("card-body");
cardText = cardsCol[i].getElementsByClassName("card-text");
titleValue = cardTitle[0].textContent || cardTitle[0].innerText;
bodyValue = cardBody[0].textContent || cardBody[0].innerText;
textValue = cardText[0].textContent || cardText[0].innerText;
if (titleValue.toUpperCase().indexOf(filter) > -1 || bodyValue.toUpperCase().indexOf(filter) > -1 || textValue.toUpperCase().indexOf(filter) > -1) {
cards[i].style.display = "block";
cardsCol[i].style.display = "block"
counterBlock++
} else {
cards[i].style.display = "none"
;
cards
Col
[i].style.display = "none"
}
}
document.getElementById("projectCounter").innerHTML = counterBlock+" Projekte werden angezeigt"
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment