Skip to content

Commit

Permalink
formatting and spcaing in message
Browse files Browse the repository at this point in the history
  • Loading branch information
sneha1302 committed Feb 26, 2016
1 parent 315e462 commit c843c4d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/courses/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</tr>
<tr>
<td>Instructor:</td>
<td><%= @course.user.name %>
<td><%= @course.user.name %> &nbsp;&nbsp;&nbsp;&nbsp;
<% if ((current_user.id!=@course.user.id) && (current_user.utype=="student")) %>
<i class="glyphicon glyphicon-envelope"> <%= link_to 'Message me!', conversations_path(sender_id: current_user.id, receiver_id: @course.user.id), method: 'post'%></i></td>
<%end %>
Expand Down
6 changes: 5 additions & 1 deletion app/views/messages/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<%= link_to 'Show Previous', '?m=all' %>

<div class="ui segment">
<div class="container" style="height:70vh; overflow:auto">
<table class="table table-hover">
<% @messages.each do |message| %>
<% if message.body %>
<% user = User.find(message.user_id) %>
Expand All @@ -25,14 +26,17 @@
</div>
<% end %>
<% end %>
</table>
</div>

<div class="row">
<div class="col-md-6 col-md-offset-3">
<%= form_for [@conversation, @message], html: {class: "ui reply form"} do |f| %>
<div class="field">
<%= f.text_area :body, class: "form-control" %>
</div>
<%= f.text_field :user_id, value: current_user.id, type: "hidden" %>
<%= f.text_field :read, value: false, type: "hidden" %>
<div>
<%= f.submit "Reply !", class: "btn btn-primary" %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/student_courses/enrolledshow.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<% @student_courses.each do |student_course| %>
<% if student_course !=nil %>
<tr>
<td><%= student_course.user.name %>
<td><%= student_course.user.name %> &nbsp;&nbsp;&nbsp;&nbsp;
<% if ((current_user.id!=student_course.user.id) && (current_user.utype=="instructor")) %>
<i class="glyphicon glyphicon-envelope"> <%= link_to 'Message me!', conversations_path(sender_id: current_user.id, receiver_id: student_course.user.id), method: 'post'%></i>
<%end %></td>
Expand Down
2 changes: 1 addition & 1 deletion app/views/student_courses/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</tr>
<tr>
<td>Course instructor</td>
<td><%= @student_course.course.user.name %>
<td><%= @student_course.course.user.name %> &nbsp;&nbsp;&nbsp;&nbsp;
<% if ((current_user.utype=="student")) %>
<i class="glyphicon glyphicon-envelope"> <%= link_to 'Message me!', conversations_path(sender_id: current_user.id, receiver_id: @student_course.course.user.id), method: 'post'%></i>
<%end%>
Expand Down

0 comments on commit c843c4d

Please sign in to comment.