Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
hypha
Commits
30bd05e7
Commit
30bd05e7
authored
4 years ago
by
Fredrik Jonsson
Browse files
Options
Downloads
Patches
Plain Diff
Added help text and help links to the application form copy script.
parent
ce9ff5ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hypha/static_src/src/javascript/apply/submission-form-copy.js
+27
-3
27 additions, 3 deletions
...a/static_src/src/javascript/apply/submission-form-copy.js
with
27 additions
and
3 deletions
hypha/static_src/src/javascript/apply/submission-form-copy.js
+
27
−
3
View file @
30bd05e7
...
...
@@ -15,8 +15,6 @@
$
(
'
.application-form
'
).
find
(
'
.form__group, .rich-text
'
).
each
(
function
()
{
var
question_text
=
''
;
var
label_text
=
$
(
this
).
find
(
'
.form__question
'
).
html
();
var
input_text
=
$
(
this
).
find
(
'
input
'
).
val
();
var
rich_text
=
$
(
this
).
find
(
'
.tinymce4-editor
'
).
val
();
if
(
label_text
)
{
// Get the label, i.e. question.
label_text
=
strip
(
label_text
);
...
...
@@ -24,8 +22,34 @@
label_text
=
label_text
.
replace
(
/
[
]
+/g
,
'
'
);
question_text
=
'
###
'
+
label_text
;
var
help_text
=
$
(
this
).
find
(
'
.form__help
'
).
html
();
var
$help_link
=
$
(
this
).
find
(
'
.form__help-link
'
);
var
$input_list
=
$
(
this
).
find
(
'
.form__item > ul > li
'
);
var
input_text
=
$
(
this
).
find
(
'
input
'
).
val
();
var
rich_text
=
$
(
this
).
find
(
'
.tinymce4-editor
'
).
val
();
// Get help text and link if any.
if
(
help_text
)
{
question_text
=
question_text
+
'
\n\n
'
+
strip
(
help_text
);
}
if
(
$help_link
.
length
!==
0
)
{
question_text
=
question_text
+
'
\n\n
'
+
strip
(
$help_link
.
html
())
+
'
<
'
+
$help_link
.
find
(
'
a
'
).
attr
(
'
href
'
)
+
'
>
'
;
}
// Get the user input if any.
if
(
input_text
)
{
if
(
$input_list
.
length
!==
0
)
{
var
input_list
=
[];
var
input_item
=
''
;
$input_list
.
each
(
function
()
{
input_item
=
strip
(
$
(
this
).
html
());
if
(
$
(
this
).
find
(
'
input
'
).
is
(
'
:checked
'
))
{
input_item
=
input_item
+
'
*
'
;
}
input_list
.
push
(
input_item
);
});
question_text
=
question_text
+
'
\n\n
'
+
input_list
.
join
(
'
\n
'
);
}
else
if
(
input_text
)
{
question_text
=
question_text
+
'
\n\n
'
+
strip
(
input_text
);
}
else
if
(
rich_text
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment