~evanj/cms

ref: 8efa6eb4fd1aad49d40bb3850530c531add998da cms/internal/s/tmpl/html/space.html -rw-r--r-- 11.2 KiB
8efa6eb4Evan M Jones WIP(stripe): *. 1 year, 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!DOCTYPE html>
<html lang=en>
<head>
  {{ template "html/_head.html" }}
  <title>CMS | {{ .Space.Name }}</title>
</head>
<body class='space bg-light'>
  <style>{{ template "css/main.css" }}</style>
  <main>
    {{ template "html/_header.html" $ }}
    <div class="pricing-header px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center">
      <h1 class="display-4">{{.Space.Name}}</h1>
      <p class="lead">{{.Space.Desc}}</p>
    </div>
    <article>
      <form method=POST action='/contenttype' enctype='multipart/form-data'>
        <input type=hidden name=method value=POST />
        <input required type=hidden name=space value="{{ .Space.ID }}" />
        <div class="modal fade" id="create-contenttype" tabindex="-1" role="dialog" aria-labelledby="Create a new content type modal." aria-hidden="true">
          <div class="modal-dialog modal-dialog-scrollable">
            <div class="modal-content">
              <div class="modal-header">
                <h5 class="modal-title" id="contenttypeModalLabel">Create a new content type</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
              </div>
              <div class="modal-body">
                <label for="contenttypeName">Name</label>
                <input name=name type=text id="contenttypeName" class="mb-3 form-control" placeholder="Name" required>
                <div id='first-fieldset' class='container-fluid px-0 mb-3'>
                  <label for="fieldsetFirst">Fields</label>
                  <input id="fieldsetFirst" class="mb-3 form-control" readonly="readonly" required type=text name="field_name_1" value="name" />
                  <div class='form-group row'>
                    <div class='col-6'>
                      <select class="w-100 form-control" readonly="readonly" required name="field_type_1">
                        <option disabled value>Field Type</option>
                        <option selected value="StringSmall">String Small</option>
                        <option disabled value="StringBig">String Big</option>
                        <option disabled value="InputHTML">HTML</option>
                        <option disabled value="InputMarkdown">Markdown</option>
                        <option disabled value="File">File</option>
                        <option disabled value="Date">Date</option>
                        <option disabled value="Reference">Reference</option>
                        <option disabled value="ReferenceList">ReferenceList</option>
                      </select>
                    </div>
                    <div class='col-6'>
                      <button class='w-100 btn btn-primary' disabled type=button>Remove Field</button>
                    </div>
                  </div>
                </div>
                <a href='#' class='btn btn-link' id='add-fieldbtn'>Add Another Field</a>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="submit" class="btn btn-primary">Go</button>
              </div>
            </div>
          </div>
        </div>
      </form>

      <form method=POST action='/hook' enctype='multipart/form-data'>
        <input type=hidden name=method value=POST />
        <input required type=hidden name=space value="{{ .Space.ID }}" />
        <div class="modal fade" id="hookModal" tabindex="-1" role="dialog" aria-labelledby="hookModalLabel" aria-hidden="true">
          <div class="modal-dialog modal-dialog-scrollable">
            <div class="modal-content">
              <div class="modal-header">
                <h5 class="modal-title" id="hookModalLabel">Create a new hook</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
              </div>
              <div class="modal-body">
                <label for="hookURL">URL</label>
                <input name=url type=url id="hookURL" class="mb-3 form-control" placeholder="Must enter full URL of target" required>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="submit" class="btn btn-primary">Go</button>
              </div>
            </div>
          </div>
        </div>
      </form>

      <form method=POST action='/space' enctype='multipart/form-data'>
        <input type=hidden name=method value=PUT />
        <input required type=hidden name=space value="{{ .Space.ID }}" />
        <div class="modal fade" id="copyModal" tabindex="-1" role="dialog" aria-labelledby="copyModalLabel" aria-hidden="true">
          <div class="modal-dialog modal-dialog-scrollable">
            <div class="modal-content">
              <div class="modal-header">
                <h5 class="modal-title" id="copyModalLabel">Copy {{.Space.Name}}</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
              </div>
              <div class="modal-body">
                <label for="spaceName">Name</label>
                <input name=name type=text id="spaceName" class="mb-3 form-control" placeholder="Name" required>
                <label for="spaceDesc">Description</label>
                <input name=desc type=text id="spaceDesc" class="mb-3 form-control" placeholder="Description" required>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="submit" class="btn btn-primary">Go</button>
              </div>
            </div>
          </div>
        </div>
      </form>

      <form method=POST action='/space' enctype='multipart/form-data'>
        <input type=hidden name=method value=PATCH />
        <input required type=hidden name=space value="{{ .Space.ID }}" />
        <div class="modal fade" id="updateModal" tabindex="-1" role="dialog" aria-labelledby="updateModalLabel" aria-hidden="true">
          <div class="modal-dialog modal-dialog-scrollable">
            <div class="modal-content">
              <div class="modal-header">
                <h5 class="modal-title" id="updateModalLabel">Update {{.Space.Name}}</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
              </div>
              <div class="modal-body">
                <label for="spaceName">Name</label>
                <input value="{{ .Space.Name }}" name=name type=text id="spaceName" class="mb-3 form-control" placeholder="Name" required>
                <label for="spaceDesc">Description</label>
                <input value="{{ .Space.Desc }}" name=desc type=text id="spaceDesc" class="mb-3 form-control" placeholder="Description" required>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="submit" class="btn btn-primary">Go</button>
              </div>
            </div>
          </div>
        </div>
      </form>
      
      <form method=POST action='/space' enctype='multipart/form-data'>
        <input type=hidden name=method value=DELETE />
        <input required type=hidden name=space value="{{ .Space.ID }}" />
        <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true">
          <div class="modal-dialog modal-dialog-scrollable">
            <div class="modal-content">
              <div class="modal-header">
                <h5 class="modal-title" id="deleteModalLabel">Delete {{.Space.Name}}</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                  <span aria-hidden="true">&times;</span>
                </button>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                <button type="submit" class="btn btn-primary">Go</button>
              </div>
            </div>
          </div>
        </div>
      </form>

      <div class="container">
        <div class='row'>
          <div class='col-lg-6'>
            <div class="my-3 p-3 bg-white rounded shadow-sm">
                <small class="d-block text-right float-right" data-toggle="modal" data-target="#create-contenttype">
                  <a href="#">Create a new content type</a>
                </small>
              <h6 class="border-bottom border-gray pb-2 mb-0">Your content types</h6>
              {{ if .ContentTypes.List }}
                {{ range .ContentTypes.List }}
                <div class="media text-muted pt-3">
                  <a href='/contenttype/{{ $.Space.ID }}/{{ .ID }}'  class="d-block media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
                    <strong class="d-block text-gray-dark">{{ .Name }}</strong>
                  </a>
                </div>
                {{ end }}
                {{ if .ContentTypes.More }}
                <small class="d-block text-right mt-3">
                  <a href="/space/{{ .Space.ID }}?beforect={{ .ContentTypes.Before }}">Load more</a>
                </small>
                {{ end }}
              {{ else }}
                <div class="mt-3 alert alert-primary" role="alert">
                  You haven't created any content types yet. 
                </div>
              {{ end }}
            </div>
          </div>
          <div class='col-lg-6'>
            <div class="my-3 p-3 bg-white rounded shadow-sm">
                <small class="d-block text-right float-right" data-toggle="modal" data-target="#hookModal">
                  <a href="#">Create a new webhook</a>
                </small>
              <h6 class="border-bottom border-gray pb-2 mb-0">Your webhooks</h6>
              {{ if .Hooks.List }}
                {{ range .Hooks.List }}
                <div class="media text-muted pt-3">
                  <a href='/hook/{{ $.Space.ID }}/{{ .ID }}'  class="d-block media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
                    <strong class="d-block text-gray-dark">{{ .URL }}</strong>
                  </a>
                </div>
                {{ end }}
                {{ if .Hooks.More }}
                <small class="d-block text-right mt-3">
                  <a href="/space/{{ .Space.ID }}?beforehook={{ .Hooks.Before }}">Load more</a>
                </small>
                {{ end }}
              {{ else }}
                <div class="mt-3 alert alert-primary" role="alert">
                  You haven't created any webhooks yet. 
                </div>
              {{ end }}
            </div>
          </div>
        </div>
      </div>

    </article>
    {{ template "html/_footer.html" $ }}
  </main>
  {{ template "html/_scripts.html" }}
  <script>{{ template "js/main.js" $ }}</script>
  <script>{{ template "js/space.js" $ }}</script>
</body>

</html>