1
0
Fork 0

Namespace CSS and remove uneccessary site attributes

Dieser Commit ist enthalten in:
Angus McLeod 2022-07-27 14:40:05 +01:00
Ursprung 60823cd87a
Commit 150afb29e0
22 geänderte Dateien mit 1335 neuen und 1504 gelöschten Zeilen

Datei anzeigen

@ -3,7 +3,7 @@ class CustomWizard::WizardController < ::ApplicationController
before_action :ensure_plugin_enabled before_action :ensure_plugin_enabled
before_action :ensure_logged_in, only: [:skip] before_action :ensure_logged_in, only: [:skip]
def index def show
if wizard.present? if wizard.present?
render json: CustomWizard::WizardSerializer.new(wizard, scope: guardian, root: false).as_json, status: 200 render json: CustomWizard::WizardSerializer.new(wizard, scope: guardian, root: false).as_json, status: 200
else else
@ -31,26 +31,8 @@ class CustomWizard::WizardController < ::ApplicationController
render json: result render json: result
end end
def qunit
raise Discourse::InvalidAccess.new if Rails.env.production?
respond_to do |format|
format.html do
render "default/empty"
end
end
end
protected protected
def ensure_logged_in
raise Discourse::NotLoggedIn.new unless current_user.present?
end
def guardian
@guardian ||= Guardian.new(current_user, request)
end
def wizard def wizard
@wizard ||= begin @wizard ||= begin
builder = CustomWizard::Builder.new(params[:wizard_id].underscore, current_user) builder = CustomWizard::Builder.new(params[:wizard_id].underscore, current_user)
@ -61,41 +43,6 @@ class CustomWizard::WizardController < ::ApplicationController
end end
end end
def wizard_page_title
wizard ? (wizard.name || wizard.id) : I18n.t('wizard.custom_title')
end
def wizard_theme_id
wizard ? wizard.theme_id : nil
end
def wizard_theme_lookup(name)
Theme.lookup_field(wizard_theme_id, view_context.mobile_view? ? :mobile : :desktop, name)
end
def wizard_theme_translations_lookup
Theme.lookup_field(wizard_theme_id, :translations, I18n.locale)
end
def preload_wizard_json
return if request.xhr? || request.format.json?
return if request.method != "GET"
store_preloaded("siteSettings", SiteSetting.client_settings_json)
end
def store_preloaded(key, json)
@preloaded ||= {}
@preloaded[key] = json.gsub("</", "<\\/")
end
## Simplified version of with_resolved_locale in ApplicationController
def with_resolved_locale
locale = current_user ? current_user.effective_locale : SiteSetting.default_locale
I18n.ensure_all_loaded!
I18n.with_locale(locale) { yield }
end
private private
def ensure_plugin_enabled def ensure_plugin_enabled

Datei anzeigen

@ -9,13 +9,10 @@ class CustomWizard::WizardSerializer < CustomWizard::BasicWizardSerializer
:completed, :completed,
:required, :required,
:permitted, :permitted,
:uncategorized_category_id,
:categories,
:resume_on_revisit :resume_on_revisit
has_many :steps, serializer: ::CustomWizard::StepSerializer, embed: :objects has_many :steps, serializer: ::CustomWizard::StepSerializer, embed: :objects
has_one :user, serializer: ::BasicUserSerializer, embed: :objects has_one :user, serializer: ::BasicUserSerializer, embed: :objects
has_many :groups, serializer: ::BasicGroupSerializer, embed: :objects
def completed def completed
object.completed? object.completed?
@ -46,24 +43,4 @@ class CustomWizard::WizardSerializer < CustomWizard::BasicWizardSerializer
def include_steps? def include_steps?
!include_completed? !include_completed?
end end
def include_categories?
object.needs_categories
end
def include_groups?
object.needs_groups
end
def uncategorized_category_id
SiteSetting.uncategorized_category_id
end
def include_uncategorized_category_id?
object.needs_categories
end
def categories
object.categories.map { |c| c.to_h }
end
end end

Datei anzeigen

