aboutsummaryrefslogtreecommitdiff
path: root/views/partials/top.html
blob: 5941d4f10f5ddd8169abb6d3ea1de58bffa8b3b2 (plain)
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
<div style="max-width: 800px; margin: 0 auto;">
  <h1 style="text-align: center;">/{{ .Board.Name }}/ - {{ .Board.PrefName }}</h1>
  <p style="text-align: center;">{{ .Board.Summary }}</p>
  {{ $len := len .Posts }}
  {{ if eq $len 0 }}
  {{ if eq .PostType "new" }}
  <h3 id="newpostbtn"  state="0" style="display: none; margin-bottom:100px;">[<a href="javascript:startNewPost()">Start a New Thread</a>]</h3>
  {{ end }} <!-- end if inreplyto-->
  <div id="newpost">
    <form onsubmit="sessionStorage.setItem('element-closed-reply', true)" id="new-post" action="/post" method="post" enctype="multipart/form-data">
      <table id="postForm">
        <tr>
          <tr>
            <td><label for="name">Name:</label></td>
            <td><input type="text" id="name" name="name" placeholder="Anonymous" maxlength="100">
                <a id="stopTablePost" onclick="stopNewPost()">[X]</a>
            </td>
          </tr>
          <tr>
            <td><label for="options">Options:</label></td>
            <td><input type="text" id="options" name="options" maxlength="100" style="margin-right:10px">{{ if .Board.InReplyTo }}<input type="submit" value="Post">{{ end }}</td>
          </tr>
          {{ if eq .Board.InReplyTo "" }}
          <tr>
            <td><label for="subject">Subject:</label></td>
            <td><input type="text" id="subject" name="subject" maxlength="100" style="margin-right:10px"><input type="submit" value="Post"></td>
          </tr>
          {{ end }}
          <tr>
            <td><label for="comment">Comment:</label></td>
            <td><textarea rows="10" cols="50" id="comment" name="comment" maxlength="4500"></textarea></td>
          </tr>
          <tr>
            <td><label for="file">Image</label></td>
            <td><input type="file" id="file" name="file" {{ if gt $len 1 }} required {{ else }} {{ if eq $len 0 }} required {{ end }} {{ end }} >
                <br><input type="checkbox" name="sensitive">Mark sensitive</input></td>
          </tr>
          <tr>
            <td><label for="captcha">Captcha:</label></td>
            <td>
              <div style="height: 65px; display: inline;">
                <img src="{{ .Board.Captcha }}">
              </div>
              <input type="text" id="captcha" name="captcha" autocomplete="off">
            </td>
          </tr>
      </table>

      <input type="hidden" id="inReplyTo" name="inReplyTo" value="{{ .Board.InReplyTo }}">
      <input type="hidden" id="sendTo" name="sendTo" value="{{ .Board.To }}">
      <input type="hidden" id="boardName" name="boardName" value="{{ .Board.Name }}">
      <input type="hidden" id="captchaCode" name="captchaCode" value="{{ .Board.CaptchaCode }}">
      <input type="hidden" id="returnTo" name="returnTo" value="{{ .ReturnTo }}">
    </form>
  </div>

  {{ else }} <!-- special case to distinquish Notes and Archived formatting -->

  {{ if eq (index .Posts 0).Type "Note" }}
  {{ if .Board.InReplyTo }}
  {{ if eq (index .Posts 0).Locked false }}
  <h3 id="newpostbtn"  state="0" style="text-align: center; margin-top: 80px; display: none; margin-bottom:100px;">[<a href="javascript:startNewPost()">Post a Reply</a>]</h3>
  {{ end }}
  {{ else  }}
  <h3 id="newpostbtn"  state="0" style="text-align: center; margin-top: 80px; display: none; margin-bottom:100px;">[<a href="javascript:startNewPost()">Start a New Thread</a>]</h3>
  {{ end }} <!-- end if inreplyto-->
  {{ $len := len .Posts }}
  <div id="newpost">
    <form onsubmit="sessionStorage.setItem('element-closed-reply', true)" id="new-post" action="/post" method="post" enctype="multipart/form-data">
      <table id="postForm">
        <tr>
          <tr>
            <td><label for="name">Name:</label></td>
            <td><input type="text" id="name" name="name" placeholder="Anonymous" maxlength="100">
                <a id="stopTablePost" onclick="stopNewPost()">[X]</a>
          </tr>
          <tr>
            <td><label for="options">Options:</label></td>
            <td><input type="text" id="options" name="options" maxlength="100" style="margin-right:10px">{{ if .Board.InReplyTo }}<input type="submit" value="Post">{{ end }}</td>
          </tr>
          {{ if eq .Board.InReplyTo "" }}
          <tr>
            <td><label for="subject">Subject:</label></td>
            <td><input type="text" id="subject" name="subject" maxlength="100" style="margin-right:10px"><input type="submit" value="Post"></td>
          </tr>
          {{ end }}
          <tr>
            <td><label for="comment">Comment:</label></td>
            <td><textarea rows="10" cols="50" id="comment" name="comment" maxlength="4500"></textarea></td>
          </tr>
          <tr>
            <td><label for="file">Image</label></td>
            <td><input type="file" id="file" name="file" {{ if gt $len 1 }} required {{ else }} {{ if eq $len 0 }} required {{ end }} {{ end }} >
                <br><input type="checkbox" name="sensitive">Mark sensitive</input></td>
          </tr>
          <tr>
            <td><label for="captcha">Captcha:</label></td>
            <td>
              <div style="height: 65px; display: inline;">
                <img src="{{ .Board.Captcha }}">
              </div>
              <input type="text" id="captcha" name="captcha" autocomplete="off">
            </td>
          </tr>
      </table>

      <input type="hidden" id="inReplyTo" name="inReplyTo" value="{{ .Board.InReplyTo }}">
      <input type="hidden" id="sendTo" name="sendTo" value="{{ .Board.To }}">
      <input type="hidden" id="boardName" name="boardName" value="{{ .Board.Name }}">
      <input type="hidden" id="captchaCode" name="captchaCode" value="{{ .Board.CaptchaCode }}">
      <input type="hidden" id="returnTo" name="returnTo" value="{{ .ReturnTo }}">    </form>
  </div>

  </div>
  {{ else }}
  <h1 style="text-align: center;">Archived Post</h1>
  {{ end }}
  {{ end }} <!-- end of len eq 0-->
</div>
<script>
  newpostbtn = document.getElementById("newpostbtn");
  newpost = document.getElementById("newpost");

  if(newpostbtn)
      newpostbtn.style.display = "block";
  if(newpost)
      newpost.style.display = "none";
</script>