pagesList.pug 6.17 KB
Newer Older
1
2
3
4
5
6
doctype html
html(lang="de")
  head
    title= "Projektinformationen"
    meta(charset="UTF-8")
    meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no")
Rosanny Sihombing's avatar
Rosanny Sihombing committed
7
8
    link(rel="stylesheet", type="text/css", href="/css/bootstrap.min.css")
    link(rel="stylesheet", type="text/css", href="/css/m4lab.css")
9
10
11
12
13
14
15
16
17
18
19
20
    link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
    style.
        .title-container {
            position: relative;
            color: white;
        }
        .card-title-bottom-left {
            position: absolute;
            bottom: 0px;
            width: 100%;
            color: black;
            font-weight: bold;
Athanasios's avatar
Athanasios committed
21
            background: rgb(255, 255, 255, 0.9);
22
23
24
25
26
27
28
29
            text-align: left;
            padding: 5px
        }
        .card-img-top {
            height: 15vw;
            object-fit: cover;
        }
  body
30
    div(class="container")
31
32
33
        div(class="row")
            div(class="col-md-12 margin_bottom_40")
                img(class="mx-auto" src="/img/Projektinformationen.png" width="100%")
34
    div(class="container")
Wolfgang Knopki's avatar
Wolfgang Knopki committed
35
36
        p Hier finden Sie Informationen zu den bei uns gehosteten Projekten, wie z.B. Projektbeschreibungen, Projektwebseiten, Visualisierungen, Demonstrationen.
        p Für eine Übersicht über den bei uns gehosteten Projektcode und andere Projektdaten klicken Sie <a href="/projektdaten"> hier </a>.
Athanasios's avatar
Athanasios committed
37
        p Wenn Sie zu einem Projekt beitragen möchten, oder eines erstellen möchten, finden Sie weitere Informationen <a href="/help/gitlab.html">hier</a>.
38
39
40

        div(class="container")
            p#pagesCounter #{pages.length} Projektinformationen werden angezeigt
41
            div(class="pt-4 pb-4 form-row")
Rosanny Sihombing's avatar
Rosanny Sihombing committed
42
                div(class="form-group col-md-10")
43
                    input(id="searchInput", class="form-control form-control-lg", type="text", placeholder="Suchen Sie hier nach Themen und Projekten", onkeyup="searchFunction()")
Rosanny Sihombing's avatar
Rosanny Sihombing committed
44
45
46
                div(class="form-group col-md-2")
                    select#sortingSelect(class="form-control form-control-lg")
                        option(value="" disabled) Sort by
Rosanny Sihombing's avatar
Rosanny Sihombing committed
47
48
49
                        option(value="name") &nbsp; Name
                        option(value="created_at") &nbsp; Last created
                        option(value="updated_at") &nbsp; Last updated
50
51
            | <div class="row">
            for item in pages
52
                div(class="card-deck py-4 col-sm")
53
                    div(class="card width_18" style="transform: rotate(0);")
54
55
56
57
58
59
60
61
62
63
64
65
                        div(class="title-container")
                            h5(class="card-title-bottom-left") #{item.name}
                            img(class="card-img-top", src=item.logo)
                        div(class="card-body")
                            div(class="row")
                                each key in item.keywords
                                    h6
                                        span(class="badge badge-pill badge-primary px-2") #{key}
                                        | &nbsp;
                            div(class="row")
                                div(class="col-9")
                                    p(class="card-text") #{item.desc}
66
                                a(href=item.weburl, class="no_text_decoration stretched-link", target="_blank")
67
68
69
70
71
72
73
74
            | </div>

    // jQuery
    script(src="https://code.jquery.com/jquery-3.3.1.min.js")
    script(src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js", integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1", crossorigin="anonymous")
    // Bootstrap
    script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous")
    // Header
75
    script(src="/js/headfoot.js")
76
77
    // General functions
    script(src="/js/generalFunction.js")
78
79
80
81
82
83
    script.
        function searchFunction() {
            var input = document.getElementById("searchInput")
            var filter = input.value.toUpperCase()
            
            var cardsCol = document.getElementsByClassName("col-sm")
Athanasios's avatar
Athanasios committed
84
            var cardTitle, cardBadges, cardText, titleValue, badgesValue, textValue, allValues;
85
86
87
88
89
            
            var i
            var counterBlock = 0
            for (i = 0; i < cardsCol.length; i++) {
                cardTitle = cardsCol[i].getElementsByClassName("card-title-bottom-left");
Athanasios's avatar
Athanasios committed
90
91
                //cardBody = cardsCol[i].getElementsByClassName("card-body");
                cardBadges = [...cardsCol[i].getElementsByClassName("badge-pill")];
92
93
94
                cardText = cardsCol[i].getElementsByClassName("card-text");
                
                titleValue = cardTitle[0].textContent || cardTitle[0].innerText;
Athanasios's avatar
Athanasios committed
95
96
                badgesValue = cardBadges.map(b => b.textContent).join(" ");
                //bodyValue = cardBody[0].textContent || cardBody[0].innerText;
97
                textValue = cardText[0].textContent || cardText[0].innerText;
Athanasios's avatar
Athanasios committed
98
99
                allValues = [titleValue, badgesValue, textValue].map(v => v.toUpperCase()).join(" ");
                if (allValues.indexOf(filter)!= -1) {
100
101
102
103
104
105
106
107
                    cardsCol[i].style.display = "block"
                    counterBlock++
                } else {
                    cardsCol[i].style.display = "none"
                }
            }

            document.getElementById("pagesCounter").innerHTML = counterBlock+" Projektinformationen werden angezeigt"
Rosanny Sihombing's avatar
Rosanny Sihombing committed
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
        }

        $("#sortingSelect").change(function() {
            window.location.replace('/projektinformationen?sort='+$("#sortingSelect").val())
        });
        function setSortSelect() {
            let sortKeyword = getQueryStringParams('sort', window.location.href)
            if (sortKeyword == "created_at") {
                $("#sortingSelect").val("created_at")
            } else if(sortKeyword == "updated_at") {
                $("#sortingSelect").val("updated_at")
            } else {
                $("#sortingSelect").val("name")
            }
        }
        setSortSelect()