Commit 61eedd93 authored by Zac Wood's avatar Zac Wood
Browse files

cleaned up view structure

parent 9add1e0f
Pipeline #3370 failed with stage
in 2 minutes and 8 seconds
class SearchController < ApplicationController class SearchController < ApplicationController
def index 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] @instructors = results[:instructor]
@courses = results[:course] @courses = results[:course]
end end
......
...@@ -13,7 +13,9 @@ ...@@ -13,7 +13,9 @@
<body> <body>
<%= render partial: 'shared/navbar' %> <%= render partial: 'shared/navbar' %>
<%= yield %> <%= render 'shared/page' do %>
<%= yield %>
<% end %>
<%= render partial: 'shared/cart'%> <%= render partial: 'shared/cart'%>
</body> </body>
</html> </html>
</div>
<!-- List of sections in the cart -->
</div>
</div>
<template id="cart-data" data-cart="<%= @cart.to_json %>"></template>
...@@ -36,7 +36,16 @@ ...@@ -36,7 +36,16 @@
<div class="col order-1 order-sm-0"> <div class="col order-1 order-sm-0">
<form action="/search" class="form"> <form action="/search" class="form">
<div class="input-group" style="width:100%;"> <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"> <div class="input-group-append">
<button class="btn btn-secondary" type="button"> <button class="btn btn-secondary" type="button">
<i class="fas fa-search"></i> <i class="fas fa-search"></i>
...@@ -47,10 +56,3 @@ ...@@ -47,10 +56,3 @@
</div> </div>
</div> </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">
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment