newPages.pug 7.18 KB
Newer Older
Rosanny Sihombing's avatar
Rosanny Sihombing committed
1
2
3
4
5
6
doctype html
html(lang="de")
  head
    title= "Setup a new website"
    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")
Rosanny Sihombing's avatar
Rosanny Sihombing committed
9
10
11
12
13
14
15
16
17
18
    link(rel="stylesheet", href="https://use.fontawesome.com/releases/v5.8.2/css/all.css", integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay", crossorigin="anonymous")
  body
    div(class="container")
        div(class="row min-vh-100 flex-column flex-md-row")
            aside(class="col-12 col-md-3 p-0 flex-shrink-1")
                nav(class="navbar navbar-expand flex-md-column flex-row align-items-start py-2")
                    div(class="collapse navbar-collapse")
                        ul(class="flex-md-column flex-row navbar-nav w-100 justify-content-between")
                            li(class="nav-item")
                                a(class="nav-link pl-0 text-nowrap" href="/account/")
Rosanny Sihombing's avatar
Rosanny Sihombing committed
19
                                    span(class="font-weight-bold" style="color:black;") #{user.firstName} #{user.lastName}
Rosanny Sihombing's avatar
Rosanny Sihombing committed
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
                            li(class="nav-item")
                                a(class="nav-link pl-0" href="/account/profile")
                                    i(class="fa fa-user fa-fw")
                                    span(class="d-none d-md-inline") Benutzerprofil
                            if user.m4lab_idp == 1
                                li(class="nav-item")
                                    a(class="nav-link pl-0" href="/account/security")
                                        i(class="fa fa-lock fa-fw")
                                        span(class="d-none d-md-inline") Sicherheitseinstellungen
                            li(class="nav-item")
                                a(class="nav-link pl-0" href="/account/services")
                                    i(class="fa fa-tasks fa-fw" style="color:black;")
                                    span(class="d-none d-md-inline" style="color:black;") Projekte und Dienste
                            li(class="nav-item")
                                a(class="nav-link pl-0" href="/logout" style="color:red;")
                                    i(class="fa fa-sign-out-alt fa-fw")
                                    span(class="d-none d-md-inline") Logout
            main(class="col bg-faded py-3 flex-grow-1")
                if successes
                    for success in successes
                        div.alert.alert-success.alert-dismissible #{ success }
                            a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
                if errors
                    for error, i in errors
                        div.alert.alert-danger.alert-dismissible.fade.show #{ error }
                            a(class="close", href="#", data-dismiss="alert", aria-label="close") ×
                h3(class="pb-2") New Website
                div(class="mx-4")
                    h4(class="pb-1") Step 1: Setup
                    p Please fill-in all fields
                    form(method="POST", encType="multipart/form-data")
                        div(class='form-group row')
Rosanny Sihombing's avatar
Rosanny Sihombing committed
52
53
54
                            label(for="name", class="col-sm-2") Name
                            div(class="col-sm-8")
                                input#name(name="name", type="text", class="form-control", value=project.name, placeholder="Name", maxlength="75" required)
Rosanny Sihombing's avatar
Rosanny Sihombing committed
55
56
                                | <p id="nameInfo" class="font-italic font-weight-light"><small>your website will be published on this URL: <strong>https://transfer.hft-stuttgart.de/pages/<span id="websiteName"></span></strong></small></p>
                        div(class="form-group row")
Rosanny Sihombing's avatar
Rosanny Sihombing committed
57
58
59
                            label(for="description", class="col-sm-2") Description
                            div(class="col-sm-8")
                                textarea#description(name="description", type="text", class="form-control", placeholder="Description", maxlength="500" required) #{project.description}
Rosanny Sihombing's avatar
Rosanny Sihombing committed
60
                        div(class="form-group row")    
Rosanny Sihombing's avatar
Rosanny Sihombing committed
61
62
63
                            label(for="logo", class="col-sm-2") Logo
                            div(class="col-sm-8")
                                input#logo(name="logo", class="form-control-file", value=project.avatar, type="file" required)
Rosanny Sihombing's avatar
Rosanny Sihombing committed
64
65
                        input(type="submit", class="btn btn-primary", value="Set")
                hr
Rosanny Sihombing's avatar
Rosanny Sihombing committed
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
                if project.webUrl
                    div#step2(class="mx-4")
                        h4(class="pb-1") Step 2: Complete
                        //p Your website has been created, but not yet published. Please make sure you have completed the following before you publish your website.
                        p Please make sure you have completed the following before you publish your website.
                        ul
                            li project name, link, logo: setting.js
                            li contact person: kontakt.html
                else
                    div#step2(class="mx-4", style="color: gray;")
                        h4(class="pb-1") Step 2: Complete
                        //p Your website has been created, but not yet published. Please make sure you have completed the following before you publish your website.
                        p Please make sure you have completed the following before you publish your website.
                        ul
                            li project name, link, logo: setting.js
                            li contact person: kontakt.html
Rosanny Sihombing's avatar
Rosanny Sihombing committed
82
                hr
Rosanny Sihombing's avatar
Rosanny Sihombing committed
83
84
85
86
87
88
89
90
91
92
                if project.webUrl
                    div#step3(class="mx-4")
                        h4(class="pb-1") Step 3: Publish
                        p bla bla bla
                        input(type="submit", class="btn btn-primary", value="Publish")
                else
                    div#step3(class="mx-4", style="color: gray;")
                        h4(class="pb-1") Step 3: Publish
                        p bla bla bla
                        input(type="submit", class="btn btn-primary", value="Publish" disabled)
Rosanny Sihombing's avatar
Rosanny Sihombing committed
93
94
95
96
97
98
99

    // 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")
    // M4_LAB
Rosanny Sihombing's avatar
Rosanny Sihombing committed
100
    script(src="/js/headfoot.js")
Rosanny Sihombing's avatar
Rosanny Sihombing committed
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
    script.
        function showWebsiteURL() {
            if ($("#name").val()) {
                $("#nameInfo").show();
                let webName = $("#name").val().toLowerCase().replace(/\s/g, '-');
                document.getElementById("websiteName").innerText = webName;
            }
            else {
                $("#nameInfo").hide();
            }
        }
        $('#name').on('input',function(e){
            showWebsiteURL();
        })
        showWebsiteURL();