~sircmpwn/lists.sr.ht

ref: 5ee581ceae830ba466d1a8dcd7646575de57a709 lists.sr.ht/listssrht/templates/archive.html -rw-r--r-- 8.5 KiB View raw
5ee581ceDrew DeVault Fix patchset UI links 6 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
{% extends "list-full.html" %}
{% block content %}
<div class="container-fluid">
  <div class="row">
    {% if view == "archives" %}
    <div class="col-md-3">
      {% if ml.description %}
      {{ml.description | md}}
      {% endif %}
      <p>
        {% if current_user and not ml.mirror_id %}

        {% if subscription %}
        <form method="POST" action="{{url_for("archives.unsubscribe",
              owner_name=owner.canonical_name, list_name=ml.name) }}">
          {{csrf_token()}}
          {% if ListAccess.post in access %}
          <a
            href="mailto:{{ post_address(ml) }}"
            class="btn btn-primary btn-block"
          >New post {{icon("caret-right")}}</a>
          {% endif %}
          <button class="btn btn-default btn-block">
            Unsubscribe {{icon("caret-right")}}
          </button>
        </form>
        {% else %}
        <form method="POST" action="{{url_for("archives.subscribe",
              owner_name=owner.canonical_name, list_name=ml.name) }}">
          {{csrf_token()}}
          {% if ListAccess.browse in access %}
          <button class="btn btn-primary btn-block">
            Subscribe {{icon("caret-right")}}
          </button>
          {% endif %}
          {% if ListAccess.post in access %}
          <a
            href="mailto:{{ post_address(ml) }}"
            class="
              btn btn-block
              {% if ListAccess.browse not in access %}
              btn-primary
              {% else %}
              btn-default
              {% endif %}
            "
          >New post {{icon("caret-right")}}</a>
          {% endif %}
        </form>
        {% endif %}

        {% else %}
        {% set subscribe_address = post_address(ml, suffix="+subscribe") %}
        {% set posting_address = post_address(ml) %}

        {% if subscribe_address and ListAccess.browse in access %}
        <a
          {% if subscribe_address.startswith("mailto:") %}
          href="{{subscribe_address}}"
          {% else %}
          href="mailto:{{subscribe_address}}"
          {% endif %}
          class="btn btn-primary btn-block"
        >Subscribe {{icon("caret-right")}}</a>
        {% endif %}
        {% if ListAccess.post in access and posting_address %}
        <a
          {% if posting_address.startswith("mailto:") %}
          href="{{posting_address}}"
          {% else %}
          href="mailto:{{posting_address}}"
          {% endif %}
          class="
            btn btn-block
            {% if ListAccess.browse not in access %}
            btn-primary
            {% else %}
            btn-default
            {% endif %}
          "
        >New post {{icon("caret-right")}}</a>
        {% endif %}
        {% endif %}
      </p>
      {% if ListAccess.post in access %}
      <p class="alert alert-info">
        Please review our
        <a href="https://man.sr.ht/lists.sr.ht/etiquette.md">
          mailing list etiquette</a>
        guide and ensure your email client is correctly configured before
        posting. Thanks!
      </p>
      {% endif %}
    </div>
    <div class="col-md-9">
    {% else %}
    <div class="col-md-12">
    {% endif %}
      {% if ListAccess.browse in access %}
      {% if any(threads) or search %}
      <form>
        <input
          name="search"
          type="text"
          {% if view == "archives" %}
          placeholder='Search...     from:me     is:patch     In-Reply-To:<12345@example.org>     "PATCH my-project"'
          {% elif view == "patches" %}
          placeholder='Search...     status:approved    prefix:my-project    from:me'
          {% endif %}
          class="form-control"
          value="{{ search if search else "" }}" />
      </form>
      {% endif %}
      {% if ml.import_in_progress %}
      <div class="alert alert-primary">
        An import operation is currently in progress.
      </div>
      {% endif %}
      {% if any(threads) %}
      <form
        class="event-list"
        method="POST"
        action="{{url_for('patches.patchset_bulk_update',
          owner_name=owner.canonical_name, list_name=ml.name)}}"
      >
        {% for message in threads %}
        <div class="event archive-entry">
          <small class="text-muted pull-right">
            {% if message.nreplies > 0 %}
            <span>
              {{icon("reply")}}
              {{message.nreplies}}
            </span>
            {% endif %}
            {% if message.nparticipants > 1 %}
            <span>
              {{icon("user")}}
              {{message.nparticipants}}
            </span>
            {% endif %}
            <span>
              {% set from_hdr = message.parsed()['From'] %}
              {% set from = parseaddr(from_hdr) %}
              {% if message.sender != None %}
              <a href="/{{ message.sender.canonical_name }}">{{from[0]}}</a>
              {% else %}
              {{from[0]}}
              {% endif %}
            </span>
            <span>
              {{icon("clock")}} {{ message.updated | date }}
            </span>
          </small>
          <h4>
            {% if message.patchset_id %}
            {% if view == "patches" %}
            <label for="select-{{message.patchset_id}}"
              class="status {{status_to_color[message.patchset.status]}}"
            >
              {% if current_user and view == "patches"
                and current_user.id == ml.owner_id %}
              <input
                type="checkbox"
                class="patch-select"
                name="select-{{message.patchset_id}}"
                id="select-{{message.patchset_id}}"
              ></input>
              {% endif %}
              {{message.patchset.status.value.replace("_", " ").upper()}}
            </label>
            {% endif %}
            <a href="{{
              url_for('patches.patchset',
                owner_name=owner.canonical_name,
                list_name=ml.name,
                patchset_id=message.patchset_id)
            }}">
              {{ message.subject }}
            </a>
            {% else %}
            <a href="{{
              url_for('archives.thread',
                owner_name=owner.canonical_name,
                list_name=ml.name,
                message_id=message.message_id)
            }}">
              {{ message.subject }}
            </a>
            {% endif %}
          </h4>
        </div>
        {% endfor %}
        {% if view == "patches"
          and current_user and current_user.id == ml.owner_id %}
        {{csrf_token()}}
        <input type="hidden" name="search" value="{{search if search else ""}}" />
        <div class="event">
          <label for="select-all" class="checkbox">
            <input
              type="checkbox"
              class="patch-select"
              name="select-all"
              id="select-all" />
            {% if not search %}
            Select all {{total_results}} patchsets
            {% else %}
            Select all {{total_results}} search results
            {% endif %}
          </label>
        </div>
        <div class="event col-md-4">
          <div class="form-group">
            <select
              name="status"
              id="status"
              class="form-control"
            >
              {% for opt in PatchsetStatus %}
              <option value="{{opt.value}}">
                {{opt.value.replace("_", " ").upper()}}
              </option>
              {% endfor %}
            </select>
          </div>
          <button
            type="submit"
            class="btn btn-success pull-right"
          >Bulk update {{icon('caret-right')}}</button>
        </div>
        {% endif %}
      </form>
      {{ pagination() }}
      {% elif ml.mirror_id and not ml.mirror.configured %}
      {% if ml.mirror.configure_attempts >= 2 %}
      <div class="alert alert-danger">
        There was a problem configuring this mirror. Please
        <a href="mailto:{{cfg('sr.ht', 'owner-email')}}">contact support</a>.
      </div>
      {% else %}
      <div class="alert alert-danger">
        This mirror is still being configured with the remote mail server. If
        this process doesn't complete within a few hours, please
        <a href="mailto:{{cfg('sr.ht', 'owner-email')}}">contact support</a>.
      </div>
      {% endif %}
      {% else %}
      <p>
        {% if search %}
        Nothing found.
        {% else %}
        No one has posted to this list yet.
        {% endif %}
      </p>
      {% endif %}
      {% else %}
      <div class="alert alert-warning">
        This list has restricted browsing, you cannot view the archives.
      </div>
      {% endif %}
    </div>
  </div>
</div>
{% endblock %}