Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed project close button & not show when project is closed

  • Loading branch information...
commit 01da02b6d3bdc8e367a27b34a46e3ffdc3447637 1 parent d0455a1
@zflat zflat authored
View
2  app/views/projects/finish.html.erb
@@ -14,7 +14,7 @@
<p>If you must override project requirements, you can finish the project</p>
<%= form_for(project, :url=>close_project_path(project), :method => :put) do |f| %>
<%= hidden_field_tag(:force, "all") %>
- <%= f.submit "Close UNFINISHED project and depart", :class=>"btn btn-primary" %>
+ <%= f.submit "Close UNFINISHED project and depart", :class=>"btn btn-danger" %>
<% end %>
<% end %>
</div>
View
6 app/views/projects/show.html.erb
@@ -2,7 +2,9 @@
<div id="projectInfo" class="span4 noteCard">
<p>Program: <%= link_to project.prog.title, program_path(project.prog) %></p>
<p>Bike: <%= link_to project.bike.number, bike_path(bike) %></p>
+ <% if !project.closed? %>
<p><%= link_to "Close project and depart bike", finish_project_path(project) %></p>
+ <% end %>
</div>
<%= render :partial => "project_step" %>
@@ -24,14 +26,16 @@
<%= render :partial=>"comments/index", :locals=>{:comments => project.comment_threads} %>
</section> <!-- end of notes wrapper -->
+ <% if !project.closed? %>
<div class="row">
<div id="cancel-project-wrapper" class="span11">
- <%= form_for(project, :url=>close_project_path(project), :method=>:get) do |f|%>
+ <%= form_for(project, :url=>finish_project_path(project), :method=>:get) do |f|%>
<%= f.submit "Close and depart bike", :class => "btn btn-primary" %>
<% end %>
</div>
</div>
<br />
+ <% end %>
<div class="row">
<div id="cancel-project-wrapper" class="span11">
<%= form_for(project, :url=>project_path(project), :method=>:delete) do |f|%>
Please sign in to comment.
Something went wrong with that request. Please try again.