Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
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
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
81680bb6
Commit
81680bb6
authored
3 years ago
by
Moritz Strohm
Browse files
Options
Downloads
Patches
Plain Diff
BIESt #159: Raumsuche verwendet falsche HTTP-Semantik
parent
5735e099
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/assets/javascripts/bootstrap/resources.js
+47
-0
47 additions, 0 deletions
resources/assets/javascripts/bootstrap/resources.js
templates/sidebar/room-search-widget.php
+1
-14
1 addition, 14 deletions
templates/sidebar/room-search-widget.php
with
48 additions
and
14 deletions
resources/assets/javascripts/bootstrap/resources.js
+
47
−
0
View file @
81680bb6
...
@@ -81,6 +81,53 @@ STUDIP.ready(function () {
...
@@ -81,6 +81,53 @@ STUDIP.ready(function () {
}
}
}
}
//Room search widget: remove empty form inputs from URL:
jQuery
(
'
.sidebar-widget-content form.room-search-form
'
).
submit
(
function
()
{
//Check if the seats checkbox is checked. Only include "its" input
//fields when it is checked.
let
seats_checked
=
jQuery
(
this
).
find
(
'
input[name="special__seats_enabled"]
'
).
is
(
'
:checked
'
);
if
(
seats_checked
)
{
}
else
{
jQuery
(
this
).
find
(
'
input[name="special__seats_min"]
'
).
attr
(
'
disabled
'
,
'
disabled
'
);
jQuery
(
this
).
find
(
'
input[name="special__seats_max"]
'
).
attr
(
'
disabled
'
,
'
disabled
'
);
}
//Check if the time range checkbox is checked. Only include "its" input
//fields when it is checked.
let
time_range_checked
=
jQuery
(
'
#cb_special__time_range
'
).
is
(
'
:checked
'
);
if
(
time_range_checked
)
{
var
dow_select
=
jQuery
(
this
).
find
(
'
select[name="special__time_range_day_of_week"]
'
)[
0
];
if
(
dow_select
)
{
if
(
!
jQuery
(
dow_select
).
val
()
||
(
jQuery
(
dow_select
).
val
()
<
1
))
{
jQuery
(
dow_select
).
attr
(
'
disabled
'
,
'
disabled
'
);
}
}
}
else
{
jQuery
(
this
).
find
(
'
select[name="special__time_range_semester_id"]
'
).
attr
(
'
disabled
'
,
'
disabled
'
);
jQuery
(
'
#special__time_range_begin_date
'
).
attr
(
'
disabled
'
,
'
disabled
'
);
jQuery
(
'
#special__time_range_begin_time
'
).
attr
(
'
disabled
'
,
'
disabled
'
);
jQuery
(
'
#special__time_range_end_date
'
).
attr
(
'
disabled
'
,
'
disabled
'
);
jQuery
(
'
#special__time_range_end_time
'
).
attr
(
'
disabled
'
,
'
disabled
'
);
jQuery
(
this
).
find
(
'
select[name="special__time_range_day_of_week"]
'
).
attr
(
'
disabled
'
,
'
disabled
'
);
}
//Disable all form input fields that don't have a value:
jQuery
(
this
).
find
(
'
:input
'
).
filter
(
function
(){
//A list of allowed input fields without values
//(submit buttons):
let
empty_inputs
=
[
'
room_search
'
,
'
room_search_reset
'
];
if
(
jQuery
.
inArray
(
jQuery
(
this
).
prop
(
'
name
'
),
empty_inputs
)
>=
0
)
{
return
false
;
}
return
!
this
.
value
;
}
).
attr
(
'
disabled
'
,
'
disabled
'
);
//The form shall still be submitted.
return
true
;
});
//other:
//other:
jQuery
(
document
).
on
(
jQuery
(
document
).
on
(
...
...
This diff is collapsed.
Click to expand it.
templates/sidebar/room-search-widget.php
+
1
−
14
View file @
81680bb6
<form
class=
"default room-search-form"
action=
"
<?=
$action_link
?>
"
<form
class=
"default room-search-form"
action=
"
<?=
$action_link
?>
"
method=
"post"
>
method=
"get"
>
<input
type=
"hidden"
name=
"extended_search"
>
<ul
class=
"criteria-list"
>
<ul
class=
"criteria-list"
>
<?=
$this
->
render_partial
(
<?=
$this
->
render_partial
(
...
@@ -125,15 +124,3 @@
...
@@ -125,15 +124,3 @@
</select>
</select>
</label>
</label>
</form>
</form>
<script
type=
"text/javascript"
>
/* jQuery('.room-search-form .criteria-list input[type="date"]').datepicker(
{
dateFormat: 'yy-mm-dd'
}
);
jQuery('.room-search-form .criteria-list input[type="time"]').timepicker(
{
timeFormat: 'G:i'
}
); */
</script>
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