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.

dialog_widget: Add option to add small text in footer.

Aman Agrawal472bb98297c1
diff --git a/web/src/dialog_widget.ts b/web/src/dialog_widget.ts
index d96c3335945..904a19f7d61 100644
--- a/web/src/dialog_widget.ts
+++ b/web/src/dialog_widget.ts
@@ -79,6 +79,7 @@ export type DialogWidgetConfig = {
loading_spinner?: boolean;
update_submit_disabled_state_on_change?: boolean;
always_visible_scrollbar?: boolean;
+ footer_minor_text?: string;
};
type RequestOpts = {
@@ -179,6 +180,7 @@ export function launch(conf: DialogWidgetConfig): string {
id: conf.id,
single_footer_button: conf.single_footer_button,
always_visible_scrollbar: conf.always_visible_scrollbar,
+ footer_minor_text: conf.footer_minor_text,
});
const $dialog = $(html);
$("body").append($dialog);
diff --git a/web/styles/zulip.css b/web/styles/zulip.css
index 3ca25872fa6..7cbfb4962be 100644
--- a/web/styles/zulip.css
+++ b/web/styles/zulip.css
@@ -2047,3 +2047,9 @@ body:not(.hide-left-sidebar) {
.empty-topic-display {
font-style: italic;
}
+
+.dialog-widget-footer-minor-text {
+ font-size: smaller;
+ font-style: italic;
+ margin-right: auto;
+}
diff --git a/web/templates/dialog_widget.hbs b/web/templates/dialog_widget.hbs
index 7eb79e03f6e..12a40e95847 100644
--- a/web/templates/dialog_widget.hbs
+++ b/web/templates/dialog_widget.hbs
@@ -15,6 +15,9 @@
{{{ html_body }}}
</main>
<footer class="modal__footer">
+ {{#if footer_minor_text }}
+ <div class="dialog-widget-footer-minor-text">{{footer_minor_text}}</div>
+ {{/if}}
{{#unless single_footer_button}}
<button class="modal__button dialog_exit_button" aria-label="{{t 'Close this dialog window' }}" data-micromodal-close>{{{ html_exit_button }}}</button>
{{/unless}}