Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
schedules
Commits
61eedd93
Commit
61eedd93
authored
Nov 16, 2018
by
Zac Wood
Browse files
cleaned up view structure
parent
9add1e0f
Pipeline
#3370
failed with stage
in 2 minutes and 8 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
schedules/app/controllers/search_controller.rb
View file @
61eedd93
class
SearchController
<
ApplicationController
def
index
results
=
SearchHelper
::
GenericItem
.
fetchall
(
params
[
:query
],
semester:
@semester
).
group_by
(
&
:type
)
results
=
SearchHelper
::
GenericItem
.
fetchall
(
String
.
new
(
params
[
:query
]
)
,
semester:
@semester
).
group_by
(
&
:type
)
@instructors
=
results
[
:instructor
]
@courses
=
results
[
:course
]
end
...
...
schedules/app/views/layouts/application.html.erb
View file @
61eedd93
...
...
@@ -13,7 +13,9 @@
<body>
<%=
render
partial:
'shared/navbar'
%>
<%=
yield
%>
<%=
render
'shared/page'
do
%>
<%=
yield
%>
<%
end
%>
<%=
render
partial:
'shared/cart'
%>
</body>
</html>
schedules/app/views/shared/_cart.html.erb
View file @
61eedd93
</div>
<!-- List of sections in the cart -->
</div>
</div>
<template
id=
"cart-data"
data-cart=
"
<%=
@cart
.
to_json
%>
"
></template>
schedules/app/views/shared/_navbar.html.erb
View file @
61eedd93
...
...
@@ -36,7 +36,16 @@
<div
class=
"col order-1 order-sm-0"
>
<form
action=
"/search"
class=
"form"
>
<div
class=
"input-group"
style=
"width:100%;"
>
<input
name=
"query"
type=
"text"
class=
"form-control"
placeholder=
"Search by CRN, course, professor..."
aria-describedby=
"basic-addon2"
>
<input
id=
"searchbar"
value=
"
<%=
params
[
:query
]
%>
"
name=
"query"
type=
"text"
class=
"form-control"
placeholder=
"Search by CRN, course, professor..."
aria-describedby=
"basic-addon2"
autocomplete=
"off"
>
<div
class=
"input-group-append"
>
<button
class=
"btn btn-secondary"
type=
"button"
>
<i
class=
"fas fa-search"
></i>
...
...
@@ -47,10 +56,3 @@
</div>
</div>
</div>
<div
class=
"container-fluid"
>
<!-- The main screen consists of a row with two columns: the search results, and the cart -->
<div
class=
"row"
>
<!-- Search result, List of Courses -->
<div
class=
"col-lg-8 col-md-10 mx-auto order-2 order-lg-0"
id=
"search-list"
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment