Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cms/sass/components/_accordion.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.accordion:focus-within {
border: $grapefruit solid;
outline: $grapefruit solid;
}
3 changes: 0 additions & 3 deletions cms/sass/components/_filters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
}

.filter__choices {
max-height: $spacing-07;
height: auto;
overflow-y: auto;
padding-top: $spacing-01;
@include unstyled-list;

Expand Down
42 changes: 31 additions & 11 deletions portality/forms/application_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,6 @@ class FieldSetDefinitions:
FieldDefinitions.JOURNAL_URL["name"],
FieldDefinitions.PISSN["name"],
FieldDefinitions.EISSN["name"],
FieldDefinitions.KEYWORDS["name"],
FieldDefinitions.LANGUAGE["name"]
]
}
Expand Down Expand Up @@ -2174,7 +2173,7 @@ class FieldSetDefinitions:
FieldDefinitions.AIMS_SCOPE_URL["name"],
FieldDefinitions.EDITORIAL_BOARD_URL["name"],
FieldDefinitions.AUTHOR_INSTRUCTIONS_URL["name"],
FieldDefinitions.PUBLICATION_TIME_WEEKS["name"]
FieldDefinitions.PUBLICATION_TIME_WEEKS["name"],
]
}

Expand Down Expand Up @@ -2305,11 +2304,21 @@ class FieldSetDefinitions:
}

# ~~->$ Subject:FieldSet~~
SUBJECT = {
"name": "subject",
"label": "Subject classification",
SUBJECT_AND_KEYWORDS = {
"name": "subject_and_keywords",
"label": "Subject classification and keywords",
"fields": [
FieldDefinitions.SUBJECT["name"]
FieldDefinitions.SUBJECT["name"],
FieldDefinitions.KEYWORDS["name"]
]
}

# ~~->$ Subject:FieldSet~~
KEYWORDS = {
"name": "keywords",
"label": "Keywords",
"fields": [
FieldDefinitions.KEYWORDS["name"]
]
}

Expand Down Expand Up @@ -2372,6 +2381,7 @@ class ApplicationContextDefinitions:
# ~~->$ NewApplication:FormContext~~
# ~~^-> ApplicationForm:Crosswalk~~
# ~~^-> NewApplication:FormProcessor~~

PUBLIC = {
"name": "public",
"fieldsets": [
Expand Down Expand Up @@ -2411,13 +2421,19 @@ class ApplicationContextDefinitions:
UPDATE["name"] = "update_request"
UPDATE["processor"] = application_processors.PublisherUpdateRequest
UPDATE["templates"]["form"] = templates.PUBLISHER_UPDATE_REQUEST_FORM
UPDATE["fieldsets"] += [
FieldSetDefinitions.KEYWORDS["name"],
]

# ~~->$ ReadOnlyApplication:FormContext~~
# ~~^-> NewApplication:FormContext~~
READ_ONLY = deepcopy(PUBLIC)
READ_ONLY["name"] = "application_read_only"
READ_ONLY["processor"] = application_processors.NewApplication # FIXME: enter the real processor
READ_ONLY["templates"]["form"] = templates.PUBLISHER_READ_ONLY_APPLICATION
READ_ONLY["fieldsets"] += [
FieldSetDefinitions.KEYWORDS["name"],
]

# ~~->$ AssociateEditorApplication:FormContext~~
# ~~^-> NewApplication:FormContext~~
Expand All @@ -2426,7 +2442,7 @@ class ApplicationContextDefinitions:
ASSOCIATE["name"] = "associate_editor"
ASSOCIATE["fieldsets"] += [
FieldSetDefinitions.STATUS["name"],
FieldSetDefinitions.SUBJECT["name"],
FieldSetDefinitions.SUBJECT_AND_KEYWORDS["name"],
FieldSetDefinitions.NOTES["name"]
]
ASSOCIATE["processor"] = application_processors.AssociateApplication
Expand All @@ -2440,7 +2456,7 @@ class ApplicationContextDefinitions:
EDITOR["fieldsets"] += [
FieldSetDefinitions.STATUS["name"],
FieldSetDefinitions.REVIEWERS["name"],
FieldSetDefinitions.SUBJECT["name"],
FieldSetDefinitions.SUBJECT_AND_KEYWORDS["name"],
FieldSetDefinitions.NOTES["name"]
]
EDITOR["processor"] = application_processors.EditorApplication
Expand All @@ -2458,12 +2474,15 @@ class ApplicationContextDefinitions:
FieldSetDefinitions.STATUS["name"],
FieldSetDefinitions.REVIEWERS["name"],
FieldSetDefinitions.CONTINUATIONS["name"],
FieldSetDefinitions.SUBJECT["name"],
FieldSetDefinitions.SUBJECT_AND_KEYWORDS["name"],
FieldSetDefinitions.NOTES["name"],
]
MANED["processor"] = application_processors.AdminApplication
MANED["templates"]["form"] = templates.MANED_APPLICATION_FORM

# now we can update the Public Context with the correct "About" fieldset
PUBLIC["fieldsets"].append(FieldSetDefinitions.KEYWORDS["name"])


class JournalContextDefinitions:
# ~~->$ ReadOnlyJournal:FormContext~~
Expand All @@ -2487,7 +2506,9 @@ class JournalContextDefinitions:
FieldSetDefinitions.OTHER_FEES["name"],
FieldSetDefinitions.ARCHIVING_POLICY["name"],
FieldSetDefinitions.REPOSITORY_POLICY["name"],
FieldSetDefinitions.UNIQUE_IDENTIFIERS["name"]
FieldSetDefinitions.UNIQUE_IDENTIFIERS["name"],
FieldSetDefinitions.SUBJECT_AND_KEYWORDS["name"],

],
"templates": {
"form": templates.MANED_READ_ONLY_JOURNAL,
Expand All @@ -2511,7 +2532,6 @@ class JournalContextDefinitions:
# ~~^-> AssEdJournal:FormProcessor~~
ASSOCIATE = deepcopy(ADMIN_READ_ONLY)
ASSOCIATE["fieldsets"] += [
FieldSetDefinitions.SUBJECT["name"],
FieldSetDefinitions.NOTES["name"]
]
ASSOCIATE["name"] = "associate_editor"
Expand Down
35 changes: 2 additions & 33 deletions portality/static/js/formulaic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1219,25 +1219,12 @@ var formulaic = {
var containerId = edges.css_id(this.ns, "container");
var containerSelector = edges.css_id_selector(this.ns, "container");
var widgetId = edges.css_id(this.ns, this.fieldDef.name);
var modalOpenClass = edges.css_classes(this.ns, "open");
var closeClass = edges.css_classes(this.ns, "close");

this.input = $("[name=" + this.fieldDef.name + "]");
this.input.hide();

this.input.after('<a href="#" class="button button--tertiary ' + modalOpenClass + '">Open Subject Classifier</a>');
this.input.after(`<div class="modal" id="` + containerId + `" tabindex="-1" role="dialog" style="display: none; padding-right: 0px; overflow-y: scroll">
<div class="modal__dialog" role="document">
<header class="flex-space-between modal__heading">
<h3 class="modal__title">
“Subject classifications”
</h3>
<span type="button" data-dismiss="modal" class="` + closeClass + ` type-01"><span class="sr-only">Close</span>&times;</span>
</header>
<p class="alert">Selecting a subject will not automatically select its sub-categories.</p>
<div id="` + widgetId + `"></div>
<button type="button" data-dismiss="modal" class="` + closeClass + `">Add subject(s)</button>
</div>
this.input.after(`<div id="` + containerId + `">
<div id="` + widgetId + `"></div>
</div>`);


Expand Down Expand Up @@ -1279,7 +1266,6 @@ var formulaic = {
return node.display.toLowerCase();
},
renderer: doaj.renderers.newSubjectBrowserRenderer({
title: "Subjects",
open: true,
showCounts: false,
togglable: false
Expand All @@ -1304,23 +1290,6 @@ var formulaic = {
}
}
});

var modalOpenSelector = edges.css_class_selector(this.ns, "open");
edges.on(modalOpenSelector, "click", this, "openModal");

var closeSelector = edges.css_class_selector(this.ns, "close");
edges.on(closeSelector, "click", this, "closeModal");
};

this.openModal = function () {
var containerSelector = edges.css_id_selector(this.ns, "container");
$(containerSelector).show();
};

this.closeModal = function () {
var containerSelector = edges.css_id_selector(this.ns, "container");
$(containerSelector).hide();
this.input.trigger("change");
};

this.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,10 @@ <h2 class="form__header"> {{ fs.label }}</h2>
{% set field_template = f.template %}
{% include field_template %}
{% endfor %}

{% set fs = formulaic_context.fieldset("plagiarism") %}
<h2 class="form__header"> {{ fs.label }}</h2>
{% for f in fs.fields() %}
{% set field_template = f.template %}
{% include field_template %}
{% endfor %}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
<legend class="form__legend"><div><span data-feather="user-check"></span> Editorial</div></legend>

{% set fs = formulaic_context.fieldset("peer_review") %}
<h2 class="form__header"> {{ fs.label }}</h2>
{% for f in fs.fields() %}
{% set field_template = f.template %}
{% include field_template %}
{% endfor %}
{% set fs = formulaic_context.fieldset("plagiarism") %}
<h2 class="form__header"> {{ fs.label }}</h2>
{% for f in fs.fields() %}
{% set field_template = f.template %}
Expand All @@ -23,3 +17,21 @@ <h2 class="form__header"> {{ fs.label }}</h2>
{% set field_template = f.template %}
{% include field_template %}
{% endfor %}

{% set ns = namespace(fs=None) %}
{% if formulaic_context.fieldset("keywords") %}
{% set ns.fs = formulaic_context.fieldset("keywords") %}
{% elif formulaic_context.fieldset("subject_and_keywords") %}
{% set ns.fs = formulaic_context.fieldset("subject_and_keywords") %}
{% endif %}

{% set fs = ns.fs %}
<h2 class="form__header"> {{ fs.label }}</h2>
{% for f in fs.fields() %}
{% set field_template = f.template %}
{% include field_template %}
{% if f.name == "subject" %}
<p>Selected: <strong class="admin_value_preview" id="subject-value" data-source="#subject"></strong></p>
{% endif %}
{% endfor %}
<div id="subject_checkbox-errors"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ <h2 class="form__header">{{ fs.label }}</h2>
{% endfor %}
{% endif %}

{% set fs = formulaic_context.fieldset("subject") %}
{% if fs %}
<h2 class="form__header">{{ fs.label }}</h2>
{% for f in fs.fields() %}
{% set field_template = f.template %}
{% include field_template %}
{% endfor %}
<p>Selected: <strong class="admin_value_preview" id="subject-value" data-source="#subject"></strong></p>
<div id="subject_checkbox-errors"></div>
{% endif %}

{% set fs = formulaic_context.fieldset("seal") %}
{% if fs %}
<h2 class="form__header">{{ fs.label }}</h2>
Expand Down