Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 11:52:54 +01:00
Namespace CSS and remove uneccessary site attributes
Dieser Commit ist enthalten in:
Ursprung
60823cd87a
Commit
150afb29e0
22 geänderte Dateien mit 1335 neuen und 1504 gelöschten Zeilen
|
@ -3,7 +3,7 @@ class CustomWizard::WizardController < ::ApplicationController
|
|||
before_action :ensure_plugin_enabled
|
||||
before_action :ensure_logged_in, only: [:skip]
|
||||
|
||||
def index
|
||||
def show
|
||||
if wizard.present?
|
||||
render json: CustomWizard::WizardSerializer.new(wizard, scope: guardian, root: false).as_json, status: 200
|
||||
else
|
||||
|
@ -31,26 +31,8 @@ class CustomWizard::WizardController < ::ApplicationController
|
|||
render json: result
|
||||
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
|
||||
|
||||
def ensure_logged_in
|
||||
raise Discourse::NotLoggedIn.new unless current_user.present?
|
||||
end
|
||||
|
||||
def guardian
|
||||
@guardian ||= Guardian.new(current_user, request)
|
||||
end
|
||||
|
||||
def wizard
|
||||
@wizard ||= begin
|
||||
builder = CustomWizard::Builder.new(params[:wizard_id].underscore, current_user)
|
||||
|
@ -61,41 +43,6 @@ class CustomWizard::WizardController < ::ApplicationController
|
|||
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
|
||||
|
||||
def ensure_plugin_enabled
|
||||
|
|
|
@ -9,13 +9,10 @@ class CustomWizard::WizardSerializer < CustomWizard::BasicWizardSerializer
|
|||
:completed,
|
||||
:required,
|
||||
:permitted,
|
||||
:uncategorized_category_id,
|
||||
:categories,
|
||||
:resume_on_revisit
|
||||
|
||||
has_many :steps, serializer: ::CustomWizard::StepSerializer, embed: :objects
|
||||
has_one :user, serializer: ::BasicUserSerializer, embed: :objects
|
||||
has_many :groups, serializer: ::BasicGroupSerializer, embed: :objects
|
||||
|
||||
def completed
|
||||
object.completed?
|
||||
|
@ -46,24 +43,4 @@ class CustomWizard::WizardSerializer < CustomWizard::BasicWizardSerializer
|
|||
def include_steps?
|
||||
!include_completed?
|
||||
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
|
||||
|
|
|
@ -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>
|
|
@ -34,7 +34,7 @@ export default ComposerEditor.extend({
|
|||
if (this.siteSettings.enable_mentions) {
|
||||
$input.autocomplete({
|
||||
template: findRawTemplate("user-selector-autocomplete"),
|
||||
dataSource: (term) => this.userSearchTerm.call(this, term),
|
||||
dataSource: (term) => this._userSearchTerm.call(this, term),
|
||||
key: "@",
|
||||
transformComplete: (v) => v.username || v.name,
|
||||
afterComplete: (value) => {
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
import { findCustomWizard, updateCachedWizard } from "../models/custom-wizard";
|
||||
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) {
|
||||
if (transition.intent.queryParams) {
|
||||
this.set("queryParams", transition.intent.queryParams);
|
||||
|
|
|
@ -4,4 +4,3 @@
|
|||
maximum=field.limit
|
||||
onChange=(action (mut categories))
|
||||
tabindex=field.tabindex}}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{custom-wizard-group-selector
|
||||
groups=wizard.groups
|
||||
groups=site.groups
|
||||
field=field
|
||||
whitelist=field.content
|
||||
value=field.value
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
img.avatar {
|
||||
border-radius: 50%;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
div.ac-wrap {
|
||||
body.custom-wizard {
|
||||
div.ac-wrap {
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
|
@ -146,9 +142,9 @@ div.ac-wrap {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ac-form-result {
|
||||
.ac-form-result {
|
||||
cursor: pointer;
|
||||
background-color: var(--secondary);
|
||||
display: flex;
|
||||
|
@ -172,4 +168,5 @@ div.ac-wrap {
|
|||
i {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
.badge-wrapper {
|
||||
body.custom-wizard {
|
||||
.badge-wrapper {
|
||||
font-size: $font-down-1;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
|
@ -127,4 +128,5 @@
|
|||
color: var(--primary-high);
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
input {
|
||||
body.custom-wizard {
|
||||
input {
|
||||
display: inline-block;
|
||||
padding: 4px 10px;
|
||||
margin-bottom: 9px;
|
||||
|
@ -9,9 +10,9 @@ input {
|
|||
border: 1px solid var(--primary-medium);
|
||||
border-radius: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
textarea {
|
||||
height: auto;
|
||||
background-color: var(--secondary);
|
||||
border: 1px solid var(--primary-medium);
|
||||
|
@ -21,13 +22,14 @@ textarea {
|
|||
box-shadow: shadow("focus");
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
input,
|
||||
select,
|
||||
textarea {
|
||||
color: var(--primary);
|
||||
caret-color: currentColor;
|
||||
width: 100%;
|
||||
|
||||
&[class*="span"] {
|
||||
float: none;
|
||||
|
@ -55,36 +57,9 @@ textarea {
|
|||
margin-bottom: 0;
|
||||
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 {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.body-length {
|
||||
.body-length {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
.wizard-btn {
|
||||
body.custom-wizard {
|
||||
.wizard-btn {
|
||||
border-radius: 2px;
|
||||
font-size: var(--font-0);
|
||||
border: 0;
|
||||
|
@ -38,9 +39,9 @@
|
|||
margin-right: 0.25em;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wizard-btn.primary {
|
||||
.wizard-btn.primary {
|
||||
background-color: var(--tertiary);
|
||||
color: var(--secondary);
|
||||
box-shadow: 0 1px 4px rgba(var(--always-black-rgb), 0.6);
|
||||
|
@ -57,9 +58,9 @@
|
|||
&:disabled {
|
||||
background-color: var(--tertiary-low);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wizard-btn.danger {
|
||||
.wizard-btn.danger {
|
||||
background-color: var(--danger);
|
||||
color: var(--secondary);
|
||||
|
||||
|
@ -75,9 +76,9 @@
|
|||
&:disabled {
|
||||
background-color: var(--danger-low);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.action-link {
|
||||
.action-link {
|
||||
margin-right: 1em;
|
||||
text-decoration: none;
|
||||
color: var(--tertiary);
|
||||
|
@ -85,4 +86,5 @@
|
|||
&:hover {
|
||||
color: var(--tertiary-hover);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,28 +1,29 @@
|
|||
.d-editor-container {
|
||||
body.custom-wizard {
|
||||
.d-editor-container {
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-overlay {
|
||||
.d-editor-overlay {
|
||||
position: absolute;
|
||||
background-color: black;
|
||||
opacity: 0.8;
|
||||
z-index: z("modal", "overlay");
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-modals {
|
||||
.d-editor-modals {
|
||||
position: absolute;
|
||||
z-index: z("modal", "content");
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor {
|
||||
.d-editor {
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor .d-editor-modal {
|
||||
.d-editor .d-editor-modal {
|
||||
min-width: 400px;
|
||||
position: absolute;
|
||||
background-color: var(--secondary);
|
||||
|
@ -40,25 +41,25 @@
|
|||
h3 {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wizard-field-composer .wmd-controls {
|
||||
.wizard-field-composer .wmd-controls {
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.wizard-field-composer.show-preview .d-editor-textarea-column {
|
||||
.wizard-field-composer.show-preview .d-editor-textarea-column {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-textarea-wrapper,
|
||||
.d-editor-preview-wrapper {
|
||||
.d-editor-textarea-wrapper,
|
||||
.d-editor-preview-wrapper {
|
||||
background-color: var(--secondary);
|
||||
border: 1px solid var(--primary-medium);
|
||||
flex: 1;
|
||||
max-width: unset;
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-textarea-wrapper {
|
||||
.d-editor-textarea-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
|
@ -66,9 +67,9 @@
|
|||
textarea {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-preview-wrapper {
|
||||
.d-editor-preview-wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 0;
|
||||
|
@ -76,9 +77,9 @@
|
|||
cursor: default;
|
||||
margin-top: unset;
|
||||
padding-top: unset;
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-button-bar {
|
||||
.d-editor-button-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: none;
|
||||
|
@ -102,17 +103,17 @@
|
|||
.btn.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-spacer {
|
||||
.d-editor-spacer {
|
||||
width: 1px;
|
||||
height: 20px;
|
||||
margin: 0 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-input,
|
||||
.d-editor-preview {
|
||||
.d-editor-input,
|
||||
.d-editor-preview {
|
||||
box-sizing: border-box;
|
||||
flex: 1 1 100%;
|
||||
width: 100%;
|
||||
|
@ -126,44 +127,44 @@
|
|||
border: 0;
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-input {
|
||||
.d-editor-input {
|
||||
border: 0;
|
||||
padding: 10px;
|
||||
height: unset; // overrides core css
|
||||
overflow-x: hidden;
|
||||
resize: none;
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-preview {
|
||||
.d-editor-preview {
|
||||
height: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-plugin {
|
||||
.d-editor-plugin {
|
||||
display: flex;
|
||||
flex: 1 1;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.composing-whisper .d-editor-preview {
|
||||
.composing-whisper .d-editor-preview {
|
||||
font-style: italic;
|
||||
color: var(--primary) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-preview > *:first-child {
|
||||
.d-editor-preview > *:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.hide-preview .d-editor-preview-wrapper {
|
||||
.hide-preview .d-editor-preview-wrapper {
|
||||
display: none;
|
||||
flex: 0;
|
||||
}
|
||||
}
|
||||
|
||||
////
|
||||
////
|
||||
|
||||
.d-editor {
|
||||
.d-editor {
|
||||
min-height: 200px;
|
||||
|
||||
.d-editor-input {
|
||||
|
@ -174,22 +175,22 @@
|
|||
textarea {
|
||||
min-height: calc(200px - 32px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-modal.hidden {
|
||||
.d-editor-modal.hidden {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.d-editor-button-bar .btn {
|
||||
.d-editor-button-bar .btn {
|
||||
border: none;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
}
|
||||
|
||||
.wizard-composer-upload {
|
||||
.wizard-composer-upload {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.wizard-composer-hyperlink {
|
||||
.wizard-composer-hyperlink {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
@ -199,9 +200,9 @@
|
|||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(var(--primary-rgb), 0.8);
|
||||
}
|
||||
}
|
||||
|
||||
.wizard-composer-hyperlink-contents {
|
||||
.wizard-composer-hyperlink-contents {
|
||||
background-color: var(--secondary);
|
||||
padding: 20px;
|
||||
|
||||
|
@ -214,32 +215,32 @@
|
|||
display: block;
|
||||
min-width: 450px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hide-hyperlink-box,
|
||||
.add-link {
|
||||
.hide-hyperlink-box,
|
||||
.add-link {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
#file-uploading {
|
||||
#file-uploading {
|
||||
position: absolute;
|
||||
bottom: 1px;
|
||||
right: 1px;
|
||||
padding: 10px;
|
||||
background-color: var(--secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.bottom-bar {
|
||||
.bottom-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 20px;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
// Markdown table styles for wizard composer preview
|
||||
// Markdown table styles for wizard composer preview
|
||||
|
||||
.cooked,
|
||||
.d-editor-preview {
|
||||
.cooked,
|
||||
.d-editor-preview {
|
||||
a.mention {
|
||||
display: inline-block; // https://bugzilla.mozilla.org/show_bug.cgi?id=1656119
|
||||
font-weight: bold;
|
||||
|
@ -277,4 +278,5 @@
|
|||
padding: 3px 3px 3px 0.5em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// event form
|
||||
|
||||
.event-form {
|
||||
body.custom-wizard {
|
||||
.event-form {
|
||||
width: 585px;
|
||||
max-width: 80vw;
|
||||
|
||||
|
@ -186,43 +185,43 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// datepicker
|
||||
// datepicker
|
||||
|
||||
/*!
|
||||
/*!
|
||||
* Pikaday
|
||||
* Copyright © 2014 David Bushell | BSD & MIT license | http://dbushell.com/
|
||||
*/
|
||||
|
||||
// Variables
|
||||
// Declare any of these variables before importing this SCSS file to easily override defaults
|
||||
// Variables are namespaced with the pd (pikaday) prefix
|
||||
// Variables
|
||||
// Declare any of these variables before importing this SCSS file to easily override defaults
|
||||
// Variables are namespaced with the pd (pikaday) prefix
|
||||
|
||||
// Colours
|
||||
$pd-text-color: var(--primary) !default;
|
||||
$pd-title-color: var(--primary) !default;
|
||||
$pd-title-bg: var(--secondary) !default;
|
||||
$pd-picker-bg: var(--secondary) !default;
|
||||
$pd-picker-border: var(--primary-low) !default;
|
||||
$pd-picker-border-bottom: var(--primary-low) !default;
|
||||
$pd-picker-shadow: rgba(0, 0, 0, 0.5) !default;
|
||||
$pd-th-color: var(--primary) !default;
|
||||
$pd-day-color: var(--primary) !default;
|
||||
$pd-day-bg: var(--secondary) !default;
|
||||
$pd-day-hover-color: var(--primary) !default;
|
||||
$pd-day-hover-bg: var(--tertiary-low) !default;
|
||||
$pd-day-today-color: var(--tertiary) !default;
|
||||
$pd-day-selected-color: var(--secondary) !default;
|
||||
$pd-day-selected-bg: var(--tertiary) !default;
|
||||
$pd-day-selected-shadow: var(--tertiary-low) !default;
|
||||
$pd-day-disabled-color: var(--primary) !default;
|
||||
$pd-week-color: var(--primary) !default;
|
||||
// Colours
|
||||
$pd-text-color: var(--primary) !default;
|
||||
$pd-title-color: var(--primary) !default;
|
||||
$pd-title-bg: var(--secondary) !default;
|
||||
$pd-picker-bg: var(--secondary) !default;
|
||||
$pd-picker-border: var(--primary-low) !default;
|
||||
$pd-picker-border-bottom: var(--primary-low) !default;
|
||||
$pd-picker-shadow: rgba(0, 0, 0, 0.5) !default;
|
||||
$pd-th-color: var(--primary) !default;
|
||||
$pd-day-color: var(--primary) !default;
|
||||
$pd-day-bg: var(--secondary) !default;
|
||||
$pd-day-hover-color: var(--primary) !default;
|
||||
$pd-day-hover-bg: var(--tertiary-low) !default;
|
||||
$pd-day-today-color: var(--tertiary) !default;
|
||||
$pd-day-selected-color: var(--secondary) !default;
|
||||
$pd-day-selected-bg: var(--tertiary) !default;
|
||||
$pd-day-selected-shadow: var(--tertiary-low) !default;
|
||||
$pd-day-disabled-color: var(--primary) !default;
|
||||
$pd-week-color: var(--primary) !default;
|
||||
|
||||
// Font
|
||||
$pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
||||
// Font
|
||||
$pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
||||
|
||||
.pika-single {
|
||||
.pika-single {
|
||||
z-index: 9999;
|
||||
display: block;
|
||||
position: relative;
|
||||
|
@ -240,11 +239,11 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
|||
position: absolute;
|
||||
box-shadow: 0 5px 15px -5px $pd-picker-shadow;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clear child float (pika-lendar), using the famous micro clearfix hack
|
||||
// http://nicolasgallagher.com/micro-clearfix-hack/
|
||||
.pika-single {
|
||||
// clear child float (pika-lendar), using the famous micro clearfix hack
|
||||
// http://nicolasgallagher.com/micro-clearfix-hack/
|
||||
.pika-single {
|
||||
&:before,
|
||||
&:after {
|
||||
content: " ";
|
||||
|
@ -254,15 +253,15 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
|||
&:after {
|
||||
clear: both;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pika-lendar {
|
||||
.pika-lendar {
|
||||
float: left;
|
||||
width: 240px;
|
||||
margin: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.pika-title {
|
||||
.pika-title {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
|
||||
|
@ -276,9 +275,9 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
|||
filter: alpha(opacity=0);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pika-label {
|
||||
.pika-label {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
z-index: 9999;
|
||||
|
@ -290,10 +289,10 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
|||
font-weight: bold;
|
||||
color: $pd-title-color;
|
||||
background-color: $pd-title-bg;
|
||||
}
|
||||
}
|
||||
|
||||
.pika-prev,
|
||||
.pika-next {
|
||||
.pika-prev,
|
||||
.pika-next {
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
|
@ -323,25 +322,25 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
|||
cursor: default;
|
||||
opacity: 0.2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pika-prev,
|
||||
.is-rtl .pika-next {
|
||||
.pika-prev,
|
||||
.is-rtl .pika-next {
|
||||
float: left;
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==");
|
||||
}
|
||||
}
|
||||
|
||||
.pika-next,
|
||||
.is-rtl .pika-prev {
|
||||
.pika-next,
|
||||
.is-rtl .pika-prev {
|
||||
float: right;
|
||||
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=");
|
||||
}
|
||||
}
|
||||
|
||||
.pika-select {
|
||||
.pika-select {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.pika-table {
|
||||
.pika-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
|
@ -365,9 +364,9 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
|||
border-bottom: none;
|
||||
cursor: help;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pika-button {
|
||||
.pika-button {
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
-moz-box-sizing: border-box;
|
||||
|
@ -410,34 +409,34 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
|||
box-shadow: none;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.pika-week {
|
||||
.pika-week {
|
||||
font-size: 11px;
|
||||
color: $pd-week-color;
|
||||
}
|
||||
}
|
||||
|
||||
.is-inrange .pika-button {
|
||||
.is-inrange .pika-button {
|
||||
background: #d5e9f7;
|
||||
}
|
||||
}
|
||||
|
||||
.is-startrange .pika-button {
|
||||
.is-startrange .pika-button {
|
||||
color: var(--secondary);
|
||||
background: #6cb31d;
|
||||
box-shadow: none;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
.is-endrange .pika-button {
|
||||
.is-endrange .pika-button {
|
||||
color: var(--secondary);
|
||||
background: var(--tertiary);
|
||||
box-shadow: none;
|
||||
border-radius: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
// timepicker
|
||||
// timepicker
|
||||
|
||||
.ui-timepicker-wrapper {
|
||||
.ui-timepicker-wrapper {
|
||||
overflow-y: auto;
|
||||
max-height: 150px;
|
||||
width: 6.5em;
|
||||
|
@ -449,66 +448,67 @@ $pd-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
|
|||
outline: none;
|
||||
z-index: 10001;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-timepicker-wrapper.ui-timepicker-with-duration {
|
||||
.ui-timepicker-wrapper.ui-timepicker-with-duration {
|
||||
width: 13em;
|
||||
}
|
||||
}
|
||||
|
||||
.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-30,
|
||||
.ui-timepicker-wrapper.ui-timepicker-with-duration.ui-timepicker-step-60 {
|
||||
width: 11em;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-timepicker-list {
|
||||
.ui-timepicker-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-timepicker-duration {
|
||||
.ui-timepicker-duration {
|
||||
margin-left: 5px;
|
||||
color: #888;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-timepicker-list:hover .ui-timepicker-duration {
|
||||
.ui-timepicker-list:hover .ui-timepicker-duration {
|
||||
color: #888;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-timepicker-list li {
|
||||
.ui-timepicker-list li {
|
||||
padding: 3px 0 3px 5px;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
color: #000;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-timepicker-list:hover .ui-timepicker-selected {
|
||||
.ui-timepicker-list:hover .ui-timepicker-selected {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
li.ui-timepicker-selected,
|
||||
.ui-timepicker-list li:hover,
|
||||
.ui-timepicker-list .ui-timepicker-selected:hover {
|
||||
li.ui-timepicker-selected,
|
||||
.ui-timepicker-list li:hover,
|
||||
.ui-timepicker-list .ui-timepicker-selected:hover {
|
||||
background: #1980ec;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
li.ui-timepicker-selected .ui-timepicker-duration,
|
||||
.ui-timepicker-list li:hover .ui-timepicker-duration {
|
||||
li.ui-timepicker-selected .ui-timepicker-duration,
|
||||
.ui-timepicker-list li:hover .ui-timepicker-duration {
|
||||
color: #ccc;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-timepicker-list li.ui-timepicker-disabled,
|
||||
.ui-timepicker-list li.ui-timepicker-disabled:hover,
|
||||
.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
|
||||
.ui-timepicker-list li.ui-timepicker-disabled,
|
||||
.ui-timepicker-list li.ui-timepicker-disabled:hover,
|
||||
.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
|
||||
color: #888;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-timepicker-list li.ui-timepicker-disabled:hover,
|
||||
.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
|
||||
.ui-timepicker-list li.ui-timepicker-disabled:hover,
|
||||
.ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
|
||||
background: #f2f2f2;
|
||||
}
|
||||
}
|
||||
|
|
5
assets/stylesheets/common/custom/header.scss
Normale Datei
5
assets/stylesheets/common/custom/header.scss
Normale Datei
|
@ -0,0 +1,5 @@
|
|||
body.custom-wizard {
|
||||
.d-header .panel {
|
||||
display: none;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
.location-form-instructions {
|
||||
body.custom-wizard {
|
||||
.location-form-instructions {
|
||||
color: #919191;
|
||||
margin: 5px 0;
|
||||
font-size: 80%;
|
||||
|
@ -7,9 +8,9 @@
|
|||
a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.location-form {
|
||||
.location-form {
|
||||
display: flex;
|
||||
overflow: visible;
|
||||
|
||||
|
@ -70,26 +71,26 @@
|
|||
.geo-map {
|
||||
height: 400px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
input.input-location,
|
||||
div.input-location {
|
||||
input.input-location,
|
||||
div.input-location {
|
||||
max-height: 150px;
|
||||
background-color: var(--secondary);
|
||||
box-shadow: none;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.input-location .select2-choice {
|
||||
.input-location .select2-choice {
|
||||
padding: 2px 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.input-location.input-small {
|
||||
.input-location.input-small {
|
||||
width: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
.location-selector-container {
|
||||
.location-selector-container {
|
||||
position: relative;
|
||||
|
||||
.ac-wrap {
|
||||
|
@ -123,9 +124,9 @@ div.input-location {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.location-form-result {
|
||||
.location-form-result {
|
||||
cursor: pointer;
|
||||
background-color: var(--secondary);
|
||||
display: flex;
|
||||
|
@ -149,9 +150,9 @@ div.input-location {
|
|||
i {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.location-results {
|
||||
.location-results {
|
||||
max-width: 550px;
|
||||
position: relative;
|
||||
|
||||
|
@ -188,4 +189,5 @@ div.input-location {
|
|||
text-align: center;
|
||||
color: #919191;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,24 +1,25 @@
|
|||
span.mentionable-item {
|
||||
body.custom-wizard {
|
||||
span.mentionable-item {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
a.mentionable-item span {
|
||||
a.mentionable-item span {
|
||||
background-color: $primary-low;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
color: $primary;
|
||||
}
|
||||
}
|
||||
|
||||
.ac-mentionable-item ul li a {
|
||||
.ac-mentionable-item ul li a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.ac-mentionable-item-name {
|
||||
.ac-mentionable-item-name {
|
||||
padding-left: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.ac-mentionable-item-image {
|
||||
.ac-mentionable-item-image {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
display: flex;
|
||||
|
@ -29,4 +30,5 @@ a.mentionable-item span {
|
|||
height: 100%;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
.similar-topics-validator {
|
||||
body.custom-wizard {
|
||||
.similar-topics-validator {
|
||||
position: relative;
|
||||
display: flex;
|
||||
|
||||
label {
|
||||
min-height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wizard-similar-topics {
|
||||
.wizard-similar-topics {
|
||||
margin-left: 3px;
|
||||
|
||||
ul {
|
||||
|
@ -37,4 +38,5 @@
|
|||
.show-topics {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ body.custom-wizard {
|
|||
width: 100%;
|
||||
border: 1px solid var(--primary-low-mid);
|
||||
border-radius: 5px;
|
||||
margin: 0 auto;
|
||||
margin: 0 auto 2.5em auto;
|
||||
|
||||
.wizard-field .input-area {
|
||||
margin: 0.5em 0;
|
||||
|
@ -144,12 +144,12 @@ body.custom-wizard {
|
|||
.wizard-column .action-link {
|
||||
color: var(--tertiary);
|
||||
}
|
||||
}
|
||||
|
||||
.no-access-gutter {
|
||||
.no-access-gutter {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
|
||||
/* IE11 hacks */
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
@import "custom/base";
|
||||
@import "custom/wizard";
|
||||
@import "custom/header";
|
||||
@import "custom/step";
|
||||
@import "custom/badges";
|
||||
@import "custom/buttons";
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
CustomWizard::Engine.routes.draw do
|
||||
get 'qunit' => 'wizard#qunit'
|
||||
get ':wizard_id' => 'wizard#index'
|
||||
get ':wizard_id' => 'wizard#show'
|
||||
put ':wizard_id/skip' => 'wizard#skip'
|
||||
get ':wizard_id/steps' => 'wizard#index'
|
||||
get ':wizard_id/steps/:step_id' => 'wizard#index'
|
||||
get ':wizard_id/steps' => 'wizard#show'
|
||||
get ':wizard_id/steps/:step_id' => 'wizard#show'
|
||||
put ':wizard_id/steps/:step_id' => 'steps#update'
|
||||
end
|
||||
|
||||
|
|
|
@ -120,18 +120,6 @@ class CustomWizard::Builder
|
|||
params[:property] = field_template['property']
|
||||
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?
|
||||
content = CustomWizard::Mapper.new(
|
||||
inputs: content_inputs,
|
||||
|
|
|
@ -23,8 +23,6 @@ class CustomWizard::Wizard
|
|||
:restart_on_revisit,
|
||||
:resume_on_revisit,
|
||||
:permitted,
|
||||
:needs_categories,
|
||||
:needs_groups,
|
||||
:steps,
|
||||
:step_ids,
|
||||
:field_ids,
|
||||
|
@ -54,8 +52,6 @@ class CustomWizard::Wizard
|
|||
@after_time_scheduled = attrs['after_time_scheduled']
|
||||
@required = cast_bool(attrs['required'])
|
||||
@permitted = attrs['permitted'] || nil
|
||||
@needs_categories = false
|
||||
@needs_groups = false
|
||||
@theme_id = attrs['theme_id']
|
||||
|
||||
if attrs['theme'].present?
|
||||
|
@ -243,14 +239,6 @@ class CustomWizard::Wizard
|
|||
)
|
||||
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
|
||||
@step_ids = steps.map(&:id)
|
||||
end
|
||||
|
|
Laden …
In neuem Issue referenzieren