media3-0/apki.org

View on GitHub
app/views/projects/index.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, " - Lista projektów" %>

<h2 class="text-center mrg20t" style="margin-bottom:50px;margin-bottom:60px">Lista projektów</h2>

<!-- This button is here and at the bottom of this page/file. Margin-top/bottom is only changed. -->
<%- if current_user -%>
  <div class="text-center" style="margin-top:30px"><a class="btn btn-primary" href="<%= projects_mine_path %>">Przejdź do moich projektów</a></div>
<%- end -%>

<div class="clearfix"></div>

<% @projects.each do |project| %>
  <div class="col-md-4" ng-repeat="course in courses">
    <div class="fd-tile detail clean tile-purple course-tile project-tile" ng-click="checkCourse($event, course)">
      <div class="content">

          <%- if project.contest -%>
              <div style="position: absolute; right: 10px; top: 10px; font-size: 10px; color: green;" id="konkurs">KONKURS</div>
          <%- end -%>

        <img src="
          <% if project.icon.empty? %><%= asset_path('a_holder.png') %>
          <% else %><%= project.icon %>
          <% end %>" class="course-icon"><br>

        <h3><%= project.title %></h3>

        <p>
          <small><%= project.github %></small>
        </p>
      </div>
      <a class="btn btn-tomka" href="<%= project_path(project) %>">
        <span>Zobacz</span>
        <span><i class="fa fa-arrow-circle-right pull-right"></i></span></a>
    </div>
  </div>
<% end %>

<div class="clearfix"></div>

<!-- This button is here and at the top of this page/file. Margin-top/bottom is only changed. -->
<%- if current_user -%>
  <div class="text-center" style="margin-top:30px"><a class="btn btn-primary" href="<%= projects_mine_path %>">Przejdź do moich projektów</a></div>
<%- end -%>

<script type="text/javascript">
  $(function () {
    $('.project-tile').click(function () {
      location.assign($(this).find('a').attr('href'));
    });
  });
</script>