Verified Commit 09ab1686 authored by Martin Mladenov's avatar Martin Mladenov
Browse files

Hide inaccessible buttons from students

parent 509fda7f
......@@ -15,11 +15,13 @@
<% end %>
<% if !current_user.role_student? || @coached_groups.any? || @companies.any? || @research_groups.any? %>
<div>
<div class="row">
<div class='col-xs-12'>
<%= link_to text_lines(icon(:fas, 'pen-to-square', ''), 'Create Proposal'), new_project_path, {class: "thumbnail-inverse thumbnail--button", style: 'border-width: 2px;'} %>
<% if can? :create, Project %>
<div class="row">
<div class='col-xs-12'>
<%= link_to text_lines(icon(:fas, 'pen-to-square', ''), 'Create Proposal'), new_project_path, {class: "thumbnail-inverse thumbnail--button", style: 'border-width: 2px;'} %>
</div>
</div>
</div>
<% end %>
<div class="row flex-container">
<div class='col-xs-12 col-sm-6 flex-container flex-element' style="min-width: 500px">
<%= render 'dashboards/show/projects' %>
......
......@@ -29,15 +29,17 @@
<h4 class="text-center">You are not currently part of any organizations</h4>
<% end %>
</div>
<div class="text-center" style="margin-top: auto">
<div class="btn-group" role="group">
<%= link_to glyphicon_text('briefcase', "Overview"), companies_path, class: 'btn btn-info' %>
<%= link_to glyphicon_text(:pencil, "Create #{current_user.company_name.capitalize}"), new_company_path, class: 'btn btn-warning' %>
<% if !current_user.role_student? || current_user.involved_companies(%i[employee unconfirmed_employee]).any? %>
<% if !current_user.role_student? || current_user.involved_companies(%i[employee unconfirmed_employee]).any? %>
<div class="text-center" style="margin-top: auto">
<div class="btn-group" role="group">
<%= link_to glyphicon_text('briefcase', "Overview"), companies_path, class: 'btn btn-info' %>
<% unless current_user.role_student? %>
<%= link_to glyphicon_text(:pencil, "Create #{current_user.company_name.capitalize}"), new_company_path, class: 'btn btn-warning' %>
<% end %>
<%= modal_button "Join #{current_user.company_name.capitalize}", 'join-company', class: 'btn btn-primary' %>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment