Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
Merge branch 'feature/display-welcome-churches' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian /bdougie/ Douglas committed Dec 6, 2014
2 parents e09f135 + bcd7e12 commit 19a0157
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 53 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
/public

/public/system/*

**/.DS_Store
.DS_Store
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ gem 'jquery-rails'
gem 'jbuilder', '~> 1.2'
gem 'sass-rails', '~> 4.0.0'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem "font-awesome-rails"
gem 'masonry-rails'

group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
Expand All @@ -61,4 +63,5 @@ end

group :development do
gem 'sqlite3'
gem 'meta_request'
end
15 changes: 15 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ GEM
bootstrap-sass (3.0.3.0)
sass (~> 3.2)
builder (3.1.4)
callsite (0.0.11)
cancan (1.6.10)
capybara (2.2.1)
mime-types (>= 1.16)
Expand Down Expand Up @@ -125,6 +126,9 @@ GEM
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
jquery-turbolinks (2.1.0)
railties (>= 3.1.0)
turbolinks
json (1.8.1)
jwt (0.1.11)
multi_json (>= 1.5)
Expand All @@ -135,6 +139,12 @@ GEM
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
masonry-rails (0.2.4)
railties
meta_request (0.3.4)
callsite (~> 0.0, >= 0.0.11)
rack-contrib (~> 1.1)
railties (>= 3.0.0, < 5.0.0)
method_source (0.8.2)
mime-types (1.25.1)
mini_magick (3.7.0)
Expand Down Expand Up @@ -191,6 +201,8 @@ GEM
puma (2.8.2)
rack (>= 1.1, < 2.0)
rack (1.5.2)
rack-contrib (1.2.0)
rack (>= 0.9.1)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.0.0)
Expand Down Expand Up @@ -313,7 +325,10 @@ DEPENDENCIES
gmaps4rails
jbuilder (~> 1.2)
jquery-rails
jquery-turbolinks
letter_opener (= 1.1.2)
masonry-rails
meta_request
mini_magick
omniauth-facebook
omniauth-twitter
Expand Down
10 changes: 4 additions & 6 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
//
//= require jquery
//= require jquery_ujs
//= require jquery.turbolinks
//= require masonry/jquery.masonry
//= require masonry/jquery.imagesloaded.min
//= require masonry/modernizr-transitions
//= require bootstrap
//= require turbolinks
//= require jquery.geocomplete.min
//= require contact
//= require html5shiv
//= require jquery.easing.1.3
//= require jquery.flexslider
//= require jquery.html5-placeholder-shim
//= require main
//= require respond
//= require underscore
//= require gmaps/google
Expand Down
8 changes: 8 additions & 0 deletions app/assets/javascripts/churches.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
$(function(){
$('#churches').masonry({
itemSelector: '.box',
columnWidth: 320,
isFitWidth: true
});

});
15 changes: 14 additions & 1 deletion app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
/*$body-bg: #c5c5c5;*/
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require 'masonry/transitions'
*= require_tree .
*/

@import "bootstrap";
@import "font-awesome";

Expand Down
14 changes: 14 additions & 0 deletions app/assets/stylesheets/churches.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#churches {
margin: 0 auto;
}

.box {
margin: 5px;
width: 214px;
}

.box img {
margin-top: 0 auto;
width: 100%;
}

3 changes: 2 additions & 1 deletion app/controllers/welcome_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ class WelcomeController < ApplicationController

def index
@posts = Post.limit(10) # paginate(page: params[:page], per_page: 15)
@churches = Church.limit(10)
ids = Church.pluck(:id).shuffle[0..7]
@churches = Church.where(id: ids)
end

end
4 changes: 4 additions & 0 deletions app/uploaders/image_uploader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def store_dir
process :resize_to_fill => [50, 50]
end

version :medium do
process :resize_to_fill => [300, 300]
end

def default_url
'http://i.imgur.com/bH2Ci4q.jpg'
end
Expand Down
18 changes: 9 additions & 9 deletions app/views/churches/_churches.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="list-group">
<% @churches.each do |church| %>
<h4 class="list-group-item-heading"><%= link_to church.name, church %></h4>
<p class="list-group-item-text">
<%= link_to church.city, churches_path(near: church.city) %><br/>
<%= church.description %>
</p>
<br>
<div id="churches" class="js-masonry">
<% @churches.each do |church| %>
<div class="box panel">
<%= link_to image_tag(church.image.url(:medium)), church %>
<div class="panel-body">
<strong><%= link_to church.name, church %></strong>
<%= church.description %><br/>
</div>
</div>
<% end %>
</div>

3 changes: 2 additions & 1 deletion app/views/churches/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
</div>
</div>
</div>
<div class="container">
<div class="container transitions-enabled" id="container">
<%= render partial: 'churches/churches', locals: { churches: @churches } %>
</div>
<!-- Testimonials todo w/jquery-->
<!-- New Church -->
<div class="text-center welcome">
<%= render "churches/new_church_call" %>
Expand Down
26 changes: 4 additions & 22 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,10 @@
<link href='http://fonts.googleapis.com/css?family=Raleway:400,100,200,300,500,600,700,800,900' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Droid+Serif:400italic' rel='stylesheet' type='text/css'>

<!-- CSS -->
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="js/owl-carousel/owl.carousel.css" />
<link rel="stylesheet" href="js/owl-carousel/owl.theme.css" />
<link rel="stylesheet" href="css/flexslider.css"/>

<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="css/ie8.css" media="screen" />
<![endif]-->

<!-- Add custom CSS here -->
<link href="css/custom.css" rel="stylesheet">

<!--[if lt IE 9]>
<script src="./js/html5shiv.js"></script>
<script src="./js/respond.js"></script>
<![endif]-->

<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= stylesheet_link_tag "application", media: "all" %>
<%= javascript_include_tag "application" %>
<%= javascript_include_tag "http://cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/3.0.4/jquery.imagesloaded.min.js" %>
<%= javascript_include_tag "http://cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.min.js" %>
<%= csrf_meta_tags %>
</head>
<body>
Expand Down
12 changes: 1 addition & 11 deletions app/views/welcome/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,11 @@
</div>

<!-- FYI: Removed partials -->
<!-- Testimonials -->
<!-- Faq Content -->
<!-- Author Content -->
<!-- Clients content -->
<!-- Pricing Content -->
<!-- Partners Content -->
<!-- Info Content -->

<!-- JavaScript -->
<script src="assets/javascripts/jquery.js"></script>
<script src="assets/javascripts/bootstrap.js"></script>
<script src="assets/javascripts/owl-carousel/owl.carousel.js"></script>
<script src='assets/javascripts/jquery.easing.1.3.js'></script>
<script src="assets/javascripts/jquery.flexslider.js"></script>
<script src="assets/javascripts/jquery.html5-placeholder-shim.js"></script>
<script src="assets/javascripts/contact.js"></script>
<script src="assets/javascripts/jquery.ketchup.all.min.js"></script>
<script src="assets/javascripts/main.js"></script>

0 comments on commit 19a0157

Please sign in to comment.