Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
SMASCH
scheduling-system
Merge requests
!361
Resolve "not checked `referred by` checkbox causes error"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "not checked `referred by` checkbox causes error"
468-not-checked-referred-by-checkbox-causes-error
into
master
Overview
0
Commits
1
Pipelines
2
Changes
2
Merged
Piotr Gawron
requested to merge
468-not-checked-referred-by-checkbox-causes-error
into
master
3 years ago
Overview
0
Commits
1
Pipelines
2
Changes
2
Expand
Closes
#468 (closed)
Edited
3 years ago
by
Piotr Gawron
0
0
Merge request reports
Viewing commit
b999e8b5
Show latest version
2 files
+
10
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
b999e8b5
autocomplete on refered by should be filled only when field is available
· b999e8b5
Piotr Gawron
authored
3 years ago
smash/web/templates/subjects/add.html
+
8
−
6
Options
@@ -102,13 +102,18 @@
<script
src=
"{% static 'npm/awesomplete/awesomplete.min.js' %}"
></script>
<script>
$
(
document
).
ready
(
function
()
{
var
cityInput
=
document
.
querySelector
(
"
#id_subject-city
"
);
var
referralInput
=
document
.
querySelector
(
"
#id_study_subject-referral
"
);
if
(
referralInput
!==
null
)
{
$
.
get
(
"
{% url 'web.api.referrals' %}
"
,
function
(
data
)
{
new
Awesomplete
(
referralInput
).
list
=
data
.
referrals
;
});
}
var
cityInput
=
document
.
querySelector
(
"
#id_subject-city
"
);
var
lastNameInput
=
$
(
"
input[name='subject-last_name']
"
);
var
firstNameInput
=
$
(
"
input[name='subject-first_name']
"
);
if
(
cityInput
===
null
||
referralInput
===
null
||
lastNameInput
.
length
===
0
||
firstNameInput
.
length
===
0
)
{
if
(
cityInput
===
null
||
lastNameInput
.
length
===
0
||
firstNameInput
.
length
===
0
)
{
alert
(
"
Internal error. Contact administrators.
"
);
}
@@ -116,9 +121,6 @@
$
.
get
(
"
{% url 'web.api.cities' %}
"
,
function
(
data
)
{
new
Awesomplete
(
cityInput
).
list
=
data
.
cities
;
});
$
.
get
(
"
{% url 'web.api.referrals' %}
"
,
function
(
data
)
{
new
Awesomplete
(
referralInput
).
list
=
data
.
referrals
;
});
var
checkDuplicates
=
function
(
e
)
{
Loading