use Bootstrap styles for public channels list

This commit is contained in:
Lee Lawlor 2014-08-06 11:20:24 -04:00
parent 9521a998e5
commit dbaa3bd7c7
15 changed files with 340 additions and 58 deletions

View File

@ -12,6 +12,7 @@ gem 'nested_form'
gem 'dalli' gem 'dalli'
gem 'kgio' gem 'kgio'
gem 'will_paginate', '~> 3.0.pre2' gem 'will_paginate', '~> 3.0.pre2'
gem 'will_paginate-bootstrap'
gem 'nokogiri' gem 'nokogiri'
gem 'acts_as_tree' gem 'acts_as_tree'
gem 'acts_as_list' gem 'acts_as_list'

View File

@ -339,6 +339,8 @@ GEM
rack (>= 1.0) rack (>= 1.0)
rack-test (>= 0.5.3) rack-test (>= 0.5.3)
will_paginate (3.0.5) will_paginate (3.0.5)
will_paginate-bootstrap (1.0.1)
will_paginate (>= 3.0.3)
PLATFORMS PLATFORMS
ruby ruby
@ -397,3 +399,4 @@ DEPENDENCIES
uglifier uglifier
webrat webrat
will_paginate (~> 3.0.pre2) will_paginate (~> 3.0.pre2)
will_paginate-bootstrap

View File

@ -2,6 +2,7 @@
code { word-wrap: break-word; white-space: normal; } code { word-wrap: break-word; white-space: normal; }
.navbar-collapse { max-height: 350px; } .navbar-collapse { max-height: 350px; }
.breadcrumb { margin-top: 10px; margin-bottom: 20px; } /* margins to make sure breadcrumb and h4.breadcrumb line up properly */ .breadcrumb { margin-top: 10px; margin-bottom: 20px; } /* margins to make sure breadcrumb and h4.breadcrumb line up properly */
.panel-primary .panel-heading a { color: #fff; font-weight: bold; }
.table td { word-break: break-word; } .table td { word-break: break-word; }
/* table sorting */ /* table sorting */
@ -25,6 +26,7 @@ body { padding-top: 70px; }
.btn-margin { margin: 2px; } .btn-margin { margin: 2px; }
.col-pad { padding: 0 15px; } .col-pad { padding: 0 15px; }
.dismiss { float: right; cursor: pointer; position: relative; top: -12px; left: 7px; } .dismiss { float: right; cursor: pointer; position: relative; top: -12px; left: 7px; }
.link-no-hover:hover { text-decoration: none; }
/* contact form */ /* contact form */
#contact_form { display: none; } #contact_form { display: none; }
@ -111,44 +113,10 @@ body {
.public_private_icon {display:inline-block;} .public_private_icon {display:inline-block;}
.signed_in_channel_header { width:300px;height: 10px;} .signed_in_channel_header { width:300px;height: 10px;}
#list_progress_bar { width:300px;height: 10px;} #list_progress_bar { width:300px;height: 10px;}
.public_channel_box {
margin:5px;border-radius:7px;height:300px;border:solid 1px red;display:inline-block;width:260px;vertical-align:top
}
.public_channel_inner {
margin-left:10px;
margin-right:5px
}
.public_channel_name {
height: 11px;
font-size: 1.3em;
font-weight:bold;
color: #2565A5;
}
.public_channel_user {
height:15px;
margin-left:7px;
font-size: 0.9em;
}
.progressbar {
height:10px;
}
.public_channel_desc {
height:140px;
word-break:break-all;
}
.public_channel_url {
height:10px;
}
.public_channel_tags {
height:57px;
margin-bottom:10px;
overflow: hidden;
}
.public_channel_thumbnail {
position:absolute;border:2px solid red;display:none
}
.progressbar { height:10px; margin-bottom: 5px; }
.public_channel_description { height: 140px; overflow: hidden; }
.public_channel_tags { height: 40px; overflow: hidden; }
.channelLinks { .channelLinks {
padding: 0 0 0 0; padding: 0 0 0 0;
margin-bottom: 15px; margin-bottom: 15px;

View File

@ -1,22 +1,35 @@
<div> <% @channels.each do |channel| %>
<% @channels.each do |channel| %>
<div class="public_channel_box"> <div class="col-md-4 col-sm-6 col-xs-12">
<div class="public_channel_inner"> <div class="panel panel-primary">
<p class="public_channel_name">
<%= link_to truncate(channel.name, length: 23), channel_path(channel.id), :id => "showsite_#{channel.id}" %> <div class="panel-heading">
</p> <%= link_to channel_path(channel.id), :id => "showsite_#{channel.id}", class: 'link-no-hover' do %>
<p class="public_channel_user" >by <%= channel.user.login if channel.user.present? %></p> <i class="fa fa-bar-chart-o"></i>
<p class="public_channel_desc"><%= channel.description %></p> <% end %>
<div class="progressbar" rel="<%= channel.ranking %>"></div> <%= link_to channel_path(channel.id), :id => "showsite_#{channel.id}" do %>
<p class="public_channel_tags"> <%= truncate(channel.name, length: 23) %>
<% channel.tags.each do |tag| %> <% end %>
<a href="/channels/public?tag=<%=u tag.name %>"><%= tag.name %></a><% unless tag == channel.tags.last %>, <% end %>
<% end %>
</p>
</div> </div>
<div class="panel-body">
<p class="small">by <%= link_to(channel.user.login, user_profile_path(channel.user.login)) if channel.user.present? %></p>
<p class="public_channel_description"><%= channel.description %></p>
<div class="progressbar" rel="<%= channel.ranking %>"></div>
<div class="public_channel_tags">
<% if channel.tags.present? %>
<i class="fa fa-tags"></i>
<% channel.tags.each do |tag| %>
<a href="/channels/public?tag=<%=u tag.name %>"><%= tag.name %></a><% unless tag == channel.tags.last %>, <% end %>
<% end %>
<% end %>
</div>
</div>
</div> </div>
</div>
<% end %> <% end %>
</div>
<div class="clearfix"></div>

View File

@ -4,7 +4,7 @@
<h4 class="breadcrumb"><%= @header %></h4> <h4 class="breadcrumb"><%= @header %></h4>
<%= render :partial => 'list' %> <%= render :partial => 'list' %>
<br> <br>
<%= will_paginate @channels %> <%= will_paginate @channels, renderer: BootstrapPagination::Rails %>
</div> </div>
<div class="col-xs-12 col-sm-3"> <div class="col-xs-12 col-sm-3">

View File

@ -30,7 +30,7 @@
</tbody> </tbody>
</table> </table>
<br> <br>
<%= will_paginate @channels %> <%= will_paginate @channels, renderer: BootstrapPagination::Rails %>
<% else %> <% else %>
<%= t(:user_no_public_channels) %> <%= t(:user_no_public_channels) %>
<% end %> <% end %>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long