Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Commit

Permalink
Added new part/assem to parts overview
Browse files Browse the repository at this point in the history
  • Loading branch information
icecube45 committed Dec 27, 2017
1 parent 4f977b5 commit 5e1f885
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion views/part.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<%= erb :header %>

<div class="container">
<% if @part.type == "assembly" && @user.can_edit? %>
<% if @part.type == "part" && @user.can_edit? %>
<div class="pull-right" style="margin-top: 15px;">
<a href="/projects/<%= @part.project.id %>/new_part?type=part" class="btn btn-success btn-small">
<i class="icon-white icon-cog"></i> New Part
</a>
<a href="/projects/<%= @part.project.id %>/new_part?type=assembly" class="btn btn-success btn-small">
<i class="icon-white icon-th"></i> New Assembly
</a>
</div>
<% elsif @part.type == "assembly" && @user.can_edit? %>
<div class="pull-right" style="margin-top: 15px;">
<a href="/projects/<%= @part.project_id %>/new_part?type=part&parent_part_id=<%= @part.id %>"
class="btn btn-success btn-small"><i class="icon-white icon-cog"></i> New Part</a>
Expand Down

0 comments on commit 5e1f885

Please sign in to comment.