hpham17/esential-2016

View on GitHub
app/views/devise/sessions/borrower_dashboard.html.erb

Summary

Maintainability
Test Coverage
<!--Import Google Icon Font-->
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/css/materialize.min.css">
<h1>Welcome, <%= current_user.name %>! </h1>

<nav>
    <div class="nav-wrapper">
      <form>
        <div class="input-field">
          <%= form_tag dashboard_path, :method => "get", :id => "community_search" do %>
            <%= text_field_tag :search, params[:search], class: 'autocomplete', id: 'search', autocomplete: 'off', placeholder: 'Search' %>
          
          <% end %>
        </div>
      </form>
    </div>
  </nav>






  <table class="table table-responsive table-striped table-bordered">
    <thead>
      <tr>
        <th><div class="panel-heading"><%= link_to 'Community Name', dashboard_path + '?sort=name', :id => 'community_name' %> </div> </th>
        <th><div class="panel-heading"> Total Loan Amount</div></th>
        <th><div class="panel-heading"> <%= link_to 'Max Loan Amount', dashboard_path + '?sort=max_loan_amount', :id => 'max_loan_amount'%></div></th>
        <th><div class="panel-heading"> Interest Rate</div> </th>
        <th><div class="panel-heading"> Loan Period (months)</div> </th>
        <th><div class="panel-heading"> Address</div> </th>
      </tr>
    </thead>

  <tbody>
    <% @communities.each do |c| %>
    <tr>
      <td><%= link_to c.name, c %></td>
      <td>$<%= c.total_loan_amount %></li></td>
      <td>$<%= c.max_loan_amount %></li></td>
      <td><%= c.interest_rate %>%</td>
      <td><%= c.loan_period %></td>
      <% if c.address %><td><%= c.address.format %></td>
      <% end %>

    </tr>
    <% end %>
  </tbody>

  </table>


<!-- Google Map -->
    <h3>Communities on the map</h3>
    <div id="map" data-test-env="<%= Rails.env.test? %>"></div>
      <div id="control_container"><div id="results"></div></div>




<br>





<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAJfFJrG4ThonnI919v6wzummPJfYf_Tao&callback=initMap">
</script>