-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created new offered course show page
- Loading branch information
1 parent
50fec36
commit 8c583fc
Showing
2 changed files
with
101 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,66 @@ | ||
<h2>Show offered course</h2> | ||
<h3>Term</h3> | ||
<ul> | ||
<li> | ||
<strong>ID:</strong> | ||
<%= @offered_course.term.id %> | ||
</li> | ||
|
||
<li> | ||
<strong>Name:</strong> | ||
<%= @offered_course.term.name %> | ||
</li> | ||
<div class="row"> | ||
<div class=" | ||
col-xs-12 | ||
col-sm-offset-1 col-sm-10 | ||
col-md-offset-2 col-md-8 | ||
col-lg-offset-2 col-lg-8 | ||
"> | ||
<div class="row middle-xs page-header"> | ||
<div class="col-xs-6 col-sm-9 col-md-10 page-title"> | ||
<%= Enum.join [@offered_course.course.name, @offered_course.term.name], " - " %> | ||
</div> | ||
<%= if @user_role == "Coordinator" do %> | ||
<div class="col-xs-6 col-sm-3 col-md-2"> | ||
<%= link "Edit", to: offered_course_path(@conn, :edit, @offered_course), | ||
class: "mdl-button mdl-js-button mdl-button--raised" | ||
%> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<li> | ||
<strong>Start Date:</strong> | ||
<%= @offered_course.term.start_date %> | ||
</li> | ||
<div class="page"> | ||
<%= CoursePlanner.SharedView.card "Syllabus", highlighted_title: true do %> | ||
<%= CoursePlanner.SharedView.card_content do %> | ||
<div class="card-text"> | ||
<%= @offered_course.syllabus %> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
|
||
<li> | ||
<strong>End Date:</strong> | ||
<%= @offered_course.term.end_date %> | ||
</li> | ||
<%= if length(@next_classes) > 0 do %> | ||
<div class="row middle-xs page-header"> | ||
<div class="col-xs-12 page-title page-title--small"> | ||
Next Classes | ||
</div> | ||
</div> | ||
<%= CoursePlanner.SharedView.class_list @next_classes, empty_text: "This course has no classes yet", | ||
show_attendances: @user_role === "Student" | ||
%> | ||
<% end %> | ||
|
||
<li> | ||
<strong>Number of sessions:</strong> | ||
<%= @offered_course.number_of_sessions %> | ||
</li> | ||
<%= if length(@past_classes) > 0 do %> | ||
<div class="row middle-xs page-header"> | ||
<div class="col-xs-12 page-title page-title--small"> | ||
Past Classes | ||
</div> | ||
</div> | ||
<%= CoursePlanner.SharedView.class_list @past_classes, empty_text: "This course has no classes yet", | ||
show_attendances: @user_role === "Student" | ||
%> | ||
<% end %> | ||
|
||
<li> | ||
<strong>Syllabus:</strong> | ||
<%= @offered_course.syllabus %> | ||
</li> | ||
<div class="row middle-xs page-header"> | ||
<div class="col-xs-12 page-title page-title--small"> | ||
<%= if @user_role == "Student" do %> | ||
Classmates | ||
<% else %> | ||
Students | ||
<% end %> | ||
</div> | ||
</div> | ||
<%= CoursePlanner.SharedView.user_list @offered_course.students, empty_text: "This course has no students yet" %> | ||
|
||
</ul> | ||
<h3>Course</h3> | ||
<ul> | ||
<li> | ||
<strong>ID:</strong> | ||
<%= @offered_course.course.id %> | ||
</li> | ||
|
||
<li> | ||
<strong>Name:</strong> | ||
<%= @offered_course.course.name %> | ||
</li> | ||
|
||
</ul> | ||
<%= if length(@offered_course.students) > 0 do %> | ||
<h3>Students</h3> | ||
<ul> | ||
<%= for s <- @offered_course.students do %> | ||
<li> | ||
<strong>Name</strong> | ||
<%= "#{s.name} #{s.family_name}" %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
<%= if length(@offered_course.teachers) > 0 do %> | ||
<h3>Teachers</h3> | ||
<ul> | ||
<%= for s <- @offered_course.teachers do %> | ||
<li> | ||
<strong>Name:</strong> | ||
<%= "#{s.name} #{s.family_name}" %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
|
||
<%= link "Edit", to: offered_course_path(@conn, :edit, @offered_course) %> | ||
<%= link "Back", to: offered_course_path(@conn, :index) %> | ||
</div> | ||
</div> | ||
</div> |