Skip to content

Commit

Permalink
now showing bandango_connections at bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
macool committed Jan 15, 2014
1 parent 5bd17b7 commit c683ef5
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/assets/stylesheets/presets.css.sass
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@

.stronger
font-weight: 400

.light
color: #777
1 change: 1 addition & 0 deletions app/controllers/bandangos_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class BandangosController < ApplicationController
before_action :find_bandango, only: [:show, :edit, :update]

def show
@connections = @bandango.connections.page(params[:page]).per(10)
end

def edit
Expand Down
4 changes: 4 additions & 0 deletions app/views/bandango_connections/_bandango_connection.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<%= div_for bandango_connection, :class => "model" do %>
<%= l bandango_connection.created_at, format: :short %>:
<%= bandango_connection.transacciones_sent.join(", ") %>
<% end %>
10 changes: 10 additions & 0 deletions app/views/bandango_connections/_bandango_connections.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<% if @connections.any? %>
<% @connections.each do |connection| %>
<%= render connection %>
<% end %>
<div class="align_center">
<%= paginate @connections, remote: true %>
</div>
<% else %>
Ninguna
<% end %>
3 changes: 3 additions & 0 deletions app/views/bandangos/_bandango.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<%= link_to [@business, bandango], :class => "bandango" do %>
<span class="nombre"><%= bandango.nombre %></span>
<span class="light">
<%= "hace #{time_ago_in_words bandango.last_connection_time}" if bandango.last_connection_time %>
</span>
<% end %>
5 changes: 5 additions & 0 deletions app/views/bandangos/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ token:
<code><%= @bandango.token %></code>

<%= link_to "Editar", edit_business_bandango_path(@business, @bandango), :class => "btn btn-link" %>

<h4>Conexiones</h4>
<div class="well bandango_connections models">
<%= render "bandango_connections/bandango_connections" %>
</div>
1 change: 1 addition & 0 deletions app/views/bandangos/show.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(".bandango_connections").html("<%= j render('bandango_connections/bandango_connections') %>");

0 comments on commit c683ef5

Please sign in to comment.