@ -1,62 +0,0 @@
<html>
<head>
<%= discourse_color_scheme_stylesheets %>
<%= discourse_stylesheet_link_tag :wizard, theme_id: nil %>
<%= discourse_stylesheet_link_tag :wizard_custom %>
<%- if wizard_theme_id.present? %>
<%= discourse_stylesheet_link_tag (mobile_view? ? :mobile_theme : :desktop_theme), theme_id: wizard_theme_id %>
<%- end %>
<%= preload_script "locales/#{I18n.locale}" %>
<%= preload_script "ember_jquery" %>
<%= preload_script "wizard-vendor" %>
<%= preload_script "wizard-custom" %>
<%= preload_script "wizard-raw-templates" %>
<%= preload_script "wizard-plugin" %>
<%= preload_script "pretty-text-bundle" %>
<%= preload_script_url ExtraLocalesController.url("wizard") %>
<%= csrf_meta_tags %>
<%- unless customization_disabled? %>
<%= wizard_theme_translations_lookup %>
<%= raw wizard_theme_lookup("head_tag") %>
<%- end %>
<%= server_plugin_outlet "custom_wizard" %>
<%= tag.meta id: 'data-discourse-setup', data: client_side_setup_data %>
<meta name="discourse_theme_id" content="<%= wizard_theme_id %>">
<meta name="discourse-base-uri" content="<%= Discourse.base_path %>">
<%= render partial: "layouts/head" %>
<title><%= wizard_page_title %></title>
</head>
<body class='custom-wizard wizard'>
<%- unless customization_disabled? %>
<%= raw wizard_theme_lookup("header") %>
<%- end %>
<div id='custom-wizard-main'></div>
<%- unless customization_disabled? %>
<%= raw wizard_theme_lookup("body_tag") %>
<%- end %>
<%- if current_user %>
<%= preload_script 'wizard-custom-start' %>
<%- else %>
<%= preload_script 'wizard-custom-guest' %>
<%- end %>
<div id="svg-sprites" style="display:none;">
<div class="fontawesome">
<%= raw SvgSprite.bundle %>
</div>
</div>
<div class="hidden" id="data-preloaded-wizard" data-preloaded-wizard="<%= preloaded_json %>"></div>
</body>
</html>

Datei anzeigen

@ -34,7 +34,7 @@ export default ComposerEditor.extend({
if (this.siteSettings.enable_mentions) { if (this.siteSettings.enable_mentions) {
$input.autocomplete({ $input.autocomplete({
template: findRawTemplate("user-selector-autocomplete"), template: findRawTemplate("user-selector-autocomplete"),
dataSource: (term) => this.userSearchTerm.call(this, term), dataSource: (term) => this._userSearchTerm.call(this, term),
key: "@", key: "@",
transformComplete: (v) => v.username || v.name, transformComplete: (v) => v.username || v.name,
afterComplete: (value) => { afterComplete: (value) => {

Datei anzeigen

@ -1,8 +1,13 @@
import { findCustomWizard, updateCachedWizard } from "../models/custom-wizard"; import { findCustomWizard, updateCachedWizard } from "../models/custom-wizard";
import I18n from "I18n"; import I18n from "I18n";
import Route from "@ember/routing/route"; import DiscourseRoute from "discourse/routes/discourse";
export default DiscourseRoute.extend({
titleToken() {
const wizard = this.modelFor('custom-wizard');
return wizard ? (wizard.name || wizard.id) : I18n.t('wizard.custom_title');
},
export default Route.extend({
beforeModel(transition) { beforeModel(transition) {
if (transition.intent.queryParams) { if (transition.intent.queryParams) {
this.set("queryParams", transition.intent.queryParams); this.set("queryParams", transition.intent.queryParams);

Datei anzeigen

@ -4,4 +4,3 @@
maximum=field.limit maximum=field.limit
onChange=(action (mut categories)) onChange=(action (mut categories))
tabindex=field.tabindex}} tabindex=field.tabindex}}

Datei anzeigen

@ -1,5 +1,5 @@
{{custom-wizard-group-selector {{custom-wizard-group-selector
groups=wizard.groups groups=site.groups
field=field field=field
whitelist=field.content whitelist=field.content
value=field.value value=field.value

Datei anzeigen

@ -1,9 +1,5 @@
img.avatar { body.custom-wizard {
border-radius: 50%; div.ac-wrap {
vertical-align: middle;
}
div.ac-wrap {
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
overflow: visible; overflow: visible;
@ -146,9 +142,9 @@ div.ac-wrap {
} }
} }
} }
} }
.ac-form-result { .ac-form-result {
cursor: pointer; cursor: pointer;
background-color: var(--secondary); background-color: var(--secondary);
display: flex; display: flex;
@ -172,4 +168,5 @@ div.ac-wrap {
i { i {
margin-right: 5px; margin-right: 5px;
} }
}
} }

Datei anzeigen

@ -1,4 +1,5 @@
.badge-wrapper { body.custom-wizard {
.badge-wrapper {
font-size: $font-down-1; font-size: $font-down-1;
font-weight: bold; font-weight: bold;
white-space: nowrap; white-space: nowrap;
@ -127,4 +128,5 @@
color: var(--primary-high); color: var(--primary-high);
margin-right: 5px; margin-right: 5px;
} }
}
} }

Datei anzeigen

@ -1,4 +1,5 @@
input { body.custom-wizard {
input {
display: inline-block; display: inline-block;
padding: 4px 10px; padding: 4px 10px;
margin-bottom: 9px; margin-bottom: 9px;
@ -9,9 +10,9 @@ input {
border: 1px solid var(--primary-medium); border: 1px solid var(--primary-medium);
border-radius: 0; border-radius: 0;
box-sizing: border-box; box-sizing: border-box;
} }
textarea { textarea {
height: auto; height: auto;
background-color: var(--secondary); background-color: var(--secondary);
border: 1px solid var(--primary-medium); border: 1px solid var(--primary-medium);
@ -21,13 +22,14 @@ textarea {
box-shadow: shadow("focus"); box-shadow: shadow("focus");
outline: 0; outline: 0;
} }
} }
input, input,
select, select,
textarea { textarea {
color: var(--primary); color: var(--primary);
caret-color: currentColor; caret-color: currentColor;
width: 100%;
&[class*="span"] { &[class*="span"] {
float: none; float: none;
@ -55,36 +57,9 @@ textarea {
margin-bottom: 0; margin-bottom: 0;
margin-right: 10px; margin-right: 10px;
} }
}
.spinner {
margin: 20px auto 20px auto;
position: relative;
-webkit-animation: rotate-forever 1s infinite linear;
animation: rotate-forever 1s infinite linear;
height: 30px;
width: 30px;
border: 4px solid var(--primary-low-mid);
border-right-color: transparent;
border-radius: 50%;
&.small {
width: 10px;
height: 10px;
margin: 0;
display: inline-block;
} }
}
@keyframes rotate-forever { .body-length {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.body-length {
text-align: right; text-align: right;
}
} }

Datei anzeigen

@ -1,4 +1,5 @@
.wizard-btn { body.custom-wizard {
.wizard-btn {
border-radius: 2px; border-radius: 2px;
font-size: var(--font-0); font-size: var(--font-0);
border: 0; border: 0;
@ -38,9 +39,9 @@
margin-right: 0.25em; margin-right: 0.25em;
font-size: 0.8em; font-size: 0.8em;
} }
} }
.wizard-btn.primary { .wizard-btn.primary {
background-color: var(--tertiary); background-color: var(--tertiary);
color: var(--secondary); color: var(--secondary);
box-shadow: 0 1px 4px rgba(var(--always-black-rgb), 0.6); box-shadow: 0 1px 4px rgba(var(--always-black-rgb), 0.6);
@ -57,9 +58,9 @@
&:disabled { &:disabled {
background-color: var(--tertiary-low); background-color: var(--tertiary-low);
} }
} }
.wizard-btn.danger { .wizard-btn.danger {
background-color: var(--danger); background-color: var(--danger);
color: var(--secondary); color: var(--secondary);
@ -75,9 +76,9 @@
&:disabled { &:disabled {
background-color: var(--danger-low); background-color: var(--danger-low);
} }
} }
.action-link { .action-link {
margin-right: 1em; margin-right: 1em;
text-decoration: none; text-decoration: none;
color: var(--tertiary); color: var(--tertiary);
@ -85,4 +86,5 @@
&:hover { &:hover {
color: var(--tertiary-hover); color: var(--tertiary-hover);
} }
}
} }

Datei anzeigen

@ -1,28 +1,29 @@
.d-editor-container { body.custom-wizard {
.d-editor-container {
display: flex; display: flex;
flex-grow: 1; flex-grow: 1;
max-width: 100%; max-width: 100%;
} }
.d-editor-overlay { .d-editor-overlay {
position: absolute; position: absolute;
background-color: black; background-color: black;
opacity: 0.8; opacity: 0.8;
z-index: z("modal", "overlay"); z-index: z("modal", "overlay");
} }
.d-editor-modals { .d-editor-modals {
position: absolute; position: absolute;
z-index: z("modal", "content"); z-index: z("modal", "content");
} }
.d-editor { .d-editor {
display: flex; display: flex;
flex-grow: 1; flex-grow: 1;
min-height: 0; min-height: 0;
} }
.d-editor .d-editor-modal { .d-editor .d-editor-modal {
min-width: 400px; min-width: 400px;
position: absolute; position: absolute;
background-color: var(--secondary); background-color: var(--secondary);
@ -40,25 +41,25 @@
h3 { h3 {
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
} }
.wizard-field-composer .wmd-controls { .wizard-field-composer .wmd-controls {
position: relative; position: relative;
} }
.wizard-field-composer.show-preview .d-editor-textarea-column { .wizard-field-composer.show-preview .d-editor-textarea-column {
display: none; display: none;
} }
.d-editor-textarea-wrapper, .d-editor-textarea-wrapper,
.d-editor-preview-wrapper { .d-editor-preview-wrapper {
background-color: var(--secondary); background-color: var(--secondary);
border: 1px solid var(--primary-medium); border: 1px solid var(--primary-medium);
flex: 1; flex: 1;
max-width: unset; max-width: unset;
} }
.d-editor-textarea-wrapper { .d-editor-textarea-wrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
@ -66,9 +67,9 @@
textarea { textarea {
background: transparent; background: transparent;
} }
} }
.d-editor-preview-wrapper { .d-editor-preview-wrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-left: 0; margin-left: 0;
@ -76,9 +77,9 @@
cursor: default; cursor: default;
margin-top: unset; margin-top: unset;
padding-top: unset; padding-top: unset;
} }
.d-editor-button-bar { .d-editor-button-bar {
display: flex; display: flex;
align-items: center; align-items: center;
border-bottom: none; border-bottom: none;
@ -102,17 +103,17 @@
.btn.italic { .btn.italic {
font-style: italic; font-style: italic;
} }
} }
.d-editor-spacer { .d-editor-spacer {
width: 1px; width: 1px;
height: 20px; height: 20px;
margin: 0 5px; margin: 0 5px;
display: inline-block; display: inline-block;
} }
.d-editor-input, .d-editor-input,
.d-editor-preview { .d-editor-preview {
box-sizing: border-box; box-sizing: border-box;
flex: 1 1 100%; flex: 1 1 100%;
width: 100%; width: 100%;
@ -126,44 +127,44 @@
border: 0; border: 0;
outline: 0; outline: 0;
} }
} }
.d-editor-input { .d-editor-input {
border: 0; border: 0;
padding: 10px; padding: 10px;
height: unset; // overrides core css height: unset; // overrides core css
overflow-x: hidden; overflow-x: hidden;
resize: none; resize: none;
} }
.d-editor-preview { .d-editor-preview {
height: auto; height: auto;
padding: 10px; padding: 10px;
} }
.d-editor-plugin { .d-editor-plugin {
display: flex; display: flex;
flex: 1 1; flex: 1 1;
overflow: auto; overflow: auto;
} }
.composing-whisper .d-editor-preview { .composing-whisper .d-editor-preview {
font-style: italic; font-style: italic;
color: var(--primary) !important; color: var(--primary) !important;
} }
.d-editor-preview > *:first-child { .d-editor-preview > *:first-child {
margin-top: 0; margin-top: 0;
} }
.hide-preview .d-editor-preview-wrapper { .hide-preview .d-editor-preview-wrapper {
display: none; display: none;
flex: 0; flex: 0;
} }
//// ////
.d-editor { .d-editor {
min-height: 200px; min-height: 200px;
.d-editor-input { .d-editor-input {
@ -174,22 +175,22 @@
textarea { textarea {
min-height: calc(200px - 32px); min-height: calc(200px - 32px);
} }
} }
.d-editor-modal.hidden { .d-editor-modal.hidden {
display: none; display: none;
} }
.d-editor-button-bar .btn { .d-editor-button-bar .btn {
border: none; border: none;
font-size: 0.9em; font-size: 0.9em;
} }
.wizard-composer-upload { .wizard-composer-upload {
display: none; display: none;
} }
.wizard-composer-hyperlink { .wizard-composer-hyperlink {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -199,9 +200,9 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: rgba(var(--primary-rgb), 0.8); background-color: rgba(var(--primary-rgb), 0.8);
} }
.wizard-composer-hyperlink-contents { .wizard-composer-hyperlink-contents {
background-color: var(--secondary); background-color: var(--secondary);
padding: 20px; padding: 20px;
@ -214,32 +215,32 @@
display: block; display: block;
min-width: 450px; min-width: 450px;
} }
} }
.hide-hyperlink-box, .hide-hyperlink-box,
.add-link { .add-link {
display: inline; display: inline;
} }
#file-uploading { #file-uploading {
position: absolute; position: absolute;
bottom: 1px; bottom: 1px;
right: 1px; right: 1px;
padding: 10px; padding: 10px;
background-color: var(--secondary); background-color: var(--secondary);
} }
.bottom-bar { .bottom-bar {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 20px; margin-top: 20px;
align-items: center; align-items: center;
} }
// Markdown table styles for wizard composer preview // Markdown table styles for wizard composer preview
.cooked, .cooked,
.d-editor-preview { .d-editor-preview {
a.mention { a.mention {
display: inline-block; // https://bugzilla.mozilla.org/show_bug.cgi?id=1656119 display: inline-block; // https://bugzilla.mozilla.org/show_bug.cgi?id=1656119
font-weight: bold; font-weight: bold;
@ -277,4 +278,5 @@
padding: 3px 3px 3px 0.5em; padding: 3px 3px 3px 0.5em;
} }
} }
}
} }

Datei anzeigen

@ -1,6 +1,5 @@
// event form body.custom-wizard {
.event-form {
.event-form {
width: 585px; width: 585px;
max-width: 80vw; max-width: 80vw;
@ -186,43 +185,43 @@
} }
} }
} }
} }
// datepicker // datepicker
/*! /*!
* Pikaday * Pikaday
* Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/ * Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/
*/ */
// Variables // Variables
// Declare any of these variables before importing this SCSS file to easily override defaults // Declare any of these variables before importing this SCSS file to easily override defaults
// Variables are namespaced with the pd (pikaday) prefix // Variables are namespaced with the pd (pikaday) prefix
// Colours // Colours
$pd-text-color: var(--primary) !default; $pd-text-color: var(--primary) !default;
$pd-title-color: var(--primary) !default; $pd-title-color: var(--primary) !default;
$pd-title-bg: var(--secondary) !default; $pd-title-bg: var(--secondary) !default;
$pd-picker-bg: var(--secondary) !default; $pd-picker-bg: var(--secondary) !default;
$pd-picker-border: var(--primary-low) !default; $pd-picker-border: var(--primary-low) !default;
$pd-picker-border-bottom: var(--primary-low) !default; $pd-picker-border-bottom: var(--primary-low) !default;
$pd-picker-shadow: rgba(0, 0, 0, 0.5) !default; $pd-picker-shadow: rgba(0, 0, 0, 0.5) !default;
$pd-th-color: var(--primary) !default; $pd-th-color: var(--primary) !default;
$pd-day-color: var(--primary) !default; $pd-day-color: var(--primary) !default;
$pd-day-bg: var(--secondary) !default; $pd-day-bg: var(--secondary) !default;
$pd-day-hover-color: var(--primary) !default; $pd-day-hover-color: var(--primary) !default;
$pd-day-hover-bg: var(--tertiary-low) !default; $pd-day-hover-bg: var(--tertiary-low) !default;
$pd-day-today-color: var(--tertiary) !default; $pd-day-today-color: var(--tertiary) !default;
$pd-day-selected-color: var(--secondary) !default; $pd-day-selected-color: var(--secondary) !default;
$pd-day-selected-bg: var(--tertiary) !default; $pd-day-selected-bg: var(--tertiary) !default;
$pd-day-selected-shadow: var(--tertiary-low) !default; $pd-day-selected-shadow: var(--tertiary-low) !default;
$pd-day-disabled-color: var(--primary) !default; $pd-day-disabled-color: var(--primary) !default;
$pd-week-color: var(--primary) !default; $pd-week-color: var(--primary) !default;
// Font // Font
$pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default; $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
.pika-single { .pika-single {
z-index: 9999; z-index: 9999;
display: block; display: block;
position: relative; position: relative;
@ -240,11 +239,11 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
position: absolute; position: absolute;
box-shadow: 0 5px 15px -5px $pd-picker-shadow; box-shadow: 0 5px 15px -5px $pd-picker-shadow;
} }
} }
// clear child float (pika-lendar), using the famous micro clearfix hack // clear child float (pika-lendar), using the famous micro clearfix hack
// http://nicolasgallagher.com/micro-clearfix-hack/ // http://nicolasgallagher.com/micro-clearfix-hack/
.pika-single { .pika-single {
&:before, &:before,
&:after { &:after {
content: " "; content: " ";
@ -254,15 +253,15 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
&:after { &:after {
clear: both; clear: both;
} }
} }
.pika-lendar { .pika-lendar {
float: left; float: left;
width: 240px; width: 240px;
margin: 8px; margin: 8px;
} }
.pika-title { .pika-title {
position: relative; position: relative;
text-align: center; text-align: center;
@ -276,9 +275,9 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
filter: alpha(opacity=0); filter: alpha(opacity=0);
opacity: 0; opacity: 0;
} }
} }
.pika-label { .pika-label {
display: inline-block; display: inline-block;
position: relative; position: relative;
z-index: 9999; z-index: 9999;
@ -290,10 +289,10 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
font-weight: bold; font-weight: bold;
color: $pd-title-color; color: $pd-title-color;
background-color: $pd-title-bg; background-color: $pd-title-bg;
} }
.pika-prev, .pika-prev,
.pika-next { .pika-next {
display: block; display: block;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
@ -323,25 +322,25 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
cursor: default; cursor: default;
opacity: 0.2; opacity: 0.2;
} }
} }
.pika-prev, .pika-prev,
.is-rtl .pika-next { .is-rtl .pika-next {
float: left; float: left;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg=="); background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==");
} }
.pika-next, .pika-next,
.is-rtl .pika-prev { .is-rtl .pika-prev {
float: right; float: right;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII="); background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=");
} }
.pika-select { .pika-select {
display: inline-block; display: inline-block;
} }
.pika-table { .pika-table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
@ -365,9 +364,9 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
border-bottom: none; border-bottom: none;
cursor: help; cursor: help;
} }
} }
.pika-button { .pika-button {
cursor: pointer; cursor: pointer;
display: block; display: block;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
@ -410,34 +409,34 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
box-shadow: none; box-shadow: none;
border-radius: 3px; border-radius: 3px;
} }
} }
.pika-week { .pika-week {
font-size: 11px; font-size: 11px;
color: $pd-week-color; color: $pd-week-color;
} }
.is-inrange .pika-button { .is-inrange .pika-button {
background: #d5e9f7; background: #d5e9f7;
} }
.is-startrange .pika-button { .is-startrange .pika-button {
color: var(--secondary); color: var(--secondary);
background: #6cb31d; background: #6cb31d;
box-shadow: none; box-shadow: none;
border-radius: 3px; border-radius: 3px;
} }
.is-endrange .pika-button { .is-endrange .pika-button {
color: var(--secondary); color: var(--secondary);
background: var(--tertiary); background: var(--tertiary);
box-shadow: none; box-shadow: none;
border-radius: 3px; border-radius: 3px;
} }
// timepicker // timepicker
.ui-timepicker-wrapper { .ui-timepicker-wrapper {
overflow-y: auto; overflow-y: auto;
max-height: 150px; max-height: 150px;
width: 6.5em; width: 6.5em;
@ -449,66 +448,67 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
outline: none; outline: none;
z-index: 10001; z-index: 10001;
margin: 0; margin: 0;
} }
.ui-timepicker-wrapper.ui-timepicker-with-duration { .ui-timepicker-wrapper.ui-timepicker-with-duration {
width: 13em; width: 13em;
} }
.ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-30, .ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-30,
.ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-60 { .ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-60 {
width: 11em; width: 11em;
} }
.ui-timepicker-list { .ui-timepicker-list {
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
} }
.ui-timepicker-duration { .ui-timepicker-duration {
margin-left: 5px; margin-left: 5px;
color: #888; color: #888;
} }
.ui-timepicker-list:hover .ui-timepicker-duration { .ui-timepicker-list:hover .ui-timepicker-duration {
color: #888; color: #888;
} }
.ui-timepicker-list li { .ui-timepicker-list li {
padding: 3px 0 3px 5px; padding: 3px 0 3px 5px;
cursor: pointer; cursor: pointer;
white-space: nowrap; white-space: nowrap;
color: #000; color: #000;
list-style: none; list-style: none;
margin: 0; margin: 0;
} }
.ui-timepicker-list:hover .ui-timepicker-selected { .ui-timepicker-list:hover .ui-timepicker-selected {
background: #fff; background: #fff;
color: #000; color: #000;
} }
li.ui-timepicker-selected, li.ui-timepicker-selected,
.ui-timepicker-list li:hover, .ui-timepicker-list li:hover,
.ui-timepicker-list .ui-timepicker-selected:hover { .ui-timepicker-list .ui-timepicker-selected:hover {
background: #1980ec; background: #1980ec;
color: #fff; color: #fff;
} }
li.ui-timepicker-selected .ui-timepicker-duration, li.ui-timepicker-selected .ui-timepicker-duration,
.ui-timepicker-list li:hover .ui-timepicker-duration { .ui-timepicker-list li:hover .ui-timepicker-duration {
color: #ccc; color: #ccc;
} }
.ui-timepicker-list li.ui-timepicker-disabled, .ui-timepicker-list li.ui-timepicker-disabled,
.ui-timepicker-list li.ui-timepicker-disabled:hover, .ui-timepicker-list li.ui-timepicker-disabled:hover,
.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled { .ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
color: #888; color: #888;
cursor: default; cursor: default;
} }
.ui-timepicker-list li.ui-timepicker-disabled:hover, .ui-timepicker-list li.ui-timepicker-disabled:hover,
.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled { .ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
background: #f2f2f2; background: #f2f2f2;
}
} }

Datei anzeigen

@ -0,0 +1,5 @@
body.custom-wizard {
.d-header .panel {
display: none;
}
}

Datei anzeigen

@ -1,4 +1,5 @@
.location-form-instructions { body.custom-wizard {
.location-form-instructions {
color: #919191; color: #919191;
margin: 5px 0; margin: 5px 0;
font-size: 80%; font-size: 80%;
@ -7,9 +8,9 @@
a { a {
text-decoration: underline; text-decoration: underline;
} }
} }
.location-form { .location-form {
display: flex; display: flex;
overflow: visible; overflow: visible;
@ -70,26 +71,26 @@
.geo-map { .geo-map {
height: 400px; height: 400px;
} }
} }
input.input-location, input.input-location,
div.input-location { div.input-location {
max-height: 150px; max-height: 150px;
background-color: var(--secondary); background-color: var(--secondary);
box-shadow: none; box-shadow: none;
box-sizing: border-box; box-sizing: border-box;
margin: 0; margin: 0;
} }
.input-location .select2-choice { .input-location .select2-choice {
padding: 2px 5px; padding: 2px 5px;
} }
.input-location.input-small { .input-location.input-small {
width: 100px; width: 100px;
} }
.location-selector-container { .location-selector-container {
position: relative; position: relative;
.ac-wrap { .ac-wrap {
@ -123,9 +124,9 @@ div.input-location {
} }
} }
} }
} }
.location-form-result { .location-form-result {
cursor: pointer; cursor: pointer;
background-color: var(--secondary); background-color: var(--secondary);
display: flex; display: flex;
@ -149,9 +150,9 @@ div.input-location {
i { i {
margin-right: 5px; margin-right: 5px;
} }
} }
.location-results { .location-results {
max-width: 550px; max-width: 550px;
position: relative; position: relative;
@ -188,4 +189,5 @@ div.input-location {
text-align: center; text-align: center;
color: #919191; color: #919191;
} }
}
} }

Datei anzeigen

@ -1,24 +1,25 @@
span.mentionable-item { body.custom-wizard {
span.mentionable-item {
font-weight: bold; font-weight: bold;
} }
a.mentionable-item span { a.mentionable-item span {
background-color: $primary-low; background-color: $primary-low;
padding: 3px; padding: 3px;
border-radius: 3px; border-radius: 3px;
color: $primary; color: $primary;
} }
.ac-mentionable-item ul li a { .ac-mentionable-item ul li a {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.ac-mentionable-item-name { .ac-mentionable-item-name {
padding-left: 0.5em; padding-left: 0.5em;
} }
.ac-mentionable-item-image { .ac-mentionable-item-image {
width: 25px; width: 25px;
height: 25px; height: 25px;
display: flex; display: flex;
@ -29,4 +30,5 @@ a.mentionable-item span {
height: 100%; height: 100%;
object-fit: contain; object-fit: contain;
} }
}
} }

Datei anzeigen

@ -1,13 +1,14 @@
.similar-topics-validator { body.custom-wizard {
.similar-topics-validator {
position: relative; position: relative;
display: flex; display: flex;
label { label {
min-height: 20px; min-height: 20px;
} }
} }
.wizard-similar-topics { .wizard-similar-topics {
margin-left: 3px; margin-left: 3px;
ul { ul {
@ -37,4 +38,5 @@
.show-topics { .show-topics {
cursor: pointer; cursor: pointer;
} }
}
} }

Datei anzeigen

@ -16,7 +16,7 @@ body.custom-wizard {
width: 100%; width: 100%;
border: 1px solid var(--primary-low-mid); border: 1px solid var(--primary-low-mid);
border-radius: 5px; border-radius: 5px;
margin: 0 auto; margin: 0 auto 2.5em auto;
.wizard-field .input-area { .wizard-field .input-area {
margin: 0.5em 0; margin: 0.5em 0;
@ -144,12 +144,12 @@ body.custom-wizard {
.wizard-column .action-link { .wizard-column .action-link {
color: var(--tertiary); color: var(--tertiary);
} }
}
.no-access-gutter { .no-access-gutter {
margin-top: 10px; margin-top: 10px;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
}
} }
/* IE11 hacks */ /* IE11 hacks */

Datei anzeigen

@ -1,5 +1,6 @@
@import "custom/base"; @import "custom/base";
@import "custom/wizard"; @import "custom/wizard";
@import "custom/header";
@import "custom/step"; @import "custom/step";
@import "custom/badges"; @import "custom/badges";
@import "custom/buttons"; @import "custom/buttons";

Datei anzeigen

@ -1,10 +1,9 @@
# frozen_string_literal: true # frozen_string_literal: true
CustomWizard::Engine.routes.draw do CustomWizard::Engine.routes.draw do
get 'qunit' => 'wizard#qunit' get ':wizard_id' => 'wizard#show'
get ':wizard_id' => 'wizard#index'
put ':wizard_id/skip' => 'wizard#skip' put ':wizard_id/skip' => 'wizard#skip'
get ':wizard_id/steps' => 'wizard#index' get ':wizard_id/steps' => 'wizard#show'
get ':wizard_id/steps/:step_id' => 'wizard#index' get ':wizard_id/steps/:step_id' => 'wizard#show'
put ':wizard_id/steps/:step_id' => 'steps#update' put ':wizard_id/steps/:step_id' => 'steps#update'
end end

Datei anzeigen

@ -120,18 +120,6 @@ class CustomWizard::Builder
params[:property] = field_template['property'] params[:property] = field_template['property']
end end
if field_template['type'] === 'category' || (
field_template['validations'] &&
field_template['validations']['similar_topics'] &&
field_template['validations']['similar_topics']['categories'].present?
)
@wizard.needs_categories = true
end
if field_template['type'] === 'group'
@wizard.needs_groups = true
end
if (content_inputs = field_template['content']).present? if (content_inputs = field_template['content']).present?
content = CustomWizard::Mapper.new( content = CustomWizard::Mapper.new(
inputs: content_inputs, inputs: content_inputs,

Datei anzeigen

@ -23,8 +23,6 @@ class CustomWizard::Wizard
:restart_on_revisit, :restart_on_revisit,
:resume_on_revisit, :resume_on_revisit,
:permitted, :permitted,
:needs_categories,
:needs_groups,
:steps, :steps,
:step_ids, :step_ids,
:field_ids, :field_ids,
@ -54,8 +52,6 @@ class CustomWizard::Wizard
@after_time_scheduled = attrs['after_time_scheduled'] @after_time_scheduled = attrs['after_time_scheduled']
@required = cast_bool(attrs['required']) @required = cast_bool(attrs['required'])
@permitted = attrs['permitted'] || nil @permitted = attrs['permitted'] || nil
@needs_categories = false
@needs_groups = false
@theme_id = attrs['theme_id'] @theme_id = attrs['theme_id']
if attrs['theme'].present? if attrs['theme'].present?
@ -243,14 +239,6 @@ class CustomWizard::Wizard
) )
end end
def categories
@categories ||= ::Site.new(Guardian.new(user)).categories
end
def groups
@groups ||= ::Site.new(Guardian.new(user)).groups
end
def update_step_ids def update_step_ids
@step_ids = steps.map(&:id) @step_ids = steps.map(&:id)
end end