Skip to content

Commit

Permalink
add autocomplete for departments
Browse files Browse the repository at this point in the history
  • Loading branch information
rococodogs committed Dec 29, 2017
1 parent 62f4b65 commit e8de451
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@

//= require_tree .
//= require hyrax

7 changes: 7 additions & 0 deletions app/services/department_authorities.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Spot
class DepartmentAuthorities < ::Hyrax::QaSelectService
def initialize
super('lafayette_departments')
end
end
end
12 changes: 12 additions & 0 deletions app/views/records/edit_fields/_department.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<%=
f.input key,
as: :multi_value,
input_html: {
class: 'form-control',
data: {
'autocomplete-url' => '/authorities/search/local/lafayette_departments',
'autocomplete' => key,
},
},
required: f.object.required?(key)
%>
41 changes: 41 additions & 0 deletions config/authorities/lafayette_departments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
terms:
# academic departments
- Africana Studies
- Anthropology & Sociology
- Art
- Biology
- Chemical & Biomolecular Engineering
- Chemistry
- Civil & Environmental Engineering
- Computer Science
- Economics
- Electrical & Computer Engineering
- Engineering Studies
- English
- Foreign Languages & Literatures
- Geology & Environmental Geosciences
- Government & Law
- History
- Libraries
- Mathematics
- Mechanical Engineering
- Music
- Philosophy
- Physics
- Policy Studies
- Psychology
- Religious Studies
- Theater

# administrative content
- Communication
- Development
- Facility Planning and Construction
- Finance and Administration
- Office of Institutional Research
- Office of Student Development
- Office of the Registrar
- Parent Relations
- President's Office
- Provost's Office
- Public Safety

0 comments on commit e8de451

Please sign in to comment.