-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/alaashafaee/Coolsoft-14 i…
…nto C3_Fadel_210_adding_helping_hints_4.12
- Loading branch information
Showing
10 changed files
with
251 additions
and
89 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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
*= require_self | ||
*= require_tree . | ||
*/ | ||
= require posts | ||
|
||
.side-left { | ||
height:700px; | ||
|
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,3 +1,8 @@ | ||
// Place all the styles related to the posts controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ | ||
.greyLine { | ||
border-bottom: 1px solid #D0D0D0; | ||
} | ||
|
||
.reply { | ||
padding-left:30px; | ||
border-bottom: 1px solid #D0D0D0; | ||
} |
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
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
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,30 +1,71 @@ | ||
<div align="center"> | ||
<% if flash[:notice] %> | ||
<div class="alert alert-warning", style="width:180px;display:inline"><%= flash[:notice] %></div> | ||
<% end %> | ||
<% if @discussionBoard.activated == true %> | ||
<div style="width: 50%; margin-left:25%"> | ||
<% if flash[:notice] %> | ||
<div class="alert alert-warning", | ||
style="width:180px;display:inline"><%= flash[:notice] %></div> | ||
<% end %> | ||
<% if @discussionBoard.activated == true %> | ||
<table class="table table-striped table-bordered table-responsive"> | ||
<div align="center"> | ||
<h3><%= @discussionBoard.title %></h3> | ||
<% unless @posts.blank? %> | ||
<% @posts.each do |post| %> | ||
<div> | ||
<td><%= link_to post.title, :controller => 'posts', :action=> 'show', | ||
:id => post.id,:method => :get, class: "btn btn-success" %> | ||
</td> | ||
<%= post.views_count %> | ||
</div> | ||
<br> | ||
<% end %> | ||
<% else %> | ||
No Posts Yet .. Try Creating a Post | ||
<% end %> | ||
</div> | ||
<div> | ||
<%= link_to "Add Post", new_post_path(discussion_board_id: | ||
@discussionBoard.id), class: "btn btn-success", | ||
style: "float: left;margin-left: 15px" %> | ||
</div> | ||
<% else %> | ||
The discusstion board is deactivated | ||
<% end %> | ||
</div> | ||
<% unless @posts.blank? %> | ||
<tr> | ||
<td>Post</td> | ||
<td>Replies</td> | ||
<td>Post Owner</td> | ||
<td>Last Reply </td> | ||
<td>Created</td> | ||
<td>Views</td> | ||
</tr> | ||
<% @posts.each do |post| %> | ||
<tr> | ||
<td> | ||
<h4><%= link_to post.title, :controller => 'posts', :action=> 'show', | ||
:id => post.id,:method => :get, class: | ||
"btn btn-success" %></h4> | ||
</td> | ||
<td> | ||
<small><%= post.replies.count %></small><br/> | ||
</td> | ||
<td> | ||
<small><%= post.owner.name %>'s post</small><br/> | ||
</td> | ||
<td> | ||
<% if post.most_recent_reply %> | ||
<%= distance_of_time_in_words_to_now post.most_recent | ||
_reply.created_at %> ago by | ||
<% if post.most_recent_reply.owner_type == "Lecturer" %> | ||
<%= link_to post.most_recent_reply.owner.name, | ||
"/lecturers/{post.most_recent_reply.owner_id}" %> | ||
<% end %> | ||
<% if post.most_recent_reply.owner_type == "Student" %> | ||
<%= link_to post.most_recent_reply.owner.name, | ||
"/students/{post.most_recent_reply.owner_id}" %> | ||
<% end %> | ||
<% if post.most_recent_reply.owner_type == "TeachingAssistant" %> | ||
<%= link_to post.most_recent_reply.owner.name, | ||
"/teachingassistants/{post.most_recent_reply.owner_id}" %> | ||
<% end %> | ||
<% else %> | ||
No replies | ||
<% end %> | ||
</td> | ||
<td> | ||
<small><%=distance_of_time_in_words_to_now post.created_at %> ago</small> | ||
<br/> | ||
</td> | ||
<td> | ||
<small><%= post.views_count %></small><br/> | ||
</td> | ||
</tr> | ||
<% end %> | ||
<% else %> | ||
No Posts Yet .. Try Creating a Post | ||
<% end %> | ||
</table> | ||
<div> | ||
<%= link_to "Add Post", new_post_path(discussion_board_id: | ||
@discussionBoard.id), class: "btn btn-success" %> | ||
</div> | ||
<% else %> | ||
The discusstion board is deactivated | ||
<% end %> |
Oops, something went wrong.