Skip to content

Commit

Permalink
Issue #206 shorter lines in show.html.erb
Browse files Browse the repository at this point in the history
  • Loading branch information
serag committed Apr 24, 2014
1 parent e924a29 commit 1c861e0
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 18 deletions.
19 changes: 14 additions & 5 deletions tutor/app/views/lecturers/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<h1> <%= image_tag(@lecturer.profile_image_url.to_s) if @lecturer.profile_image? %> <%= @lecturer.name %>'s Profile </h1>
<h1>
<%= image_tag(@lecturer.profile_image_url.to_s) if @lecturer.profile_image? %>
<%= @lecturer.name %>'s Profile
</h1>
<div class="tabs">
<ul class="tab-links">
<li class="active"><a href="#tab1">Course</a></li>
Expand All @@ -15,16 +18,22 @@
</tr>
<% @courses.each do |c| %>
<tr>
<td><%= link_to c.name, :controller => 'courses', :action => 'show', :id => c.id,
:method => :get, class: "btn btn-success" %></td>
<td>
<%= link_to c.name, :controller => 'courses', :action => 'show',
:id => c.id, :method => :get, class: "btn btn-success" %>
</td>
<td><%= c.code %></td>
<% if current_lecturer %>
<td>
<%= link_to "Manage Course", {:controller => 'courses', :action => 'edit', :method => :get, :id => c.id}, class: "btn btn-success", style: "text-decoration:none" %>
<%= link_to "Manage Course", {:controller => 'courses',
:action => 'edit', :method => :get, :id => c.id},
class: "btn btn-success", style: "text-decoration:none" %>
</td>
<% end %>
<td>
<%= link_to "Discussion Board", {:controller => 'discussion_boards', :action => 'show', :id => c.id }, class: "btn btn-success", method: :get, style: "text-decoration:none" %>
<%= link_to "Discussion Board", {:controller => 'discussion_boards',
:action => 'show', :id => c.id }, class: "btn btn-success",
method: :get, style: "text-decoration:none" %>
</td>
</tr>
<% end %>
Expand Down
22 changes: 16 additions & 6 deletions tutor/app/views/students/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<h1> <%= image_tag(@student.profile_image_url.to_s) if @student.profile_image? %> <%= @student.name %>'s Profile </h1>
<h1>
<%= image_tag(@student.profile_image_url.to_s) if @student.profile_image? %>
<%= @student.name %>'s Profile
</h1>
<div class="tabs">
<ul class="tab-links">
<li class="active"><a href="#tab1">Course</a></li>
Expand All @@ -16,16 +19,22 @@
</tr>
<% @courses.each do |c| %>
<tr>
<td><%= link_to c.name, :controller => 'courses', :action => 'show', :id => c.id,
:method => :get, class: "btn btn-success" %></td>
<td>
<%= link_to c.name, :controller => 'courses', :action => 'show',
:id => c.id, :method => :get, class: "btn btn-success" %>
</td>
<td><%= c.code %></td>
<% if current_lecturer %>
<td>
<%= link_to "Manage Course", {:controller => 'courses', :action => 'edit', :method => :get, :id => c.id}, class: "btn btn-success", style: "text-decoration:none" %>
<%= link_to "Manage Course", {:controller => 'courses',
:action => 'edit', :method => :get, :id => c.id},
class: "btn btn-success", style: "text-decoration:none" %>
</td>
<% end %>
<td>
<%= link_to "Discussion Board", {:controller => 'discussion_boards', :action => 'show', :id => c.id }, class: "btn btn-success", method: :get, style: "text-decoration:none" %>
<%= link_to "Discussion Board", {:controller => 'discussion_boards',
:action => 'show', :id => c.id }, class: "btn btn-success",
method: :get, style: "text-decoration:none" %>
</td>
</tr>
<% end %>
Expand All @@ -36,7 +45,8 @@
<p> <b>Email:</b> <%= @student.email %> </p>
</div>
<div id="tab3" class="tab">
<%= link_to "Statistics", { :controller => 'students', :action => 'get_performance', :id => @student.id }, :method => :get, class: "btn btn-success" %>
<%= link_to "Statistics", { :controller => 'students', :action => 'get_performance',
:id => @student.id }, :method => :get, class: "btn btn-success" %>
</div>
</div>
</div>
19 changes: 14 additions & 5 deletions tutor/app/views/teaching_assistants/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<h1> <%= image_tag(@teaching_assistant.profile_image_url.to_s) if @teaching_assistant.profile_image? %> <%= @teaching_assistant.name %>'s Profile </h1>
<h1>
<%= image_tag(@teaching_assistant.profile_image_url.to_s)
if @teaching_assistant.profile_image? %> <%= @teaching_assistant.name %>'s Profile
</h1>
<div class="tabs">
<ul class="tab-links">
<li class="active"><a href="#tab1">Course</a></li>
Expand All @@ -15,16 +18,22 @@
</tr>
<% @courses.each do |c| %>
<tr>
<td><%= link_to c.name, :controller => 'courses', :action => 'show', :id => c.id,
:method => :get, class: "btn btn-success" %></td>
<td>
<%= link_to c.name, :controller => 'courses', :action => 'show',
:id => c.id, :method => :get, class: "btn btn-success" %>
</td>
<td><%= c.code %></td>
<% if current_lecturer %>
<td>
<%= link_to "Manage Course", {:controller => 'courses', :action => 'edit', :method => :get, :id => c.id}, class: "btn btn-success", style: "text-decoration:none" %>
<%= link_to "Manage Course", {:controller => 'courses',
:action => 'edit', :method => :get, :id => c.id},
class: "btn btn-success", style: "text-decoration:none" %>
</td>
<% end %>
<td>
<%= link_to "Discussion Board", {:controller => 'discussion_boards', :action => 'show', :id => c.id }, class: "btn btn-success", method: :get, style: "text-decoration:none" %>
<%= link_to "Discussion Board", {:controller => 'discussion_boards',
:action => 'show', :id => c.id}, class: "btn btn-success",
method: :get, style: "text-decoration:none" %>
</td>
</tr>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions tutor/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# Example of named route that can be invoked with purchase_url(id: product.id)
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase

# Example resource route (maps HTTP verbs to controller actions automatically):
# resources :products
resources :courses
Expand Down Expand Up @@ -99,4 +99,4 @@
# # (app/controllers/admin/products_controller.rb)
# resources :products
# end
end
end

0 comments on commit 1c861e0

Please sign in to comment.