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
160d7746
Commit
160d7746
authored
Dec 15, 2018
by
Zac Wood
Browse files
Fixed pass courses list on instructor page
parent
38686284
Pipeline
#3489
passed with stages
in 41 minutes and 27 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
schedules/app/controllers/instructors_controller.rb
View file @
160d7746
...
...
@@ -16,6 +16,12 @@ class InstructorsController < ApplicationController
sections
.
each
do
|
s
|
@courses
.
add
s
.
course
end
@past
=
[]
@instructor
.
course_sections
.
map
(
&
:course
).
each
do
|
c
|
@past
<<
c
unless
@past
.
select
{
|
past
|
past
.
full_name
==
c
.
full_name
}.
count
.
positive?
end
@past
.
sort_by!
(
&
:full_name
)
end
private
...
...
schedules/app/views/instructors/show.html.erb
View file @
160d7746
<div
class=
"row"
>
<div
class=
"col-lg-4 col-12"
>
<h1>
<%=
@instructor
.
name
%>
</h1>
<%
prev
=
@instructor
.
course_sections
.
map
(
&
:course
).
uniq
.
reject
{
|
c
|
c
.
semester
==
@semester
}
%>
<%
if
prev
.
count
.
positive?
%>
<%
if
@past
.
count
.
positive?
%>
<strong>
Previously taught:
</strong>
<ul>
<%
prev
.
each
do
|
s
|
%>
<li>
<%=
link_to
s
.
full_name
,
course_path
(
s
)
%>
</li>
<%
@past
.
each
do
|
c
|
%>
<li>
<%=
link_to
c
.
full_name
,
course_path
(
c
)
%>
</li>
<%
end
%>
</ul>
<%
end
%>
...
...
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