sue445/gitpeach

View on GitHub
app/views/top/_logged_in.html.slim

Summary

Maintainability
Test Coverage
- unless @user_kanban_projects.empty?
  h1 Your Kanbans

  table.table
    tbody
      - @user_kanban_projects.each do |project|
        tr
          td
            = link_to kanban_path(project.path_with_namespace) do
              = project.path_with_namespace
          td
            = link_to kanban_path(project.path_with_namespace), class: "btn btn-default" do
              span.glyphicon.glyphicon-tasks
              | Show
            = link_to edit_kanban_path(project.path_with_namespace), class: "btn btn-default" do
              span.glyphicon.glyphicon-wrench
              | Edit
            = link_to project.path_with_namespace, data: {:confirm => 'Are you sure?'}, class: "btn btn-danger", method: :delete do
              span.glyphicon.glyphicon-trash
              | Destroy

- unless @other_kanbans.empty?
  h1 Other Kanbans

  table.table
    tbody
      - @other_kanbans.each do |kanban|
        tr
          td
            = link_to kanban_path(kanban) do
              = kanban.name
          td
            = link_to kanban_path(kanban), class: "btn btn-default" do
              span.glyphicon.glyphicon-tasks
              | Show


- unless @no_kanban_projects.empty?
  h1 Your Projects

  table.table
    tbody
      - @no_kanban_projects.each do |project|
        tr
          td
            = link_to project.path_with_namespace, project.web_url
          td
            = form_tag kanbans_path
              = hidden_field_tag "kanban[gitlab_project_id]", project.id
              = hidden_field_tag "kanban[name]", project.path_with_namespace
              = button_tag type: "submit", class: "btn btn-primary" do
                span.glyphicon.glyphicon-file
                | Create Kanban