kimjunh/giver-game

View on GitHub
app/views/users/profile.html.erb

Summary

Maintainability
Test Coverage
<head>
    <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
    <%= stylesheet_link_tag "profile_style.css" %>
</head>

<body>
    <div class="container">
        <div class="row">
            <div id="flash"><% if flash[:notice] %><div class="notice"><%= flash[:notice] %></div><% end %></div>
            <div class="page-header">
                <h3 style="color: #244354"><%= @user.username %>'s Profile</h3>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-4">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 style="margin-bottom: 20px" style="color: #244354"><i class="fa fa-list" style="margin-right: 15px"></i>Your Games</h4>
                    </div>
                    <div class="panel-body">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th style="text-align: left">Games</th>
                                    <th>Edit Game</th>
                                    <th>See Results</th>
                                </tr>
                            </thead>
                            <tbody>
                                 <% @games.each do |game| %>
                                     <tr>
                                        <td><%= game.title%></a></td>
                                        <% if !game.expired %>
                                            <td><a href=<%= edit_game_path(current_user.id, game.id)%>><button type="button" class="btn btn-default btn-circle"><i class="fa fa-pencil-square-o"></i></button></a></td>
                                        <%else %>
                                            <td></td>
                                        <%end%>
                                        <td><a href=<%= results_path(:id => game.id)%>><button type="button" class="btn btn-default btn-circle"><i class="fa fa-bar-chart"></i></button></a></td>
                                     </tr>
                                <% end %>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>