Skip to content
Permalink
Browse files

add skip_redirect for actions

  • Loading branch information...
angusmcleod committed Sep 18, 2018
1 parent a1f4d6f commit b78c2f0c0ffd3327b9d72ee3da094f1370b43402
@@ -102,6 +102,16 @@
</div>
{{/if}}

<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.skip_redirect.label"}}</h3>
</div>
<div class="setting-value">
{{input type='checkbox' checked=action.skip_redirect}}
<span>{{i18n 'admin.wizard.action.skip_redirect.description' type='topic'}}</span>
</div>
</div>

<div class="setting full">
<label>{{i18n 'admin.wizard.action.add_fields' type='Topic'}}</label>
{{wizard-custom-inputs inputs=action.add_fields
@@ -165,6 +175,16 @@
</div>
</div>

<div class="setting">
<div class="setting-label">
<h3>{{i18n "admin.wizard.action.skip_redirect.label"}}</h3>
</div>
<div class="setting-value">
{{input type='checkbox' checked=action.skip_redirect}}
<span>{{i18n 'admin.wizard.action.skip_redirect.description' type='message'}}</span>
</div>
</div>

<div class="setting full">
<label>{{i18n "admin.wizard.action.add_fields" type='Message'}}</label>
{{wizard-custom-inputs inputs=action.add_fields
@@ -102,6 +102,9 @@ en:
add_fields: "{{type}} Fields"
available_fields: "* If 'Save wizard submissions' is disabled, only the fields of the current step are available to the current step's actions."
topic_attr: "Topic Attribute"
skip_redirect:
label: "Skip Redirect"
description: "Don't redirect the user to this {{type}} after the wizard completes"
send_message:
label: "Send Message"
recipient: "Recipient"
@@ -325,7 +325,9 @@ def create_topic(user, action, data)
post.topic.save_custom_fields(true)
end

data['redirect_to'] = post.topic.url
unless action['skip_redirect']
data['redirect_to'] = post.topic.url
end
end
end
end
@@ -352,7 +354,9 @@ def send_message(user, action, data)
if creator.errors.present?
updater.errors.add(:send_message, creator.errors.full_messages.join(" "))
else
data['redirect_to'] = post.topic.url
unless action['skip_redirect']
data['redirect_to'] = post.topic.url
end
end
end
end

0 comments on commit b78c2f0

Please sign in to comment.
You can’t perform that action at this time.