Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

4.4 KB
Raw Blame
<form class="modal-form" id="create_bot_form">
    {{#unless user_has_email_set}}
    <div class="demo-organization-add-email-banner banner-wrapper"></div>
    {{/unless}}
    <div class="new-bot-form">
        <div class="input-group">
            <label for="create_bot_type" class="modal-field-label">
                {{t "Bot type" }}
                {{> ../help_link_widget link="/help/bots-overview#bot-type" }}
            </label>
            <select name="bot_type" id="create_bot_type" class="modal_select bootstrap-focus-style">
                {{#each bot_types}}
                    <option value="{{this.type_id}}">{{this.name}}</option>
                {{/each}}
            </select>
        </div>
        <div class="input-group" id="service_name_list">
            <label for="select_service_name" class="modal-field-label">{{t "Bot"}}</label>
            <select name="service_name" id="select_service_name" class="modal_select bootstrap-focus-style">
                {{#each realm_embedded_bots}}
                    <option value="{{this.name}}">{{this.name}}</option>
                {{/each}}
            </select>
        </div>
        <div class="input-group">
            <label for="create_bot_name" class="modal-field-label">{{t "Name" }}</label>
            <input type="text" name="bot_name" id="create_bot_name" class="required modal_text_input"
              maxlength=100 placeholder="{{t 'Cookie Bot' }}" value="" />
            <div><label for="create_bot_name" generated="true" class="text-error"></label></div>
        </div>
        <div class="input-group">
            <label for="create_bot_short_name" class="modal-field-label">{{t "Bot email (a-z, 0-9, and dashes only)" }}</label>
            <input type="text" name="bot_short_name" id="create_bot_short_name" class="required bot_local_part modal_text_input"
              placeholder="{{t 'cookie' }}" value="" />
            -bot@{{ realm_bot_domain }}
            <div>
                <label for="create_bot_short_name" generated="true" class="text-error"></label>
            </div>
        </div>
        <div id="payload_url_inputbox">
            <div class="input-group">
                <label for="create_payload_url" class="modal-field-label">{{t "Endpoint URL" }}</label>
                <input type="text" name="payload_url" id="create_payload_url" class="modal_text_input"
                  maxlength=2083 placeholder="https://hostname.example.com" value="" />
                <div><label for="create_payload_url" generated="true" class="text-error"></label></div>
            </div>
            <div class="input-group">
                <label for="interface_type" class="modal-field-label">{{t "Webhook format" }}</label>
                <select name="interface_type" id="create_interface_type" class="modal_select bootstrap-focus-style">
                    <option value="1">Zulip</option>
                    <option value="2">{{t "Slack-compatible" }}</option>
                </select>
                <div><label for="create_interface_type" generated="true" class="text-error"></label></div>
            </div>
        </div>
        <div id="config_inputbox">
            {{#each realm_embedded_bots}}
                {{#each (object_entries config) as |entry|}}
                    {{> ../embedded_bot_config_item botname=../name key=entry.[0] value=entry.[1]}}
                {{/each}}
            {{/each}}
        </div>
        <div class="input-group">
            <label for="bot_avatar_file_input" class="modal-field-label">{{t "Avatar" }}</label>
            <div id="bot_avatar_file"></div>
            <input type="file" name="bot_avatar_file_input" class="notvisible" id="bot_avatar_file_input" value="{{t 'Upload avatar' }}" />
            <div id="add_bot_preview_text">
                <img id="add_bot_preview_image" />
            </div>
            {{> ../components/action_button
              label=(t "Clear avatar")
              variant="subtle"
              intent="danger"
              id="bot_avatar_clear_button"
              hidden=true
              }}
            {{> ../components/action_button
              label=(t "Upload avatar")
              variant="subtle"
              intent="neutral"
              id="bot_avatar_upload_button"
              custom_classes="inline-block"
              }}
            ({{t "Optional" }})
        </div>
        <p id="bot_avatar_file_input_error" class="text-error"></p>
    </div>
</form>