45e4c66565
Remove slash commands from Markdown preview and display their outcome next to the text field. Introduce new "explanation" block to our slash commands DSL. Introduce optional "parse_params" block to slash commands DSL that allows to process a parameter before it is passed to "explanation" or "command" blocks. Pass path for previewing Markdown as "data" attribute instead of setting a variable on "window".
44 lines
2.1 KiB
Text
44 lines
2.1 KiB
Text
- referenced_users = local_assigns.fetch(:referenced_users, nil)
|
|
|
|
.md-area
|
|
.md-header
|
|
%ul.nav-links.clearfix
|
|
%li.active
|
|
%a.js-md-write-button{ href: "#md-write-holder", tabindex: -1 }
|
|
Write
|
|
%li
|
|
%a.js-md-preview-button{ href: "#md-preview-holder", tabindex: -1 }
|
|
Preview
|
|
|
|
- if defined?(@issue) && @issue.confidential?
|
|
%li.confidential-issue-warning
|
|
= icon('warning')
|
|
%span This is a confidential issue. Your comment will not be visible to the public.
|
|
|
|
%li.pull-right
|
|
.toolbar-group
|
|
= markdown_toolbar_button({ icon: "bold fw", data: { "md-tag" => "**" }, title: "Add bold text" })
|
|
= markdown_toolbar_button({ icon: "italic fw", data: { "md-tag" => "*" }, title: "Add italic text" })
|
|
= markdown_toolbar_button({ icon: "quote-right fw", data: { "md-tag" => "> ", "md-prepend" => true }, title: "Insert a quote" })
|
|
= markdown_toolbar_button({ icon: "code fw", data: { "md-tag" => "`", "md-block" => "```" }, title: "Insert code" })
|
|
= markdown_toolbar_button({ icon: "list-ul fw", data: { "md-tag" => "* ", "md-prepend" => true }, title: "Add a bullet list" })
|
|
= markdown_toolbar_button({ icon: "list-ol fw", data: { "md-tag" => "1. ", "md-prepend" => true }, title: "Add a numbered list" })
|
|
= markdown_toolbar_button({ icon: "check-square-o fw", data: { "md-tag" => "* [ ] ", "md-prepend" => true }, title: "Add a task list" })
|
|
.toolbar-group
|
|
%button.toolbar-btn.js-zen-enter.has-tooltip{ type: "button", tabindex: -1, aria: { label: "Go full screen" }, title: "Go full screen", data: { container: "body" } }
|
|
= icon("arrows-alt fw")
|
|
|
|
.md-write-holder
|
|
= yield
|
|
.md.md-preview-holder.js-md-preview.hide.md-preview{ data: { url: url } }
|
|
.referenced-commands.hide
|
|
|
|
- if referenced_users
|
|
.referenced-users.hide
|
|
%span
|
|
= icon("exclamation-triangle")
|
|
You are about to add
|
|
%strong
|
|
%span.js-referenced-users-count 0
|
|
people
|
|
to the discussion. Proceed with caution.
|