Skip to content

Commit

Permalink
Change UI related to suggested topics.
Browse files Browse the repository at this point in the history
  • Loading branch information
Winbobob committed Aug 21, 2015
1 parent 9f1b06c commit 38883e3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion app/controllers/suggestion_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def create
@suggestion.unityID = "";
end

flash[:success] = 'Thank you for your suggestion!' if @suggestion.save
if @suggestion.save
flash[:success] = 'Thank you for your suggestion!' if @suggestion.unityID != ''
flash[:success] = 'You have already submit an anonymous suggestion. It will not show in the suggested topic table below.' if @suggestion.unityID == ''
end
redirect_to :action => 'new', :id => @suggestion.assignment_id
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/suggestion/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

<tr>
<td><label for="suggestion_signup_preference">Do you wish to work on this topic?</label></td>
<td><%= select "suggestion", "signup_preference", {"Yes" =>"Y","No"=>"N","--"=>""} %> </td>
<td><%= select "suggestion", "signup_preference", {"Yes" =>"Y","No"=>"N"} %> </td>
</tr>
</table>
8 changes: 4 additions & 4 deletions app/views/suggestion/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<h2>Suggested topics for <%= @assignment.name %></h2>
<table class="general" cellpadding="5" width="50%" border="1">
<tr>
<th>Title</th>
<th>Status</th>
<th>Action</th>
<th style="text-align:center;">Title</th>
<th style="text-align:center;">Status</th>
<th style="text-align:center;">Action</th>
</tr>

<% for suggestion in @suggestions %>
<tr class="listingRow">
<td style="max-width: 200px"><%=h suggestion.title %></td>
<td style="text-align:center; max-width: 200px;"><%=h suggestion.title %></td>
<td align="center"><%=h suggestion.status %></td>
<td align="center"><%= link_to 'View', :action => 'student_view', :id => suggestion %>
<%= if suggestion.status == 'Initiated'
Expand Down
1 change: 1 addition & 0 deletions app/views/suggestion/student_edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<h2>Edit Suggested topic <%= @suggestion.title %></h2>
<%= form_tag :action => 'update_suggestion', :id => @suggestion.id do %>
<table>
<tr>
Expand Down
1 change: 1 addition & 0 deletions app/views/suggestion/student_view.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<h2>View Suggested topic <%= @suggestion.title %></h2>
<table border=0 cellspacing=10>
<colgroup>
<col width=25%>
Expand Down

0 comments on commit 38883e3

Please sign in to comment.