SUSE/hackweek

View on GitHub
app/views/projects/_like_button.html.haml

Summary

Maintainability
Test Coverage
- project = @project if @project
- dislike = "display: none;" unless project.kudos.include? current_user
= link_to(dislike_project_path(project.id), :title=>'Dislike this project?', :class=> "btn btn-default btn-xs", :id => "dislike-#{project.id}", :style => "#{dislike}", :remote=>true) do
  %i.fas.fa-heart{:style => "color: #73ba25;"}
- like = "display: none;" if project.kudos.include? current_user
=link_to(like_project_path(project.id), :title=>'Like this project', :class=> "btn btn-default btn-xs", :id => "like-#{project.id}", :style => "#{like}", :remote => true) do
  %i.far.fa-heart