0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00

Merge branch 'master' into pm-multiple-targets

Dieser Commit ist enthalten in:
Faizaan Gagan 2021-04-19 11:04:47 +05:30
Commit 9ded3602eb
62 geänderte Dateien mit 1213 neuen und 941 gelöschten Zeilen

3
.eslintrc Normale Datei
Datei anzeigen

@ -0,0 +1,3 @@
{
"extends": "eslint-config-discourse"
}

53
.github/workflows/plugin-linting.yml gevendort Normale Datei
Datei anzeigen

@ -0,0 +1,53 @@
name: Linting
on:
push:
branches:
- master
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Set up ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Setup bundler
run: gem install bundler -v 2.1.4 --no-doc
- name: Setup gems
run: bundle install --jobs 4
- name: Yarn install
run: yarn install --dev
- name: ESLint
run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,assets}/javascripts
- name: Prettier
run: |
yarn prettier -v
if [ -d "assets" ]; then \
yarn prettier --list-different "assets/**/*.{scss,js,es6}" ; \
fi
if [ -d "test" ]; then \
yarn prettier --list-different "test/**/*.{js,es6}" ; \
fi
- name: Ember template lint
run: yarn ember-template-lint assets/javascripts
- name: Rubocop
run: bundle exec rubocop .

137
.github/workflows/plugin-tests.yml gevendort Normale Datei
Datei anzeigen

@ -0,0 +1,137 @@
name: Plugin Tests
on:
push:
branches:
- master
- main
pull_request:
jobs:
build:
name: ${{ matrix.build_type }}
runs-on: ubuntu-latest
timeout-minutes: 60
env:
DISCOURSE_HOSTNAME: www.example.com
RUBY_GLOBAL_METHOD_CACHE_SIZE: 131072
RAILS_ENV: test
PGHOST: localhost
PGUSER: discourse
PGPASSWORD: discourse
strategy:
fail-fast: false
matrix:
build_type: ["backend", "frontend"]
ruby: ["2.7"]
postgres: ["12"]
redis: ["4.x"]
services:
postgres:
image: postgres:${{ matrix.postgres }}
ports:
- 5432:5432
env:
POSTGRES_USER: discourse
POSTGRES_PASSWORD: discourse
options: >-
--mount type=tmpfs,destination=/var/lib/postgresql/data
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
with:
repository: discourse/discourse
fetch-depth: 1
- name: Install plugin
uses: actions/checkout@v2
with:
path: plugins/${{ github.event.repository.name }}
fetch-depth: 1
- name: Check spec existence
id: check_spec
uses: andstor/file-existence-action@v1
with:
files: "plugins/${{ github.event.repository.name }}/spec"
- name: Check qunit existence
id: check_qunit
uses: andstor/file-existence-action@v1
with:
files: "plugins/${{ github.event.repository.name }}/test/javascripts"
- name: Setup Git
run: |
git config --global user.email "ci@ci.invalid"
git config --global user.name "Discourse CI"
- name: Setup packages
run: |
sudo apt-get update
sudo apt-get -yqq install postgresql-client libpq-dev gifsicle jpegoptim optipng jhead
wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/install-pngquant | sudo sh
- name: Update imagemagick
if: matrix.build_type == 'backend'
run: |
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/install-imagemagick
chmod +x install-imagemagick
sudo ./install-imagemagick
- name: Setup redis
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: ${{ matrix.redis }}
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Lint English locale
if: matrix.build_type == 'backend'
run: bundle exec ruby script/i18n_lint.rb "plugins/${{ github.event.repository.name }}/locales/{client,server}.en.yml"
- name: Get yarn cache directory
id: yarn-cache-dir
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Yarn cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.os }}-yarn-
- name: Yarn install
run: yarn install --dev
- name: Migrate database
run: |
bin/rake db:create
bin/rake db:migrate
- name: Plugin RSpec
if: matrix.build_type == 'backend' && steps.check_spec.outputs.files_exists == 'true'
run: bin/rake plugin:spec[${{ github.event.repository.name }}]
- name: Plugin QUnit
if: matrix.build_type == 'frontend' && steps.check_qunit.outputs.files_exists == 'true'
run: bundle exec rake plugin:qunit['${{ github.event.repository.name }}','1200000']
timeout-minutes: 30
- name: Simplecov Report
if: matrix.build_type == 'backend'
run: COVERAGE=1 bin/rake plugin:spec[${{ github.event.repository.name }}]

4
.gitignore gevendort
Datei anzeigen

@ -1,3 +1,7 @@
coverage/*
!coverage/.last_run.json
gems/
.bundle/
auto_generated
.DS_Store
node_modules/

1
.prettierrc Normale Datei
Datei anzeigen

@ -0,0 +1 @@
{}

2
.rubocop.yml Normale Datei
Datei anzeigen

@ -0,0 +1,2 @@
inherit_gem:
rubocop-discourse: default.yml

4
.template-lintrc.js Normale Datei
Datei anzeigen

@ -0,0 +1,4 @@
module.exports = {
plugins: ["ember-template-lint-plugin-discourse"],
extends: "discourse:recommended",
};

7
Gemfile Normale Datei
Datei anzeigen

@ -0,0 +1,7 @@
# frozen_string_literal: true
source 'https://rubygems.org'
group :development do
gem 'rubocop-discourse'
end

38
Gemfile.lock Normale Datei
Datei anzeigen

@ -0,0 +1,38 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
parallel (1.20.1)
parser (3.0.1.0)
ast (~> 2.4.1)
rainbow (3.0.0)
regexp_parser (2.1.1)
rexml (3.2.5)
rubocop (1.12.1)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-discourse (2.4.1)
rubocop (>= 1.1.0)
rubocop-rspec (>= 2.0.0)
rubocop-rspec (2.2.0)
rubocop (~> 1.0)
rubocop-ast (>= 1.1.0)
ruby-progressbar (1.11.0)
unicode-display_width (2.0.0)
PLATFORMS
ruby
DEPENDENCIES
rubocop-discourse
BUNDLED WITH
2.2.16

Datei anzeigen

@ -1,3 +1,3 @@
{{#if currentUser.admin}}
{{nav-item route='adminWizards' label='admin.wizard.nav_label'}}
{{nav-item route="adminWizards" label="admin.wizard.nav_label"}}
{{/if}}

Datei anzeigen

@ -1,7 +1,7 @@
{{#each site.complete_custom_wizard as |wizard|}}
<div class='row'>
<div class='alert alert-info alert-wizard'>
<a href="{{wizard.url}}">{{i18n 'wizard.complete_custom' name=wizard.name}}</a>
<div class="row">
<div class="alert alert-info alert-wizard">
<a href={{wizard.url}}>{{i18n "wizard.complete_custom" name=wizard.name}}</a>
</div>
</div>
{{/each}}
{{/each}}

Datei anzeigen

@ -1,5 +1,5 @@
<div class="wizard-api-header page">
<div class='buttons'>
<div class="buttons">
{{#if updating}}
{{loading-spinner size="small"}}
{{else}}
@ -23,7 +23,7 @@
<div class="wizard-header">
{{#if api.isNew}}
{{i18n 'admin.wizard.api.new'}}
{{i18n "admin.wizard.api.new"}}
{{else}}
{{api.title}}
{{/if}}
@ -31,14 +31,14 @@
<div class="metadata">
<div class="title">
<label>{{i18n 'admin.wizard.api.title'}}</label>
{{input value=api.title placeholder=(i18n 'admin.wizard.api.title_placeholder')}}
<label>{{i18n "admin.wizard.api.title"}}</label>
{{input value=api.title placeholder=(i18n "admin.wizard.api.title_placeholder")}}
</div>
<div class="name">
<label>{{i18n 'admin.wizard.api.name'}}</label>
<label>{{i18n "admin.wizard.api.name"}}</label>
{{#if api.isNew}}
{{input value=api.name placeholder=(i18n 'admin.wizard.api.name_placeholder')}}
{{input value=api.name placeholder=(i18n "admin.wizard.api.name_placeholder")}}
{{else}}
{{api.name}}
{{/if}}
@ -64,7 +64,7 @@
</div>
<div class="wizard-header">
{{i18n 'admin.wizard.api.auth.label'}}
{{i18n "admin.wizard.api.auth.label"}}
</div>
</div>
@ -72,13 +72,13 @@
<div class="settings">
<div class="wizard-header medium">
{{i18n 'admin.wizard.api.auth.settings'}}
{{i18n "admin.wizard.api.auth.settings"}}
</div>
{{#if showRedirectUri}}
<div class="control-group redirect-uri">
<div class="control-label">
<label>{{i18n 'admin.wizard.api.auth.redirect_uri'}}</label>
<label>{{i18n "admin.wizard.api.auth.redirect_uri"}}</label>
<div class="controls">
{{api.redirectUri}}
</div>
@ -87,14 +87,14 @@
{{/if}}
<div class="control-group auth-type">
<label>{{i18n 'admin.wizard.api.auth.type'}}</label>
<label>{{i18n "admin.wizard.api.auth.type"}}</label>
<div class="controls">
{{combo-box
value=api.authType
value=api.authType
content=authorizationTypes
onChange=(action (mut api.authType))
options=(hash
none='admin.wizard.api.auth.type_none'
none="admin.wizard.api.auth.type_none"
)}}
</div>
</div>
@ -102,7 +102,7 @@
{{#if isOauth}}
{{#if threeLeggedOauth}}
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.url'}}</label>
<label>{{i18n "admin.wizard.api.auth.url"}}</label>
<div class="controls">
{{input value=api.authUrl}}
</div>
@ -110,51 +110,51 @@
{{/if}}
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.token_url'}}</label>
<label>{{i18n "admin.wizard.api.auth.token_url"}}</label>
<div class="controls">
{{input value=api.tokenUrl}}
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.client_id'}}</label>
<label>{{i18n "admin.wizard.api.auth.client_id"}}</label>
<div class="controls">
{{input value=api.clientId}}
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.client_secret'}}</label>
<label>{{i18n "admin.wizard.api.auth.client_secret"}}</label>
<div class="controls">
{{input value=api.clientSecret}}
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.params.label'}}</label>
<label>{{i18n "admin.wizard.api.auth.params.label"}}</label>
<div class="controls">
{{#each api.authParams as |param|}}
<div class="param">
{{input value=param.key placeholder=(i18n 'admin.wizard.key')}}
{{input value=param.value placeholder=(i18n 'admin.wizard.value')}}
{{d-button action=(action "removeParam") actionParam=param icon='times'}}
{{input value=param.key placeholder=(i18n "admin.wizard.key")}}
{{input value=param.value placeholder=(i18n "admin.wizard.value")}}
{{d-button action=(action "removeParam") actionParam=param icon="times"}}
</div>
{{/each}}
{{d-button label='admin.wizard.api.auth.params.new' icon='plus' action=(action "addParam")}}
{{d-button label="admin.wizard.api.auth.params.new" icon="plus" action=(action "addParam")}}
</div>
</div>
{{/if}}
{{#if isBasicAuth}}
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.username'}}</label>
<label>{{i18n "admin.wizard.api.auth.username"}}</label>
<div class="controls">
{{input value=api.username}}
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.password'}}</label>
<label>{{i18n "admin.wizard.api.auth.password"}}</label>
<div class="controls">
{{input value=api.password}}
</div>
@ -175,12 +175,12 @@
</div>
<div class="wizard-header medium">
{{i18n 'admin.wizard.api.status.label'}}
{{i18n "admin.wizard.api.status.label"}}
</div>
{{#if threeLeggedOauth}}
<div class="control-group">
<label>{{i18n 'admin.wizard.api.status.code'}}</label>
<label>{{i18n "admin.wizard.api.status.code"}}</label>
<div class="controls">
{{api.code}}
</div>
@ -188,7 +188,7 @@
{{/if}}
<div class="control-group">
<label>{{i18n 'admin.wizard.api.status.access_token'}}</label>
<label>{{i18n "admin.wizard.api.status.access_token"}}</label>
<div class="controls">
{{api.accessToken}}
</div>
@ -196,7 +196,7 @@
{{#if threeLeggedOauth}}
<div class="control-group">
<label>{{i18n 'admin.wizard.api.status.refresh_token'}}</label>
<label>{{i18n "admin.wizard.api.status.refresh_token"}}</label>
<div class="controls">
{{api.refreshToken}}
</div>
@ -204,14 +204,14 @@
{{/if}}
<div class="control-group">
<label>{{i18n 'admin.wizard.api.status.expires_at'}}</label>
<label>{{i18n "admin.wizard.api.status.expires_at"}}</label>
<div class="controls">
{{api.tokenExpiresAt}}
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.status.refresh_at'}}</label>
<label>{{i18n "admin.wizard.api.status.refresh_at"}}</label>
<div class="controls">
{{api.tokenRefreshAt}}
</div>
@ -221,11 +221,11 @@
</div>
<div class="wizard-header">
{{i18n 'admin.wizard.api.endpoint.label'}}
{{i18n "admin.wizard.api.endpoint.label"}}
</div>
<div class="wizard-api-endpoints">
{{d-button action=(action "addEndpoint") label='admin.wizard.api.endpoint.add' icon='plus'}}
{{d-button action=(action "addEndpoint") label="admin.wizard.api.endpoint.add" icon="plus"}}
{{#if api.endpoints}}
<div class="endpoint-list">
@ -236,14 +236,14 @@
<div class="endpoint-">
<div class="top">
{{input value=endpoint.name
placeholder=(i18n 'admin.wizard.api.endpoint.name')}}
placeholder=(i18n "admin.wizard.api.endpoint.name")}}
{{input value=endpoint.url
placeholder=(i18n 'admin.wizard.api.endpoint.url')
class='endpoint-url'}}
placeholder=(i18n "admin.wizard.api.endpoint.url")
class="endpoint-url"}}
{{d-button action=(action "removeEndpoint")
actionParam=endpoint
icon='times'
class='remove-endpoint'}}
icon="times"
class="remove-endpoint"}}
</div>
<div class="bottom">
{{combo-box
@ -278,33 +278,37 @@
</div>
<div class="wizard-header">
{{i18n 'admin.wizard.api.log.label'}}
{{i18n "admin.wizard.api.log.label"}}
{{d-button action=(action "clearLogs")
icon='trash-alt'
class='clear-logs'}}
icon="trash-alt"
class="clear-logs"}}
</div>
<div class="wizard-api-log">
<div class="log-list">
<table class="wizard-api-log-table">
<th>Datetime</th>
<th>User</th>
<th>Status</th>
<th>URL</th>
<th>Error</th>
{{#each api.log as |logentry|}}
<tr>
<td>{{logentry.time}}</td>
<td class="user-image">
<div class="user-image-inner">
<a href="{{unbound logentry.userpath}}" data-user-card="{{unbound logentry.username}}">{{avatar logentry imageSize="large"}}</a>
</div>
</td>
<td>{{logentry.status}}</td>
<td>{{logentry.url}}</td>
<td>{{logentry.error}}</td>
</tr>
{{/each}}
<thead>
<th>Datetime</th>
<th>User</th>
<th>Status</th>
<th>URL</th>
<th>Error</th>
</thead>
<tbody>
{{#each api.log as |logentry|}}
<tr>
<td>{{logentry.time}}</td>
<td class="user-image">
<div class="user-image-inner">
<a href={{logentry.userpath}} data-user-card={{logentry.username}}>{{avatar logentry imageSize="large"}}</a>
</div>
</td>
<td>{{logentry.status}}</td>
<td>{{logentry.url}}</td>
<td>{{logentry.error}}</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>

Datei anzeigen

@ -2,11 +2,11 @@
{{combo-box
value=apiName
content=apiList
onChange=(route-action 'changeApi')
onChange=(route-action "changeApi")
options=(hash
none='admin.wizard.api.select'
none="admin.wizard.api.select"
)}}
{{d-button
action="createApi"
label="admin.wizard.api.create"

Datei anzeigen

@ -1,6 +1,6 @@
<div class="admin-wizard-controls">
<h3>{{i18n 'admin.wizard.custom_field.nav_label'}}</h3>
<h3>{{i18n "admin.wizard.custom_field.nav_label"}}</h3>
<div class="buttons">
{{d-button
label="admin.wizard.custom_field.add"
@ -14,23 +14,27 @@
opts=messageOpts
type=messageType
url=documentationUrl
component='custom_fields'}}
component="custom_fields"}}
<div class="admin-wizard-container">
{{#if customFields}}
<table>
<tr>
{{#each fieldKeys as |key|}}
<th>{{i18n (concat "admin.wizard.custom_field." key ".label")}}</th>
<thead>
<tr>
{{#each fieldKeys as |key|}}
<th>{{i18n (concat "admin.wizard.custom_field." key ".label")}}</th>
{{/each}}
<th></th>
</tr>
</thead>
<tbody>
{{#each customFields as |field|}}
{{custom-field-input
field=field
removeField=(action "removeField")
saveField=(action "saveField")}}
{{/each}}
<th></th>
</tr>
{{#each customFields as |field|}}
{{custom-field-input
field=field
removeField=(action 'removeField')
saveField=(action 'saveField')}}
{{/each}}
</tbody>
</table>
{{/if}}
</div>

Datei anzeigen

@ -1,6 +1,6 @@
<div class="admin-wizard-controls">
<h3>{{i18n 'admin.wizard.log.nav_label'}}</h3>
<h3>{{i18n "admin.wizard.log.nav_label"}}</h3>
{{d-button
label="refresh"
icon="refresh"
@ -10,7 +10,7 @@
{{#load-more selector=".log-list tr" action=(action "loadMore") class="wizard-logs"}}
{{#if noResults}}
<p>{{i18n 'search.no_results'}}</p>
<p>{{i18n "search.no_results"}}</p>
{{else}}
<table class="table grid">
<thead>
@ -27,8 +27,8 @@
</tr>
{{/each}}
</tbody>
</table>
</table>
{{/if}}
{{conditional-loading-spinner condition=refreshing}}
{{/load-more}}

Datei anzeigen

@ -1,18 +1,18 @@
<div class="admin-wizard-controls">
<h3>{{i18n 'admin.wizard.manager.title'}}</h3>
<h3>{{i18n "admin.wizard.manager.title"}}</h3>
<div class="buttons">
{{#if filename}}
<div class="filename">
<a {{action 'clearFile'}}>
{{d-icon 'times'}}
<a role="button" {{action "clearFile"}}>
{{d-icon "times"}}
</a>
<span>{{filename}}</span>
</div>
{{/if}}
{{input
id='file-upload'
id="file-upload"
type="file"
accept="application/json"
change=(action "setFile")}}
@ -45,15 +45,15 @@
opts=messageOpts
items=messageItems
loading=loading
component='manager'}}
component="manager"}}
<div class="admin-wizard-container">
<table class="table grid">
<thead>
<tr>
<th>{{i18n 'admin.wizard.label'}}</th>
<th class="control-column">{{i18n 'admin.wizard.manager.export'}}</th>
<th class="control-column">{{i18n 'admin.wizard.manager.destroy'}}</th>
<th>{{i18n "admin.wizard.label"}}</th>
<th class="control-column">{{i18n "admin.wizard.manager.export"}}</th>
<th class="control-column">{{i18n "admin.wizard.manager.destroy"}}</th>
</tr>
</thead>
<tbody>
@ -65,16 +65,16 @@
{{/link-to}}
</td>
<td class="control-column">
{{input
{{input
type="checkbox"
class="export"
change=(action 'selectWizard')}}
change=(action "selectWizard")}}
</td>
<td class="control-column">
{{input
{{input
type="checkbox"
class="destroy"
change=(action 'selectWizard')}}
change=(action "selectWizard")}}
</td>
</tr>
{{/each}}

Datei anzeigen

@ -1,29 +1,33 @@
{{#if submissions}}
<div class="wizard-header large">
<label>{{i18n 'admin.wizard.submissions.title' name=wizard.name}}</label>
<a class="btn btn-default download-link" href="{{downloadUrl}}" target="_blank">
{{d-icon 'download'}}
<span class="d-button-label">
{{i18n "admin.wizard.submissions.download"}}
</span>
<label>{{i18n "admin.wizard.submissions.title" name=wizard.name}}</label>
<a class="btn btn-default download-link" href={{downloadUrl}} target="_blank" rel="noopener noreferrer">
{{d-icon "download"}}
<span class="d-button-label">
{{i18n "admin.wizard.submissions.download"}}
</span>
</a>
</div>
<div class="wizard-submissions">
<table>
<tr>
{{#each fields as |f|}}
<th>{{f}}</th>
{{/each}}
</tr>
{{#each submissions as |s|}}
<thead>
<tr>
{{#each-in s as |k v|}}
<td>{{v}}</td>
{{/each-in}}
{{#each fields as |f|}}
<th>{{f}}</th>
{{/each}}
</tr>
{{/each}}
</thead>
<tbody>
{{#each submissions as |s|}}
<tr>
{{#each-in s as |k v|}}
<td>{{v}}</td>
{{/each-in}}
</tr>
{{/each}}
</tbody>
</table>
</div>
{{/if}}

Datei anzeigen

@ -2,9 +2,9 @@
{{combo-box
value=wizardId
content=wizardList
onChange=(route-action 'changeWizard')
onChange=(route-action "changeWizard")
options=(hash
none='admin.wizard.select'
none="admin.wizard.select"
)}}
</div>

Datei anzeigen

@ -1,10 +1,10 @@
{{#if wizard}}
{{#if wizard}}
<div class="wizard-header large">
{{input
name="name"
value=wizard.name
placeholderKey="admin.wizard.name_placeholder"}}
<div class="wizard-url">
{{#if wizard.name}}
{{#if copiedUrl}}
@ -12,15 +12,15 @@
{{else}}
{{d-button action=(action "copyUrl") class="pull-right no-text" icon="copy"}}
{{/if}}
<a href="{{wizardUrl}}" target="_blank">{{wizardUrl}}</a>
<a href={{wizardUrl}} target="_blank" rel="noopener noreferrer">{{wizardUrl}}</a>
{{/if}}
</div>
</div>
<div class="wizard-basic-details">
<div class="wizard-basic-details">
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.background'}}</label>
<label>{{i18n "admin.wizard.background"}}</label>
</div>
<div class="setting-value">
{{input
@ -30,127 +30,127 @@
class="small"}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.theme_id'}}</label>
<label>{{i18n "admin.wizard.theme_id"}}</label>
</div>
<div class="setting-value">
{{combo-box
content=themes
valueProperty='id'
valueProperty="id"
value=wizard.theme_id
onChange=(action (mut wizard.theme_id))
options=(hash
none='admin.wizard.no_theme'
none="admin.wizard.no_theme"
)}}
</div>
</div>
</div>
<div class="wizard-header medium">
{{i18n 'admin.wizard.label'}}
{{i18n "admin.wizard.label"}}
</div>
<div class="wizard-settings">
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.required'}}</label>
<label>{{i18n "admin.wizard.required"}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=wizard.required}}
<span>{{i18n 'admin.wizard.required_label'}}</span>
{{input type="checkbox" checked=wizard.required}}
<span>{{i18n "admin.wizard.required_label"}}</span>
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.after_signup'}}</label>
<label>{{i18n "admin.wizard.after_signup"}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=wizard.after_signup}}
<span>{{i18n 'admin.wizard.after_signup_label'}}</span>
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.multiple_submissions'}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=wizard.multiple_submissions}}
<span>{{i18n 'admin.wizard.multiple_submissions_label'}}</span>
{{input type="checkbox" checked=wizard.after_signup}}
<span>{{i18n "admin.wizard.after_signup_label"}}</span>
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.prompt_completion'}}</label>
<label>{{i18n "admin.wizard.multiple_submissions"}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=wizard.prompt_completion}}
<span>{{i18n 'admin.wizard.prompt_completion_label'}}</span>
{{input type="checkbox" checked=wizard.multiple_submissions}}
<span>{{i18n "admin.wizard.multiple_submissions_label"}}</span>
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.prompt_completion"}}</label>
</div>
<div class="setting-value">
{{input type="checkbox" checked=wizard.prompt_completion}}
<span>{{i18n "admin.wizard.prompt_completion_label"}}</span>
</div>
</div>
<div class="setting full-inline">
<div class="setting-label">
<label>{{i18n 'admin.wizard.after_time'}}</label>
<label>{{i18n "admin.wizard.after_time"}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=wizard.after_time}}
<span>{{i18n 'admin.wizard.after_time_label'}}</span>
{{input type="checkbox" checked=wizard.after_time}}
<span>{{i18n "admin.wizard.after_time_label"}}</span>
{{d-button
action='setNextSessionScheduled'
action="setNextSessionScheduled"
translatedLabel=nextSessionScheduledLabel
class="btn-after-time"
icon='far-calendar'}}
icon="far-calendar"}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.permitted'}}</label>
<label>{{i18n "admin.wizard.permitted"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=wizard.permitted
options=(hash
context='wizard'
inputTypes='assignment,validation'
groupSelection='output'
userFieldSelection='key'
textSelection='value'
inputConnector='and'
context="wizard"
inputTypes="assignment,validation"
groupSelection="output"
userFieldSelection="key"
textSelection="value"
inputConnector="and"
)}}
</div>
</div>
{{wizard-advanced-toggle showAdvanced=wizard.showAdvanced}}
{{#if wizard.showAdvanced}}
<div class="advanced-settings">
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.save_submissions'}}</label>
<label>{{i18n "admin.wizard.save_submissions"}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=wizard.save_submissions}}
<span>{{i18n 'admin.wizard.save_submissions_label'}}</span>
{{input type="checkbox" checked=wizard.save_submissions}}
<span>{{i18n "admin.wizard.save_submissions_label"}}</span>
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.restart_on_revisit'}}</label>
<label>{{i18n "admin.wizard.restart_on_revisit"}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=wizard.restart_on_revisit}}
<span>{{i18n 'admin.wizard.restart_on_revisit_label'}}</span>
{{input type="checkbox" checked=wizard.restart_on_revisit}}
<span>{{i18n "admin.wizard.restart_on_revisit_label"}}</span>
</div>
</div>
</div>
{{/if}}
</div>
@ -185,19 +185,19 @@
wizardFields=wizardFields}}
{{/each}}
<div class='admin-wizard-buttons'>
<button {{action "save"}} disabled={{disableSave}} class='btn btn-primary'>
{{i18n 'admin.wizard.save'}}
<div class="admin-wizard-buttons">
<button {{action "save"}} disabled={{disableSave}} class="btn btn-primary" type="button">
{{i18n "admin.wizard.save"}}
</button>
{{#unless creating}}
<button {{action "remove"}} class='btn btn-danger remove'>
{{d-icon "far-trash-alt"}}{{i18n 'admin.wizard.remove'}}
<button {{action "remove"}} class="btn btn-danger remove" type="button">
{{d-icon "far-trash-alt"}}{{i18n "admin.wizard.remove"}}
</button>
{{/unless}}
{{conditional-loading-spinner condition=saving size='small'}}
{{conditional-loading-spinner condition=saving size="small"}}
{{#if error}}
<span class="error">{{d-icon "times"}}{{error}}</span>
{{/if}}

Datei anzeigen

@ -2,11 +2,11 @@
{{combo-box
value=wizardListVal
content=wizardList
onChange=(route-action 'changeWizard')
onChange=(route-action "changeWizard")
options=(hash
none='admin.wizard.select'
none="admin.wizard.select"
)}}
{{d-button
action="createWizard"
label="admin.wizard.create"
@ -16,8 +16,8 @@
{{wizard-message
key=messageKey
url=messageUrl
component='wizard'}}
component="wizard"}}
<div class="admin-wizard-container settings">
{{outlet}}
</div>
</div>

Datei anzeigen

@ -1,12 +1,12 @@
{{#admin-nav}}
{{nav-item route='adminWizardsWizard' label='admin.wizard.nav_label'}}
{{nav-item route='adminWizardsCustomFields' label='admin.wizard.custom_field.nav_label'}}
{{nav-item route='adminWizardsSubmissions' label='admin.wizard.submissions.nav_label'}}
{{nav-item route="adminWizardsWizard" label="admin.wizard.nav_label"}}
{{nav-item route="adminWizardsCustomFields" label="admin.wizard.custom_field.nav_label"}}
{{nav-item route="adminWizardsSubmissions" label="admin.wizard.submissions.nav_label"}}
{{#if siteSettings.wizard_apis_enabled}}
{{nav-item route='adminWizardsApi' label='admin.wizard.api.nav_label'}}
{{nav-item route="adminWizardsApi" label="admin.wizard.api.nav_label"}}
{{/if}}
{{nav-item route='adminWizardsLogs' label='admin.wizard.log.nav_label'}}
{{nav-item route='adminWizardsManager' label='admin.wizard.manager.nav_label'}}
{{nav-item route="adminWizardsLogs" label="admin.wizard.log.nav_label"}}
{{nav-item route="adminWizardsManager" label="admin.wizard.manager.nav_label"}}
{{/admin-nav}}
<div class="admin-container">

Datei anzeigen

@ -1,4 +1,4 @@
{{d-button
action="toggleAdvanced"
label='admin.wizard.advanced'
label="admin.wizard.advanced"
class=toggleClass}}

Datei anzeigen

@ -10,7 +10,7 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.type"}}</label>
</div>
<div class="setting-value">
{{combo-box
value=action.type
@ -26,7 +26,7 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.run_after.label"}}</label>
</div>
<div class="setting-value">
{{combo-box
value=action.run_after
@ -38,23 +38,23 @@
{{wizard-message
key=messageKey
url=messageUrl
component='action'}}
component="action"}}
{{#if basicTopicFields}}
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.title"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.title
property='title'
onUpdate=(action 'mappedFieldUpdated')
property="title"
onUpdate=(action "mappedFieldUpdated")
options=(hash
wizardFieldSelection=true
userFieldSelection='key,value'
context='action'
userFieldSelection="key,value"
context="action"
)}}
</div>
</div>
@ -63,21 +63,21 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.post"}}</label>
</div>
<div class="setting-value">
{{combo-box
value=action.post
content=wizardFields
nameProperty='label'
nameProperty="label"
onChange=(action (mut action.post))
options=(hash
none='admin.wizard.selector.placeholder.wizard_field'
none="admin.wizard.selector.placeholder.wizard_field"
isDisabled=showPostBuilder
)}}
<div class="setting-gutter">
{{input type='checkbox' checked=action.post_builder}}
<span>{{i18n 'admin.wizard.action.post_builder.checkbox'}}</span>
{{input type="checkbox" checked=action.post_builder}}
<span>{{i18n "admin.wizard.action.post_builder.checkbox"}}</span>
</div>
</div>
</div>
@ -85,9 +85,9 @@
{{#if action.post_builder}}
<div class="setting full">
<div class="setting-label">
<label>{{i18n 'admin.wizard.action.post_builder.label'}}</label>
<label>{{i18n "admin.wizard.action.post_builder.label"}}</label>
</div>
<div class="setting-value editor">
{{wizard-text-editor
value=action.post_template
@ -102,83 +102,83 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_topic.category"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.category
property='category'
onUpdate=(action 'mappedFieldUpdated')
property="category"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection='key,value'
textSelection="key,value"
wizardFieldSelection=true
userFieldSelection='key,value'
categorySelection='output'
wizardActionSelection='output'
outputDefaultSelection='category'
context='action'
userFieldSelection="key,value"
categorySelection="output"
wizardActionSelection="output"
outputDefaultSelection="category"
context="action"
)}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_topic.tags"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.tags
property='tags'
onUpdate=(action 'mappedFieldUpdated')
property="tags"
onUpdate=(action "mappedFieldUpdated")
options=(hash
tagSelection='output'
outputDefaultSelection='tag'
listSelection='output'
tagSelection="output"
outputDefaultSelection="tag"
listSelection="output"
wizardFieldSelection=true
userFieldSelection='key,value'
context='action'
userFieldSelection="key,value"
context="action"
)}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_topic.visible"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.visible
property='visible'
onUpdate=(action 'mappedFieldUpdated')
property="visible"
onUpdate=(action "mappedFieldUpdated")
options=(hash
wizardFieldSelection=true
userFieldSelection=true
context='action'
context="action"
)}}
</div>
</div>
{{/if}}
{{#if sendMessage}}
{{#if sendMessage}}
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.send_message.recipient"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.recipient
property='recipient'
onUpdate=(action 'mappedFieldUpdated')
property="recipient"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection='value,output'
textSelection="value,output"
wizardFieldSelection=true
userFieldSelection='key,value'
groupSelection='key,value'
userSelection='output'
outputDefaultSelection='user'
context='action'
userFieldSelection="key,value"
groupSelection="key,value"
userSelection="output"
outputDefaultSelection="user"
context="action"
)}}
</div>
</div>
@ -187,21 +187,21 @@
{{#if updateProfile}}
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.action.update_profile.setting'}}</label>
<label>{{i18n "admin.wizard.action.update_profile.setting"}}</label>
</div>
{{wizard-mapper
{{wizard-mapper
inputs=action.profile_updates
property='profile_updates'
onUpdate=(action 'mappedFieldUpdated')
property="profile_updates"
onUpdate=(action "mappedFieldUpdated")
options=(hash
inputTypes='association'
textSelection='value'
userFieldSelection='key'
wizardFieldSelection='value'
wizardActionSelection='value'
keyDefaultSelection='userField'
context='action'
inputTypes="association"
textSelection="value"
userFieldSelection="key"
wizardFieldSelection="value"
wizardActionSelection="value"
keyDefaultSelection="userField"
context="action"
)}}
</div>
{{/if}}
@ -211,7 +211,7 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.send_to_api.api"}}</label>
</div>
<div class="setting-value">
{{combo-box
value=action.api
@ -219,7 +219,7 @@
onChange=(action (mut action.api))
options=(hash
isDisabled=action.custom_title_enabled
none='admin.wizard.action.send_to_api.select_an_api'
none="admin.wizard.action.send_to_api.select_an_api"
)}}
</div>
</div>
@ -228,7 +228,7 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.send_to_api.endpoint"}}</label>
</div>
<div class="setting-value">
{{combo-box
value=action.api_endpoint
@ -236,7 +236,7 @@
onChange=(action (mut action.api_endpoint))
options=(hash
isDisabled=apiEmpty
none='admin.wizard.action.send_to_api.select_an_endpoint'
none="admin.wizard.action.send_to_api.select_an_endpoint"
)}}
</div>
</div>
@ -245,14 +245,14 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.send_to_api.body"}}</label>
</div>
<div class="setting-value">
{{wizard-text-editor
value=action.api_body
previewEnabled=false
barEnabled=false
wizardFields=wizardFields
placeholder='admin.wizard.action.send_to_api.body_placeholder'}}
placeholder="admin.wizard.action.send_to_api.body_placeholder"}}
</div>
</div>
{{/if}}
@ -262,20 +262,20 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.group"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.group
property='group'
onUpdate=(action 'mappedFieldUpdated')
property="group"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection='value,output'
wizardFieldSelection='key,value,assignment'
userFieldSelection='key,value,assignment'
textSelection="value,output"
wizardFieldSelection="key,value,assignment"
userFieldSelection="key,value,assignment"
wizardActionSelection=true
groupSelection='value,output'
outputDefaultSelection='group'
context='action'
groupSelection="value,output"
outputDefaultSelection="group"
context="action"
)}}
</div>
</div>
@ -286,19 +286,19 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.route_to.url"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.url
property='url'
onUpdate=(action 'mappedFieldUpdated')
property="url"
onUpdate=(action "mappedFieldUpdated")
options=(hash
context='action'
context="action"
wizardFieldSelection=true
userFieldSelection='key,value'
groupSelection='key,value'
categorySelection='key,value'
userSelection='key,value'
userFieldSelection="key,value"
groupSelection="key,value"
categorySelection="key,value"
userSelection="key,value"
)}}
</div>
</div>
@ -309,19 +309,19 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.watch_categories.categories"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.categories
property='categories'
onUpdate=(action 'mappedFieldUpdated')
property="categories"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection='key,value'
textSelection="key,value"
wizardFieldSelection=true
wizardActionSelection=true
userFieldSelection='key,value'
categorySelection='output'
context='action'
userFieldSelection="key,value"
categorySelection="output"
context="action"
)}}
</div>
</div>
@ -334,12 +334,12 @@
<div class="setting-value">
{{wizard-mapper
inputs=action.mute_remainder
property='mute_remainder'
onUpdate=(action 'mappedFieldUpdated')
property="mute_remainder"
onUpdate=(action "mappedFieldUpdated")
options=(hash
context='action'
context="action"
wizardFieldSelection=true
userFieldSelection='key,value'
userFieldSelection="key,value"
)}}
</div>
</div>
@ -356,11 +356,11 @@
onChange=(action (mut action.notification_level))
options=(hash
isDisabled=action.custom_title_enabled
none='admin.wizard.action.watch_categories.select_a_notification_level'
none="admin.wizard.action.watch_categories.select_a_notification_level"
)}}
</div>
</div>
<div class="setting full">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.watch_categories.wizard_user"}}</label>
@ -370,7 +370,7 @@
{{input type="checkbox" checked=action.wizard_user}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.watch_categories.usernames"}}</label>
@ -379,13 +379,13 @@
<div class="setting-value">
{{wizard-mapper
inputs=action.usernames
property='usernames'
onUpdate=(action 'mappedFieldUpdated')
property="usernames"
onUpdate=(action "mappedFieldUpdated")
options=(hash
context='action'
context="action"
wizardFieldSelection=true
userFieldSelection='key,value'
userSelection='output'
userFieldSelection="key,value"
userSelection="output"
)}}
</div>
</div>
@ -396,17 +396,17 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.name"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.name
property='name'
onUpdate=(action 'mappedFieldUpdated')
property="name"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
context='action'
context="action"
)}}
</div>
</div>
@ -414,17 +414,17 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.full_name"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.full_name
property='full_name'
onUpdate=(action 'mappedFieldUpdated')
property="full_name"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
context='action'
context="action"
)}}
</div>
</div>
@ -432,17 +432,17 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.title"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.title
property='title'
onUpdate=(action 'mappedFieldUpdated')
property="title"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
context='action'
context="action"
)}}
</div>
</div>
@ -450,17 +450,17 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.bio_raw"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.bio_raw
property='bio_raw'
onUpdate=(action 'mappedFieldUpdated')
property="bio_raw"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
context='action'
context="action"
)}}
</div>
</div>
@ -468,18 +468,18 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.owner_usernames"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.owner_usernames
property='owner_usernames'
onUpdate=(action 'mappedFieldUpdated')
property="owner_usernames"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
userSelection='output'
context='action'
userSelection="output"
context="action"
)}}
</div>
</div>
@ -487,18 +487,18 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.usernames"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.usernames
property='usernames'
onUpdate=(action 'mappedFieldUpdated')
property="usernames"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
userSelection='output'
context='action'
userSelection="output"
context="action"
)}}
</div>
</div>
@ -506,17 +506,17 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.grant_trust_level"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.grant_trust_level
property='grant_trust_level'
onUpdate=(action 'mappedFieldUpdated')
property="grant_trust_level"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
context='action'
context="action"
)}}
</div>
</div>
@ -524,17 +524,17 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.mentionable_level"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.mentionable_level
property='mentionable_level'
onUpdate=(action 'mappedFieldUpdated')
property="mentionable_level"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
context='action'
context="action"
)}}
</div>
</div>
@ -542,17 +542,17 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.messageable_level"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.messageable_level
property='messageable_level'
onUpdate=(action 'mappedFieldUpdated')
property="messageable_level"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
context='action'
context="action"
)}}
</div>
</div>
@ -560,35 +560,35 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.visibility_level"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.visibility_level
property='visibility_level'
onUpdate=(action 'mappedFieldUpdated')
property="visibility_level"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
context='action'
context="action"
)}}
</div>
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_group.members_visibility_level"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.members_visibility_level
property='members_visibility_level'
onUpdate=(action 'mappedFieldUpdated')
property="members_visibility_level"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection=true
context='action'
context="action"
)}}
</div>
</div>
@ -599,116 +599,116 @@
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_category.name"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.name
property='name'
onUpdate=(action 'mappedFieldUpdated')
property="name"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection='key,value'
textSelection="key,value"
wizardFieldSelection=true
userFieldSelection='key,value'
context='action'
userFieldSelection="key,value"
context="action"
)}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_category.slug"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.slug
property='slug'
onUpdate=(action 'mappedFieldUpdated')
property="slug"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection='key,value'
context='action'
userFieldSelection="key,value"
context="action"
)}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_category.color"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.color
property='color'
onUpdate=(action 'mappedFieldUpdated')
property="color"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection='key,value'
context='action'
userFieldSelection="key,value"
context="action"
)}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_category.text_color"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.text_color
property='text_color'
onUpdate=(action 'mappedFieldUpdated')
property="text_color"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection=true
wizardFieldSelection=true
userFieldSelection='key,value'
context='action'
userFieldSelection="key,value"
context="action"
)}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_category.parent_category"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.parent_category_id
property='parent_category_id'
onUpdate=(action 'mappedFieldUpdated')
property="parent_category_id"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection='key,value'
textSelection="key,value"
wizardFieldSelection=true
userFieldSelection='key,value'
categorySelection='output'
context='action'
userFieldSelection="key,value"
categorySelection="output"
context="action"
)}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_category.permissions"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.permissions
property='permissions'
onUpdate=(action 'mappedFieldUpdated')
property="permissions"
onUpdate=(action "mappedFieldUpdated")
options=(hash
inputTypes='association'
inputTypes="association"
textSelection=true
wizardFieldSelection=true
wizardActionSelection='key'
wizardActionSelection="key"
userFieldSelection=true
groupSelection='key'
context='action'
groupSelection="key"
context="action"
)}}
</div>
</div>
@ -719,89 +719,89 @@
{{#if action.showAdvanced}}
<div class="advanced-settings">
{{#if hasCustomFields}}
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.action.custom_fields.label'}}</label>
<label>{{i18n "admin.wizard.action.custom_fields.label"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.custom_fields
property='custom_fields'
onUpdate=(action 'mappedFieldUpdated')
property="custom_fields"
onUpdate=(action "mappedFieldUpdated")
options=(hash
inputTypes='association'
customFieldSelection='key'
wizardFieldSelection='value'
wizardActionSelection='value'
userFieldSelection='value'
keyPlaceholder='admin.wizard.action.custom_fields.key'
context='action'
inputTypes="association"
customFieldSelection="key"
wizardFieldSelection="value"
wizardActionSelection="value"
userFieldSelection="value"
keyPlaceholder="admin.wizard.action.custom_fields.key"
context="action"
)}}
</div>
</div>
{{/if}}
{{#if sendMessage}}
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.required'}}</label>
<label>{{i18n "admin.wizard.required"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=action.required
property='required'
onUpdate=(action 'mappedFieldUpdated')
property="required"
onUpdate=(action "mappedFieldUpdated")
options=(hash
textSelection='value'
textSelection="value"
wizardFieldSelection=true
userFieldSelection=true
groupSelection=true
context='action'
context="action"
)}}
</div>
</div>
{{/if}}
{{#if showPostAdvanced}}
<div class="setting full">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.skip_redirect.label"}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=action.skip_redirect}}
{{input type="checkbox" checked=action.skip_redirect}}
<span>
{{i18n 'admin.wizard.action.skip_redirect.description' type='topic'}}
{{i18n "admin.wizard.action.skip_redirect.description" type="topic"}}
</span>
</div>
</div>
<div class="setting full">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.suppress_notifications.label"}}</label>
</div>
<div class="setting-value">
{{input type='checkbox' checked=action.suppress_notifications}}
{{input type="checkbox" checked=action.suppress_notifications}}
<span>
{{i18n 'admin.wizard.action.suppress_notifications.description' type='topic'}}
{{i18n "admin.wizard.action.suppress_notifications.description" type="topic"}}
</span>
</div>
</div>
{{/if}}
{{#if routeTo}}
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.route_to.code"}}</label>
</div>
<div class="setting-value">
{{input value=action.code}}
</div>

Datei anzeigen

@ -1,227 +1,227 @@
{{#if showUndo}}
{{d-button
action="undoChanges"
icon=undoIcon
label=undoKey
class="undo-changes"}}
{{/if}}
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.label'}}</label>
</div>
<div class="setting-value">
{{input name="label" value=field.label}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.required'}}</label>
</div>
<div class="setting-value">
<span>{{i18n 'admin.wizard.field.required_label'}}</span>
{{input type='checkbox' checked=field.required}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.description'}}</label>
</div>
<div class="setting-value">
{{textarea name="description" value=field.description}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.image'}}</label>
</div>
<div class="setting-value">
{{image-uploader
imageUrl=field.image
onUploadDone=(action "imageUploadDone")
onUploadDeleted=(action "imageUploadDeleted")
type="wizard-step"
class="no-repeat contain-image"}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.type'}}</label>
</div>
<div class="setting-value">
{{combo-box
value=field.type
content=fieldTypes
onChange=(action "changeType")
options=(hash
none="admin.wizard.select_type"
)}}
</div>
</div>
{{wizard-message
key=messageKey
url=messageUrl
component='field'}}
{{#if isTextType}}
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.min_length'}}</label>
</div>
<div class="setting-value">
{{input
type="number"
name="min_length"
value=field.min_length
class="small"}}
</div>
</div>
<div class="setting full">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.max_length'}}</label>
</div>
<div class="setting-value">
{{input
type="number"
name="max_length"
value=field.max_length
class="small"}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.char_counter'}}</label>
</div>
<div class="setting-value">
<span>{{i18n 'admin.wizard.field.char_counter_placeholder'}}</span>
{{input
type="checkbox"
checked=field.char_counter}}
</div>
</div>
{{/if}}
{{#if isUpload}}
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.file_types'}}</label>
</div>
<div class="setting-value">
{{input value=field.file_types class="medium"}}
</div>
</div>
{{/if}}
{{#if showLimit}}
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.limit'}}</label>
</div>
<div class="setting-value">
{{input type="number" value=field.limit class="small"}}
</div>
</div>
{{/if}}
{{#if isDateTime}}
<div class="setting">
<div class="setting-label">
<label>{{{i18n 'admin.wizard.field.date_time_format.label'}}}</label>
</div>
<div class="setting-value">
{{input value=field.format class="medium"}}
<label>{{{i18n 'admin.wizard.field.date_time_format.instructions'}}}</label>
</div>
</div>
{{/if}}
{{#if showPrefill}}
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.prefill'}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=field.prefill
property='prefill'
onUpdate=(action 'mappedFieldUpdated')
options=prefillOptions}}
</div>
</div>
{{/if}}
{{#if showContent}}
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.content'}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=field.content
property='content'
onUpdate=(action 'mappedFieldUpdated')
options=contentOptions}}
</div>
</div>
{{/if}}
{{#if showAdvanced}}
{{wizard-advanced-toggle showAdvanced=field.showAdvanced}}
{{#if field.showAdvanced}}
<div class="advanced-settings">
{{#if isCategory}}
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.property'}}</label>
</div>
<div class="setting-value">
{{combo-box
value=field.property
content=categoryPropertyTypes
onChange=(action (mut field.property))
options=(hash
none='admin.wizard.selector.placeholder.property'
)}}
</div>
</div>
{{/if}}
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.translation'}}</label>
</div>
<div class="setting-value medium">
{{input
name="key"
value=field.key
class="medium"
placeholderKey="admin.wizard.translation_placeholder"}}
</div>
</div>
{{#if validations}}
{{wizard-realtime-validations field=field validations=validations}}
{{/if}}
</div>
{{/if}}
{{/if}}
{{#if showUndo}}
{{d-button
action="undoChanges"
icon=undoIcon
label=undoKey
class="undo-changes"}}
{{/if}}
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.label"}}</label>
</div>
<div class="setting-value">
{{input name="label" value=field.label}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.required"}}</label>
</div>
<div class="setting-value">
<span>{{i18n "admin.wizard.field.required_label"}}</span>
{{input type="checkbox" checked=field.required}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.description"}}</label>
</div>
<div class="setting-value">
{{textarea name="description" value=field.description}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.image"}}</label>
</div>
<div class="setting-value">
{{image-uploader
imageUrl=field.image
onUploadDone=(action "imageUploadDone")
onUploadDeleted=(action "imageUploadDeleted")
type="wizard-step"
class="no-repeat contain-image"}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.type"}}</label>
</div>
<div class="setting-value">
{{combo-box
value=field.type
content=fieldTypes
onChange=(action "changeType")
options=(hash
none="admin.wizard.select_type"
)}}
</div>
</div>
{{wizard-message
key=messageKey
url=messageUrl
component="field"}}
{{#if isTextType}}
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.min_length"}}</label>
</div>
<div class="setting-value">
{{input
type="number"
name="min_length"
value=field.min_length
class="small"}}
</div>
</div>
<div class="setting full">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.max_length"}}</label>
</div>
<div class="setting-value">
{{input
type="number"
name="max_length"
value=field.max_length
class="small"}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.char_counter"}}</label>
</div>
<div class="setting-value">
<span>{{i18n "admin.wizard.field.char_counter_placeholder"}}</span>
{{input
type="checkbox"
checked=field.char_counter}}
</div>
</div>
{{/if}}
{{#if isUpload}}
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.file_types"}}</label>
</div>
<div class="setting-value">
{{input value=field.file_types class="medium"}}
</div>
</div>
{{/if}}
{{#if showLimit}}
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.limit"}}</label>
</div>
<div class="setting-value">
{{input type="number" value=field.limit class="small"}}
</div>
</div>
{{/if}}
{{#if isDateTime}}
<div class="setting">
<div class="setting-label">
<label>{{html-safe (i18n "admin.wizard.field.date_time_format.label")}}</label>
</div>
<div class="setting-value">
{{input value=field.format class="medium"}}
<label>{{html-safe (i18n "admin.wizard.field.date_time_format.instructions")}}</label>
</div>
</div>
{{/if}}
{{#if showPrefill}}
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.prefill"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=field.prefill
property="prefill"
onUpdate=(action "mappedFieldUpdated")
options=prefillOptions}}
</div>
</div>
{{/if}}
{{#if showContent}}
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.content"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=field.content
property="content"
onUpdate=(action "mappedFieldUpdated")
options=contentOptions}}
</div>
</div>
{{/if}}
{{#if showAdvanced}}
{{wizard-advanced-toggle showAdvanced=field.showAdvanced}}
{{#if field.showAdvanced}}
<div class="advanced-settings">
{{#if isCategory}}
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.field.property"}}</label>
</div>
<div class="setting-value">
{{combo-box
value=field.property
content=categoryPropertyTypes
onChange=(action (mut field.property))
options=(hash
none="admin.wizard.selector.placeholder.property"
)}}
</div>
</div>
{{/if}}
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.translation"}}</label>
</div>
<div class="setting-value medium">
{{input
name="key"
value=field.key
class="medium"
placeholderKey="admin.wizard.translation_placeholder"}}
</div>
</div>
{{#if validations}}
{{wizard-realtime-validations field=field validations=validations}}
{{/if}}
</div>
{{/if}}
{{/if}}

Datei anzeigen

@ -1,112 +1,112 @@
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.step.title'}}</label>
</div>
<div class="setting-value">
{{input
name="title"
value=step.title}}
</div>
</div>
<div class="setting full">
<div class="setting-label">
<label>{{i18n 'admin.wizard.step.banner'}}</label>
</div>
<div class="setting-value">
{{image-uploader
imageUrl=step.banner
onUploadDone=(action "bannerUploadDone")
onUploadDeleted=(action "bannerUploadDeleted")
type="wizard-banner"
class="no-repeat contain-image"}}
</div>
</div>
<div class="setting full">
<div class="setting-label">
<label>{{i18n 'admin.wizard.step.description'}}</label>
</div>
<div class="setting-value">
{{wizard-text-editor
value=step.raw_description}}
</div>
</div>
{{wizard-advanced-toggle showAdvanced=step.showAdvanced}}
{{#if step.showAdvanced}}
<div class="advanced-settings">
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.step.required_data.label'}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=step.required_data
options=(hash
inputTypes='validation'
inputConnector='and'
wizardFieldSelection='value'
userFieldSelection='value'
keyPlaceholder="admin.wizard.submission_key"
context='step'
)}}
{{#if step.required_data}}
<div class="required-data-message">
<div class="label">
{{i18n 'admin.wizard.step.required_data.not_permitted_message'}}
</div>
{{input value=step.required_data_message}}
</div>
{{/if}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.step.permitted_params.label'}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=step.permitted_params
options=(hash
pairConnector='set'
inputTypes='association'
keyPlaceholder='admin.wizard.param_key'
valuePlaceholder='admin.wizard.submission_key'
context='step'
)}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n 'admin.wizard.translation'}}</label>
</div>
<div class="setting-value">
{{input
name="key"
value=step.key
placeholderKey="admin.wizard.translation_placeholder"}}
</div>
</div>
</div>
{{/if}}
{{wizard-links
itemType="field"
current=currentField
items=step.fields
parentId=step.id}}
{{#each step.fields as |field|}}
{{wizard-custom-field
field=field
currentFieldId=currentField.id
fieldTypes=fieldTypes
removeField="removeField"
wizardFields=wizardFields}}
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.step.title"}}</label>
</div>
<div class="setting-value">
{{input
name="title"
value=step.title}}
</div>
</div>
<div class="setting full">
<div class="setting-label">
<label>{{i18n "admin.wizard.step.banner"}}</label>
</div>
<div class="setting-value">
{{image-uploader
imageUrl=step.banner
onUploadDone=(action "bannerUploadDone")
onUploadDeleted=(action "bannerUploadDeleted")
type="wizard-banner"
class="no-repeat contain-image"}}
</div>
</div>
<div class="setting full">
<div class="setting-label">
<label>{{i18n "admin.wizard.step.description"}}</label>
</div>
<div class="setting-value">
{{wizard-text-editor
value=step.raw_description}}
</div>
</div>
{{wizard-advanced-toggle showAdvanced=step.showAdvanced}}
{{#if step.showAdvanced}}
<div class="advanced-settings">
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.step.required_data.label"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=step.required_data
options=(hash
inputTypes="validation"
inputConnector="and"
wizardFieldSelection="value"
userFieldSelection="value"
keyPlaceholder="admin.wizard.submission_key"
context="step"
)}}
{{#if step.required_data}}
<div class="required-data-message">
<div class="label">
{{i18n "admin.wizard.step.required_data.not_permitted_message"}}
</div>
{{input value=step.required_data_message}}
</div>
{{/if}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.step.permitted_params.label"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=step.permitted_params
options=(hash
pairConnector="set"
inputTypes="association"
keyPlaceholder="admin.wizard.param_key"
valuePlaceholder="admin.wizard.submission_key"
context="step"
)}}
</div>
</div>
<div class="setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.translation"}}</label>
</div>
<div class="setting-value">
{{input
name="key"
value=step.key
placeholderKey="admin.wizard.translation_placeholder"}}
</div>
</div>
</div>
{{/if}}
{{wizard-links
itemType="field"
current=currentField
items=step.fields
parentId=step.id}}
{{#each step.fields as |field|}}
{{wizard-custom-field
field=field
currentFieldId=currentField.id
fieldTypes=fieldTypes
removeField="removeField"
wizardFields=wizardFields}}
{{/each}}

Datei anzeigen

@ -1,14 +1,14 @@
<div class="wizard-header medium">{{{i18n header}}}</div>
<div class="wizard-header medium">{{html-safe (i18n header)}}</div>
<div class="link-list">
{{#if anyLinks}}
{{#each links as |l|}}
<div data-id='{{l.id}}'>
<div data-id={{l.id}}>
{{d-button action="change" actionParam=l.id translatedLabel=l.label class=l.classes}}
{{d-button action='remove' actionParam=l.id icon='times' class='remove'}}
{{d-button action="remove" actionParam=l.id icon="times" class="remove"}}
</div>
{{/each}}
{{/if}}
{{d-button action='add' label='admin.wizard.add' icon='plus'}}
{{d-button action="add" label="admin.wizard.add" icon="plus"}}
</div>

Datei anzeigen

@ -15,13 +15,13 @@
last=pair.last
inputType=inputType
options=options
removePair=(action 'removePair')
removePair=(action "removePair")
onUpdate=onUpdate}}
{{/each}}
{{#if canAddPair}}
<a {{action 'addPair'}} class="add-pair">
{{d-icon 'plus'}}
<a role="button" {{action "addPair"}} class="add-pair">
{{d-icon "plus"}}
</a>
{{/if}}
</div>
@ -40,7 +40,7 @@
<div class="output mapper-block">
{{wizard-mapper-selector
selectorType='output'
selectorType="output"
inputType=input.type
value=input.output
activeType=input.output_type
@ -49,6 +49,6 @@
</div>
{{/if}}
<a class="remove-input" {{action remove input}}>
{{d-icon 'times'}}
<a role="button" class="remove-input" {{action remove input}}>
{{d-icon "times"}}
</a>

Datei anzeigen

@ -1,6 +1,6 @@
<div class="key mapper-block">
{{wizard-mapper-selector
selectorType='key'
selectorType="key"
inputType=inputType
value=pair.key
activeType=pair.key_type
@ -18,7 +18,7 @@
<div class="value mapper-block">
{{wizard-mapper-selector
selectorType='value'
selectorType="value"
inputType=inputType
value=pair.value
activeType=pair.value_type
@ -31,5 +31,5 @@
{{/if}}
{{#if showRemove}}
<a {{action removePair pair}} class="remove-pair">{{d-icon 'times'}}</a>
<a role="button" {{action removePair pair}} class="remove-pair">{{d-icon "times"}}</a>
{{/if}}

Datei anzeigen

@ -1,16 +1,16 @@
<div class="type-selector">
{{#if hasTypes}}
<a {{action "toggleTypes"}} class="active">
<a role="button" {{action "toggleTypes"}} class="active">
{{activeTypeLabel}}
</a>
{{#if showTypes}}
<div class="selector-types">
{{#each selectorTypes as |item|}}
{{wizard-mapper-selector-type
activeType=activeType
item=item
toggle=(action 'toggleType')}}
toggle=(action "toggleType")}}
{{/each}}
</div>
{{/if}}
@ -38,7 +38,7 @@
allowAny=comboBoxAllowAny
)}}
{{/if}}
{{#if showMultiSelect}}
{{multi-select
content=multiSelectContent
@ -46,14 +46,14 @@
onChange=(action "changeValue")
options=multiSelectOptions}}
{{/if}}
{{#if showList}}
{{wizard-value-list
values=value
addKey=placeholderKey
onChange=(action "changeValue")}}
{{/if}}
{{#if showTag}}
{{tag-chooser
tags=value
@ -63,13 +63,13 @@
filterable=true
)}}
{{/if}}
{{#if showUser}}
{{user-selector
includeMessageableGroups='true'
{{user-selector
includeMessageableGroups="true"
placeholderKey=placeholderKey
usernames=value
autocomplete="discourse"
onChangeCallback=(action "changeUserValue")}}
{{/if}}
</div>
</div>

Datei anzeigen

@ -3,18 +3,18 @@
{{wizard-mapper-connector
connector=input.connector
connectorType="input"
onUpdate=(action 'inputUpdated')}}
onUpdate=(action "inputUpdated")}}
{{/if}}
{{wizard-mapper-input
{{wizard-mapper-input
input=input
options=inputOptions
remove=(action 'remove')
onUpdate=(action 'inputUpdated')}}
remove=(action "remove")
onUpdate=(action "inputUpdated")}}
{{/each}}
{{#if canAdd}}
<span class="add-mapper-input">
{{d-button action='add' label='admin.wizard.add' icon='plus'}}
{{d-button action="add" label="admin.wizard.add" icon="plus"}}
</span>
{{/if}}
{{/if}}

Datei anzeigen

@ -2,13 +2,13 @@
{{#if showIcon}}
{{d-icon icon}}
{{/if}}
<span class="message-content">{{{message}}}</span>
<span class="message-content">{{html-safe message}}</span>
{{#if hasItems}}
<ul>
{{#each items as |item|}}
<li>
<span>{{d-icon item.icon}}</span>
<span>{{{item.html}}}</span>
<span>{{html-safe item.html}}</span>
</li>
{{/each}}
</ul>
@ -17,9 +17,9 @@
{{#if showDocumentation}}
<div class="message-block">
{{d-icon 'question-circle'}}
<a href={{url}} target="_blank">
{{d-icon "question-circle"}}
<a href={{url}} target="_blank" rel="noopener noreferrer">
{{documentation}}
</a>
</div>

Datei anzeigen

@ -1,28 +1,28 @@
<h3>{{i18n 'admin.wizard.field.validations.header'}}</h3>
<h3>{{i18n "admin.wizard.field.validations.header"}}</h3>
<ul>
{{#each-in field.validations as |type props|}}
<li>
<span class="setting-title">
<h4>{{i18n (concat 'admin.wizard.field.validations.' type)}}</h4>
<h4>{{i18n (concat "admin.wizard.field.validations." type)}}</h4>
{{input type="checkbox" checked=props.status}}
{{i18n 'admin.wizard.field.validations.enabled'}}
{{i18n "admin.wizard.field.validations.enabled"}}
</span>
<div class="validation-container">
<div class="validation-section">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.validations.categories'}}</label>
<label>{{i18n "admin.wizard.field.validations.categories"}}</label>
</div>
<div class="setting-value">
{{category-selector
categories=(get this (concat 'validationBuffer.' type '.categories'))
onChange=(action 'updateValidationCategories' type props)
categories=(get this (concat "validationBuffer." type ".categories"))
onChange=(action "updateValidationCategories" type props)
class="wizard"}}
</div>
</div>
<div class="validation-section">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.validations.max_topic_age'}}</label>
<label>{{i18n "admin.wizard.field.validations.max_topic_age"}}</label>
</div>
<div class="setting-value">
{{input type="number" class="time-n-value" value=props.time_n_value}}
@ -35,13 +35,13 @@
</div>
<div class="validation-section">
<div class="setting-label">
<label>{{i18n 'admin.wizard.field.validations.position'}}</label>
<label>{{i18n "admin.wizard.field.validations.position"}}</label>
</div>
<div class="setting-value">
{{radio-button name=(concat type field.id) value="above" selection=props.position}}
{{i18n 'admin.wizard.field.validations.above'}}
{{i18n "admin.wizard.field.validations.above"}}
{{radio-button name=(concat type field.id) value="below" selection=props.position}}
{{i18n 'admin.wizard.field.validations.below'}}
{{i18n "admin.wizard.field.validations.below"}}
</div>
</div>
</div>

Datei anzeigen

@ -9,29 +9,29 @@
action="togglePreview"
translatedLabel=previewLabel}}
{{/if}}
{{#if fieldsEnabled}}
{{d-button
action="togglePopover"
translatedLabel=popoverLabel}}
{{#if showPopover}}
<div class="wizard-editor-gutter-popover">
<label>
{{i18n 'admin.wizard.action.post_builder.user_properties'}}
{{i18n "admin.wizard.action.post_builder.user_properties"}}
{{userPropertyList}}
</label>
{{#if hasWizardFields}}
<label>
{{i18n 'admin.wizard.action.post_builder.wizard_fields'}}
{{i18n "admin.wizard.action.post_builder.wizard_fields"}}
{{wizardFieldList}}
</label>
{{/if}}
{{#if hasWizardActions}}
<label>
{{i18n 'admin.wizard.action.post_builder.wizard_actions'}}
{{i18n "admin.wizard.action.post_builder.wizard_actions"}}
{{wizardActionList}}
</label>
{{/if}}

Datei anzeigen

@ -1,13 +1,13 @@
{{#if field.validations}}
{{#each-in field.validations.above as |type validation|}}
{{component validation.component field=field type=type validation=validation}}
{{/each-in}}
{{yield (hash perform=(action 'perform') autocomplete="off")}}
{{#each-in field.validations.below as |type validation|}}
{{component validation.component field=field type=type validation=validation}}
{{/each-in}}
{{else}}
{{yield}}
{{/if}}
{{#if field.validations}}
{{#each-in field.validations.above as |type validation|}}
{{component validation.component field=field type=type validation=validation}}
{{/each-in}}
{{yield (hash perform=(action "perform") autocomplete="off")}}
{{#each-in field.validations.below as |type validation|}}
{{component validation.component field=field type=type validation=validation}}
{{/each-in}}
{{else}}
{{yield}}
{{/if}}

Datei anzeigen

@ -1,5 +1,5 @@
{{#if isValid}}
{{wizard-i18n validMessageKey}}
{{else}}
{{else}}
{{wizard-i18n invalidMessageKey}}
{{/if}}

Datei anzeigen

@ -25,8 +25,8 @@
{{#if showHyperlinkBox}}
{{wizard-composer-hyperlink
addLink=(action 'addLink')
hideBox=(action 'hideBox')}}
addLink=(action "addLink")
hideBox=(action "hideBox")}}
{{/if}}
{{#if isUploading}}

Datei anzeigen

@ -2,20 +2,20 @@
<h3>{{wizard-i18n "composer.link_dialog_title"}}</h3>
{{input
class="composer-link-name"
placeholder=(wizard-i18n 'composer.link_optional_text')
placeholder=(wizard-i18n "composer.link_optional_text")
type="text"
value=linkName}}
{{input
class="composer-link-url"
placeholder=(wizard-i18n 'composer.link_url_placeholder')
placeholder=(wizard-i18n "composer.link_url_placeholder")
type="text"
value=linkUrl}}
{{d-button
label="wizard_composer.modal_ok"
class="add-link btn-primary"
click=(action 'addLink')}}
click=(action "addLink")}}
{{d-button
label="wizard_composer.modal_cancel"
class="hide-hyperlink-box btn-danger"
click=(action 'hideBox')}}
click=(action "hideBox")}}
</div>

Datei anzeigen

@ -1,15 +1,15 @@
<div class='d-editor-overlay hidden'></div>
<div class="d-editor-overlay hidden"></div>
<div class='d-editor-container'>
<div class="d-editor-container">
{{#if showPreview}}
<div class="d-editor-preview-wrapper {{if forcePreview 'force-preview'}}">
<div class="d-editor-preview-wrapper {{if forcePreview "force-preview"}}">
<div class="d-editor-preview">
{{{preview}}}
{{html-safe preview}}
</div>
</div>
{{else}}
<div class="d-editor-textarea-wrapper">
<div class='d-editor-button-bar'>
<div class="d-editor-button-bar">
{{#each toolbar.groups as |group|}}
{{#each group.buttons as |b|}}
{{#if b.popupMenu}}
@ -24,7 +24,7 @@
)}}
{{else}}
<div>{{d.icon}}</div>
<button class='wizard-btn {{b.className}}' {{action b.action b}} title="{{b.title}}">
<button class="wizard-btn {{b.className}}" {{action b.action b}} title={{b.title}} type="button">
{{d-icon b.icon}}
{{#if b.label}}
<span class="d-button-label">{{wizard-i18n b.label}}</span>
@ -34,7 +34,7 @@
{{/each}}
{{#unless group.lastGroup}}
<div class='d-editor-spacer'></div>
<div class="d-editor-spacer"></div>
{{/unless}}
{{/each}}
</div>

Datei anzeigen

@ -1 +1 @@
{{input type='checkbox' id=field.id checked=field.value tabindex=field.tabindex}}
{{input type="checkbox" id=field.id checked=field.value tabindex=field.tabindex}}

Datei anzeigen

@ -8,11 +8,11 @@
afterRefresh=(action "afterRefresh")}}
<div class="bottom-bar">
<button class='wizard-btn toggle-preview' {{action 'togglePreview'}}>
<span class="d-button-label">{{wizard-i18n togglePreviewLabel}}</span>
</button>
<button class="wizard-btn toggle-preview" {{action "togglePreview"}} type="button">
<span class="d-button-label">{{wizard-i18n togglePreviewLabel}}</span>
</button>
{{#if field.char_counter}}
{{char-counter field.value field.max_length}}
{{/if}}
{{#if field.char_counter}}
{{char-counter field.value field.max_length}}
{{/if}}
</div>

Datei anzeigen

@ -1,4 +1,4 @@
{{combo-box
{{combo-box
class=fieldClass
value=field.value
content=field.content

Datei anzeigen

@ -6,5 +6,5 @@
tabindex=field.tabindex
onChange=(action (mut field.value))
options=(hash
none='group.select'
none="group.select"
)}}

Datei anzeigen

@ -1 +1 @@
{{input type='number' step='0.01' id=field.id value=field.value tabindex=field.tabindex}}
{{input type="number" step="0.01" id=field.id value=field.value tabindex=field.tabindex}}

Datei anzeigen

@ -1,4 +1,4 @@
<label class="wizard-btn wizard-btn-upload-file {{if uploading 'disabled'}}" tabindex="{{field.tabindex}}">
<label class="wizard-btn wizard-btn-upload-file {{if uploading "disabled"}}" tabindex={{field.tabindex}}>
{{#if uploading}}
{{wizard-i18n "wizard.uploading"}}
{{else}}
@ -6,13 +6,13 @@
{{d-icon "upload"}}
{{/if}}
<input disabled={{uploading}} type="file" accept="{{field.file_types}}" style="visibility: hidden; position: absolute;" />
<input disabled={{uploading}} type="file" accept={{field.file_types}} style="visibility: hidden; position: absolute;" >
</label>
{{#if field.value}}
{{#unless isImage}}
{{field.value.original_filename}}
{{else}}
{{#if isImage}}
<img src={{field.value.url}} class="wizard-image-preview">
{{/unless}}
{{else}}
{{field.value.original_filename}}
{{/if}}
{{/if}}

Datei anzeigen

@ -1 +1 @@
{{input type='text' id=field.id value=field.value tabindex=field.tabindex}}
{{input type="text" id=field.id value=field.value tabindex=field.tabindex}}

Datei anzeigen

@ -1,29 +1,29 @@
<label for={{field.id}} class="field-label">
{{{field.label}}}
</label>
{{#if field.image}}
<div class="field-image"><img src="{{field.image}}"></div>
{{/if}}
{{#if field.description}}
<div class='field-description'>{{cookedDescription}}</div>
{{/if}}
{{#field-validators field=field as |validators|}}
{{#if inputComponentName}}
<div class='input-area'>
{{component inputComponentName field=field step=step fieldClass=fieldClass wizard=wizard autocomplete=validators.autocomplete}}
</div>
{{/if}}
{{/field-validators}}
{{#if field.char_counter}}
{{#if textType}}
{{char-counter field.value field.max_length}}
{{/if}}
{{/if}}
{{#if field.errorDescription}}
<div class='field-error-description'>{{{field.errorDescription}}}</div>
{{/if}}
<label for={{field.id}} class="field-label">
{{html-safe field.label}}
</label>
{{#if field.image}}
<div class="field-image"><img src={{field.image}}></div>
{{/if}}
{{#if field.description}}
<div class="field-description">{{cookedDescription}}</div>
{{/if}}
{{#field-validators field=field as |validators|}}
{{#if inputComponentName}}
<div class="input-area">
{{component inputComponentName field=field step=step fieldClass=fieldClass wizard=wizard autocomplete=validators.autocomplete}}
</div>
{{/if}}
{{/field-validators}}
{{#if field.char_counter}}
{{#if textType}}
{{char-counter field.value field.max_length}}
{{/if}}
{{/if}}
{{#if field.errorDescription}}
<div class="field-error-description">{{html-safe field.errorDescription}}</div>
{{/if}}

Datei anzeigen

@ -1,7 +1,7 @@
<div>{{text}}</div>
<div class="no-access-gutter">
<button class='wizard-btn primary return-to-site' {{action 'skip'}}>
{{wizard-i18n 'wizard.return_to_site' siteName=siteName}}
<button class="wizard-btn primary return-to-site" {{action "skip"}} type="button">
{{wizard-i18n "wizard.return_to_site" siteName=siteName}}
{{d-icon "sign-out-alt"}}
</button>
</div>

Datei anzeigen

@ -1,4 +1,4 @@
<a href="{{topic.url}}" target="_blank">
<a href={{topic.url}} target="_blank" rel="noopener noreferrer">
<span class="title">{{html-safe topic.fancy_title}}</span>
<div class="blurb">{{date-node topic.created_at}} - {{html-safe topic.blurb}}</div>
</a>

Datei anzeigen

@ -1,11 +1,11 @@
{{#if showTopics}}
<ul>
{{#each topics as |topic|}}
<li>{{wizard-similar-topic topic=topic}}</li>
{{/each}}
</ul>
{{else}}
<a class="show-topics" {{action "toggleShowTopics"}}>
{{wizard-i18n 'realtime_validations.similar_topics.show'}}
</a>
{{#if showTopics}}
<ul>
{{#each topics as |topic|}}
<li>{{wizard-similar-topic topic=topic}}</li>
{{/each}}
</ul>
{{else}}
<a role="button" class="show-topics" {{action "toggleShowTopics"}}>
{{wizard-i18n "realtime_validations.similar_topics.show"}}
</a>
{{/if}}

Datei anzeigen

@ -1,8 +1,8 @@
<div class='wizard-step-contents'>
<div class="wizard-step-contents">
{{#if step.title}}
<h1 class='wizard-step-title'>{{cookedTitle}}</h1>
<h1 class="wizard-step-title">{{cookedTitle}}</h1>
{{/if}}
{{#if bannerImage}}
<div class="wizard-step-banner">
<img src={{bannerImage}}>
@ -10,46 +10,46 @@
{{/if}}
{{#if step.description}}
<div class='wizard-step-description'>{{cookedDescription}}</div>
<div class="wizard-step-description">{{cookedDescription}}</div>
{{/if}}
{{#wizard-step-form step=step}}
{{#each step.fields as |field index|}}
{{#each step.fields as |field|}}
{{wizard-field field=field step=step wizard=wizard}}
{{/each}}
{{/wizard-step-form}}
</div>
<div class='wizard-step-footer'>
<div class="wizard-step-footer">
<div class='wizard-progress'>
<div class='white'></div>
<div class='black' style={{barStyle}}></div>
<div class='screen'></div>
<div class="wizard-progress">
<div class="white"></div>
<div class="black" style={{barStyle}}></div>
<div class="screen"></div>
<span>{{wizard-i18n "wizard.step" current=step.displayIndex total=wizard.totalSteps}}</span>
</div>
<div class='wizard-buttons'>
<div class="wizard-buttons">
{{#if saving}}
{{loading-spinner size='small'}}
{{loading-spinner size="small"}}
{{else}}
{{#if showQuitButton}}
<a href {{action "quit"}} class='action-link quit' tabindex="{{secondaryButtonIndex}}">{{wizard-i18n "wizard.quit"}}</a>
<a href {{action "quit"}} class="action-link quit" tabindex={{secondaryButtonIndex}}>{{wizard-i18n "wizard.quit"}}</a>
{{/if}}
{{#if showBackButton}}
<a href {{action "backStep"}} class='action-link back' tabindex="{{secondaryButtonIndex}}">{{wizard-i18n "wizard.back"}}</a>
<a href {{action "backStep"}} class="action-link back" tabindex={{secondaryButtonIndex}}>{{wizard-i18n "wizard.back"}}</a>
{{/if}}
{{/if}}
{{#if showNextButton}}
<button class='wizard-btn next primary' {{action "nextStep"}} disabled={{saving}} tabindex="{{primaryButtonIndex}}">
<button type="button" class="wizard-btn next primary" {{action "nextStep"}} disabled={{saving}} tabindex={{primaryButtonIndex}}>
{{wizard-i18n "wizard.next"}}
{{d-icon "chevron-right"}}
</button>
{{/if}}
{{#if showDoneButton}}
<button class='wizard-btn done' {{action "done"}} disabled={{saving}} tabindex="{{primaryButtonIndex}}">
<button type="button" class="wizard-btn done" {{action "done"}} disabled={{saving}} tabindex={{primaryButtonIndex}}>
{{wizard-i18n "wizard.done"}}
</button>
{{/if}}

Datei anzeigen

@ -2,15 +2,15 @@
{{wizard-canvas}}
{{/if}}
<div class='wizard-column'>
<div class='wizard-column-contents'>
<div class="wizard-column">
<div class="wizard-column-contents">
{{outlet}}
</div>
<div class='wizard-footer'>
<div class="wizard-footer">
{{#if customWizard}}
<img src="{{logoUrl}}" style="background-image: initial; width: 33px; height: 33px;"/>
<img src={{logoUrl}} style="background-image: initial; width: 33px; height: 33px;" >
{{else}}
<div class='discourse-logo'></div>
<div class="discourse-logo"></div>
{{/if}}
</div>
</div>

Datei anzeigen

@ -1,15 +1,15 @@
{{#if noWizard}}
{{wizard-no-access text=(wizard-i18n 'wizard.none') wizardId=wizardId}}
{{else}}
{{#if requiresLogin}}
{{wizard-no-access text=(wizard-i18n 'wizard.requires_login') wizardId=wizardId}}
{{else}}
{{#if notPermitted}}
{{wizard-no-access text=(wizard-i18n 'wizard.not_permitted') wizardId=wizardId}}
{{else}}
{{#if completed}}
{{wizard-no-access text=(wizard-i18n 'wizard.completed') wizardId=wizardId}}
{{/if}}
{{/if}}
{{/if}}
{{/if}}
{{#if noWizard}}
{{wizard-no-access text=(wizard-i18n "wizard.none") wizardId=wizardId}}
{{else}}
{{#if requiresLogin}}
{{wizard-no-access text=(wizard-i18n "wizard.requires_login") wizardId=wizardId}}
{{else}}
{{#if notPermitted}}
{{wizard-no-access text=(wizard-i18n "wizard.not_permitted") wizardId=wizardId}}
{{else}}
{{#if completed}}
{{wizard-no-access text=(wizard-i18n "wizard.completed") wizardId=wizardId}}
{{/if}}
{{/if}}
{{/if}}
{{/if}}

Datei anzeigen

@ -4,8 +4,8 @@
{{stepMessage.text}}
</div>
{{#if showReset}}
<a class="reset-wizard" {{action "resetWizard"}}>
{{wizard-i18n 'wizard.reset'}}
<a role="button" class="reset-wizard" {{action "resetWizard"}}>
{{wizard-i18n "wizard.reset"}}
</a>
{{/if}}
</div>

Datei anzeigen

@ -46,7 +46,7 @@
display: flex;
align-items: center;
& > .input-area {
.input-area {
order: 0;
margin: 15px 20px !important;

Datei anzeigen

@ -309,15 +309,15 @@ class CustomWizard::Action
return
end
groups = group_map.reduce([]) do |groups, g|
groups = group_map.reduce([]) do |result, g|
begin
groups.push(Integer(g))
result.push(Integer(g))
rescue ArgumentError
group = Group.find_by(name: g)
groups.push(group.id) if group
result.push(group.id) if group
end
groups
result
end
result = nil

Datei anzeigen

@ -74,7 +74,7 @@ class CustomWizard::Api::Endpoint
headers["Authorization"] = auth_string if auth_string
headers["Content-Type"] = content_type if content_type
connection = Excon.new(URI.parse(URI.encode(endpoint.url)).to_s, headers: headers)
connection = Excon.new(UrlHelper.encode_and_parse(endpoint.url), headers: headers)
params = { method: endpoint.method }

10
package.json Normale Datei
Datei anzeigen

@ -0,0 +1,10 @@
{
"name": "discourse-custom-wizard",
"version": "1.0.0",
"repository": "git@github.com:paviliondev/discourse-custom-wizard.git",
"author": "Discourse",
"license": "MIT",
"devDependencies": {
"eslint-config-discourse": "^1.1.8"
}
}

Datei anzeigen

@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative '../../plugin_helper'
describe CustomWizard::Action do
@ -147,8 +148,8 @@ describe CustomWizard::Action do
end
it 'encodes special characters in the title and body' do
open_composer['title'][0]['output'] = "Title that's special $"
open_composer['post_template'] = "Body & more body & more body"
open_composer['title'][0]['output'] = "Title that's special $".dup
open_composer['post_template'] = "Body & more body & more body".dup
wizard = CustomWizard::Wizard.new(@template, user)

Datei anzeigen

@ -1,3 +1,4 @@
# frozen_string_literal: true
require_relative '../../plugin_helper'
describe CustomWizard::Builder do

Datei anzeigen

@ -5,7 +5,6 @@ require_relative '../../../plugin_helper'
describe ::CustomWizard::RealtimeValidation::SimilarTopics do
let(:post) { create_post(title: "matching similar topic") }
let(:topic) { post.topic }
let(:user) { post.user }
let(:category) { Fabricate(:category) }
let(:cat_post) { create_post(title: "matching similar topic slightly different", category: category) }

Datei anzeigen

@ -98,7 +98,7 @@ describe CustomWizard::Wizard do
CustomWizard::Wizard.new(@permitted_template, trusted_user).permitted?
).to eq(true)
end
it "permits everyone if everyone is permitted" do
@permitted_template['permitted'][0]['output'] = Group::AUTO_GROUPS[:everyone]
expect(
@ -185,7 +185,7 @@ describe CustomWizard::Wizard do
).to eq('I am a user submission')
end
context do
context "class methods" do
before do
CustomWizard::Template.save(@permitted_template, skip_jobs: true)

Datei anzeigen

@ -4,7 +4,7 @@ require_relative '../plugin_helper'
describe InvitesControllerCustomWizard, type: :request do
fab!(:topic) { Fabricate(:topic) }
let(:invite) { Invite.generate(topic.user, email: "angus@mcleod.org", topic: topic) }
let(:template) do
JSON.parse(File.open(
"#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/wizard.json"
@ -19,6 +19,6 @@ describe InvitesControllerCustomWizard, type: :request do
template['after_signup'] = true
CustomWizard::Template.save(template, skip_jobs: true)
put "/invites/show/#{invite.invite_key}.json"
expect(response.parsed_body["redirect_to"]).to eq("/w/super-mega-fun-wizard")
expect(cookies[:destination_url]).to eq("/w/super-mega-fun-wizard")
end
end