2021-03-13 18:15:14 +01:00
|
|
|
<div id="linkifier-settings" class="settings-section" data-name="linkifier-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>
|
2021-04-14 03:04:02 +02:00
|
|
|
{{#tr}}
|
2017-04-26 04:47:00 +02:00
|
|
|
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>
|
2018-12-17 21:44:44 +01:00
|
|
|
<p>
|
2021-04-14 03:04:02 +02:00
|
|
|
{{#tr}}
|
2018-12-17 21:44:44 +01:00
|
|
|
Or, to automatically linkify GitHub's <code>org/repo#1234</code> syntax:
|
|
|
|
{{/tr}}
|
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<code>(?P<org>[a-zA-Z0-9_-]+)/(?P<repo>[a-zA-Z0-9_-]+)#(?P<id>[0-9]+)</code>
|
|
|
|
{{t "and" }}
|
2019-06-17 01:40:19 +02:00
|
|
|
<code>https://github.com/%(org)s/%(repo)s/issues/%(id)s</code>
|
2018-12-17 21:44:44 +01:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<p>
|
2021-04-14 03:04:02 +02:00
|
|
|
{{#tr}}
|
2021-04-10 05:53:13 +02:00
|
|
|
More details are available <z-link>in the Help Center article</z-link>.
|
|
|
|
{{#*inline "z-link"}}<a href="/help/add-a-custom-linkifier" target="_blank" rel="noopener noreferrer">{{> @partial-block}}</a>{{/inline}}
|
2018-12-17 21:44:44 +01:00
|
|
|
{{/tr}}
|
|
|
|
</p>
|
2016-12-14 23:55:32 +01:00
|
|
|
|
2019-08-16 07:53:04 +02:00
|
|
|
{{#if is_admin}}
|
2021-03-13 18:15:14 +01:00
|
|
|
<form class="form-horizontal admin-linkifier-form">
|
|
|
|
<div class="add-new-linkifier-box grey-box">
|
|
|
|
<div class="new-linkifier-form wrapper">
|
|
|
|
<div class="settings-section-title new-linkifier-section-title">{{t "Add a new linkifier" }}</div>
|
|
|
|
<div class="alert" id="admin-linkifier-status"></div>
|
2019-08-16 07:53:04 +02:00
|
|
|
<div class="control-group">
|
2021-03-13 18:15:14 +01:00
|
|
|
<label for="linkifier_pattern" class="control-label">{{t "Pattern" }}</label>
|
|
|
|
<input type="text" id="linkifier_pattern" name="pattern" placeholder="#(?P<id>[0-9]+)" />
|
|
|
|
<div class="alert" id="admin-linkifier-pattern-status"></div>
|
2019-08-16 07:53:04 +02:00
|
|
|
</div>
|
|
|
|
<div class="control-group">
|
2021-03-13 18:15:14 +01:00
|
|
|
<label for="linkifier_format_string" class="control-label">{{t "URL format string" }}</label>
|
|
|
|
<input type="text" id="linkifier_format_string" name="url_format_string" placeholder="https://github.com/zulip/zulip/issues/%(id)s" />
|
|
|
|
<div class="alert" id="admin-linkifier-format-status"></div>
|
2019-08-16 07:53:04 +02:00
|
|
|
</div>
|
|
|
|
<button type="submit" class="button rounded sea-green">
|
|
|
|
{{t 'Add linkifier' }}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
<input type="text" class="search" placeholder="{{t 'Filter linkifiers' }}" aria-label="{{t 'Filter linkifiers' }}"/>
|
2020-04-15 12:22:23 +02:00
|
|
|
<div class="progressive-table-wrapper" data-simplebar>
|
2021-03-13 18:15:14 +01:00
|
|
|
<table class="table table-condensed table-striped wrapped-table admin_linkifiers_table">
|
2019-08-22 06:23:41 +02:00
|
|
|
<thead>
|
|
|
|
<th class="active" data-sort="pattern">{{t "Pattern" }}</th>
|
|
|
|
<th data-sort="url">{{t "URL format string" }}</th>
|
|
|
|
{{#if is_admin}}
|
|
|
|
<th class="actions">{{t "Actions" }}</th>
|
|
|
|
{{/if}}
|
|
|
|
</thead>
|
2021-03-14 12:16:39 +01:00
|
|
|
<tbody id="admin_linkifiers_table" class="required-text" data-empty="{{t 'No linkifiers set.' }}"></tbody>
|
2019-08-16 07:53:04 +02:00
|
|
|
</table>
|
2016-02-13 19:17:15 +01:00
|
|
|
</div>
|
2019-08-16 07:53:04 +02:00
|
|
|
</div>
|
2016-02-13 19:17:15 +01:00
|
|
|
</div>
|