2016-12-02 20:19:27 +01:00
|
|
|
<div id="filter-settings" class="settings-section" data-name="filter-settings">
|
2017-04-26 04:47:00 +02:00
|
|
|
<div class="admin-table-wrapper">
|
2016-12-14 23:55:32 +01:00
|
|
|
|
2017-04-26 04:47:00 +02:00
|
|
|
<p>
|
|
|
|
{{#tr this}}
|
|
|
|
Configure regular expression patterns that will be
|
|
|
|
automatically linkified when used in Zulip message bodies or
|
|
|
|
topics. For example to automatically linkify commit IDs and
|
|
|
|
issue numbers (e.g. #123) to the corresponding items in a GitHub
|
|
|
|
project, you could use the following:
|
|
|
|
{{/tr}}
|
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<code>#(?P<id>[0-9]+)</code>
|
|
|
|
{{t "and" }}
|
|
|
|
<code>https://github.com/zulip/zulip/issues/%(id)s</code>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<code>(?P<id>[0-9a-f]{40})</code>
|
|
|
|
{{t "and" }}
|
|
|
|
<code>https://github.com/zulip/zulip/commit/%(id)s</code>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2016-12-14 23:55:32 +01:00
|
|
|
|
2017-04-26 04:47:00 +02:00
|
|
|
<table class="table table-condensed table-striped admin_filters_table">
|
|
|
|
<tbody id="admin_filters_table">
|
|
|
|
<th>{{t "Pattern" }}</th>
|
|
|
|
<th>{{t "URL format string" }}</th>
|
|
|
|
{{#if is_admin}}
|
2017-05-11 02:35:18 +02:00
|
|
|
<th class="actions">{{t "Actions" }}</th>
|
2017-04-26 04:47:00 +02:00
|
|
|
{{/if}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
{{#if is_admin}}
|
2017-04-14 23:56:33 +02:00
|
|
|
<form class="form-horizontal admin-filter-form">
|
2017-08-31 00:06:17 +02:00
|
|
|
<div class="add-new-filter-box grey-box">
|
|
|
|
<div class="new-filter-form wrapper">
|
2018-10-01 19:20:28 +02:00
|
|
|
<div class="settings-section-title new-filter-section-title">{{t "Add a new linkifier" }}</div>
|
2017-04-26 04:47:00 +02:00
|
|
|
<div class="alert" id="admin-filter-status"></div>
|
|
|
|
<div class="control-group">
|
|
|
|
<label for="filter_pattern" class="control-label">{{t "Regular expression" }}</label>
|
|
|
|
<input type="text" id="filter_pattern" name="pattern" placeholder="#(?P<id>[0-9]+)" />
|
|
|
|
<div class="alert" id="admin-filter-pattern-status"></div>
|
|
|
|
</div>
|
|
|
|
<div class="control-group">
|
|
|
|
<label for="filter_format_string" class="control-label">{{t "URL format string" }}</label>
|
|
|
|
<input type="text" id="filter_format_string" name="url_format_string" placeholder="https://github.com/zulip/zulip/issues/%(id)s" />
|
|
|
|
<div class="alert" id="admin-filter-format-status"></div>
|
|
|
|
</div>
|
2017-08-31 00:06:17 +02:00
|
|
|
<button type="submit" class="button rounded sea-green">
|
2018-10-01 19:20:28 +02:00
|
|
|
{{t 'Add linkifier' }}
|
2017-08-31 00:06:17 +02:00
|
|
|
</button>
|
2017-04-14 23:56:33 +02:00
|
|
|
</div>
|
2016-02-13 19:17:15 +01:00
|
|
|
</div>
|
2017-04-14 23:56:33 +02:00
|
|
|
</form>
|
2017-04-26 04:47:00 +02:00
|
|
|
{{/if}}
|
2016-02-13 19:17:15 +01:00
|
|
|
</div>
|