Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 5 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
View
2 app/controllers/admin/videos_controller.rb
@@ -59,6 +59,6 @@ def set_video
# Never trust parameters from the scary internet, only allow the white list through.
def video_params
- params.require(:video).permit(:link, :views, :description, :likes, :tag_list, :dislikes, :author, :title, :duration,:category, :category_name, :sponsor_name, :sponsor_id, :yt_updated_at, :published_at)
+ params.require(:video).permit(:link, :views, :description, :likes, :tag_list, :dislikes, :author, :title, :duration,:category, :category_name, :sponsor_name, :sponsored, :sponsor_id, :yt_updated_at, :published_at)
end
end
View
2 app/controllers/messages_controller.rb
@@ -29,7 +29,7 @@ def create
# Never trust parameters from the scary internet, only allow the white list through.
def message_params
- params.require(:message).permit(:full_name, :email, :body, :subject, :phone, :source)
+ params.require(:message).permit(:full_name, :email, :body, :subject, :phone, :source, :recipient)
end
end
View
24 app/helpers/application_helper.rb
@@ -10,10 +10,14 @@ def link_to_add_fields(name, f, association)
end
def featured_videos
- Video.order(:published_at).first(4)
+ Video.where(:sponsored => false).order(:published_at).first(4)
end
+
+ def sponsored_videos
+ Video.where(:sponsored => true).first(3)
+ end
def most_viewed
- Video.order(:views).first(4)
+ Video.where(:sponsored => false).order(:views).first(4)
end
def featured_galleries
Gallery.order(:created_at).first(6)
@@ -38,20 +42,8 @@ def video_search
Video.search(params[:query], fields: [{title: :text_start}], limit: 10).map(&:title).to_json
end
- def facebook_likes(url)
- uri = URI("http://graph.facebook.com/"+url)
- data = Net::HTTP.get(uri)
- @likes = JSON.parse(data)['shares']
+ def new_contact_message
+ Message.new
end
-
-
-
-
-
- def twitter_shares(url)
- data = open("http://urls.api.twitter.com/1/urls/count.json?url=#{URI.escape(url)}").read
- data = JSON.parse(data)
- data['count']
- end
end
View
6 app/models/message.rb
@@ -23,7 +23,11 @@ def find_sender
def get_sender
unless source == "CONTACT_FORM_USER"
- Contact.find_by(:email => email)
+ Contact.find_or_create_by(:email => email) do |contact|
+ name_array = full_name.split
+ contact.first_name = name_array[0]
+ contact.last_name = name_array[1]
+ end
else
Contact.find_or_create_by(:email => email) do |contact|
View
101 app/views/layouts/application.html.erb
@@ -63,30 +63,20 @@
<div class="socialnetworks">
<ul class="pull-right">
<li>
- <a href="#" data-toggle="tooltip" title="" data-placement="bottom" class="facebook" data-original-title="Facebook">
+ <a href="http://www.facebook.com/eyeonthecountyhc" data-toggle="tooltip" title="" data-placement="bottom" class="facebook" data-original-title="Facebook">
<i class="fa fa-facebook"></i>
</a>
</li>
<li>
- <a href="#" data-toggle="tooltip" title="" data-placement="bottom" class="youtube" data-original-title="Youtube">
+ <a href="https://www.youtube.com/user/g4reel54" data-toggle="tooltip" title="" data-placement="bottom" class="youtube" data-original-title="Youtube">
<i class="fa fa-youtube"></i>
</a>
</li>
<li>
- <a href="#" data-toggle="tooltip" title="" data-placement="bottom" class="twitter" data-original-title="Twitter">
+ <a href="http://www.twitter.com/EOTCHC" data-toggle="tooltip" title="" data-placement="bottom" class="twitter" data-original-title="Twitter">
<i class="fa fa-twitter"></i>
</a>
</li>
- <li>
- <a href="#" data-toggle="tooltip" title="" data-placement="bottom" class="vimeo" data-original-title="Vimeo">
- <i class="fa fa-vimeo-square"></i>
- </a>
- </li>
- <li>
- <a href="#" data-toggle="tooltip" title="" data-placement="bottom" class="pinterest" data-original-title="Pinterest">
- <i class="fa fa-pinterest"></i>
- </a>
- </li>
</ul>
<div class="clearfix"></div>
</div>
@@ -180,29 +170,33 @@
</div>
<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
<div class="contact-forms">
- <form>
+ <%= form_for (new_contact_message) do |f| %>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 .col-xs-12">
- <input type="text" placeholder="Your Name">
+ <%= f.text_field :full_name, :placeholder => "Name" %>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 .col-xs-12">
- <input type="text" placeholder="Email Address">
+ <%= f.text_field :email, :placeholder => "Email Address" %>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 .col-xs-12">
- <input type="text" placeholder="Subject">
+ <%= f.text_field :subject, :placeholder => "Subject" %>
</div>
<div class="col-lg-12 col-md-12 col-sm-12 .col-xs-12">
- <textarea placeholder="Message"></textarea>
+ <%= f.text_area :body, :placeholder => "Subject" %>
</div>
+ <%= f.hidden_field :source, :value => "CONTACT_FORM" %>
+ <%= f.hidden_field :recipient, :value => Setting.company_email %>
<div class="col-lg-12 col-md-12 col-sm-12 .col-xs-12">
- <button type="button" class="btn btn-primary backcolor">
+ <%= f.submit :class=> "btn btn-primary backcolor" do %>
+
<span>Submit message</span>
<i class="fa fa-angle-right"></i>
- </button>
+
+ <% end %>
<p>Make sure you put a valid email.</p>
</div>
</div>
- </form>
+ <% end %>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12 hidden-xs">
@@ -308,26 +302,33 @@
<div class="widget">
<h2 class="heading">Send us a message</h2>
<div class="contact-forms">
- <form>
- <div class="row">
- <div class="col-lg-4 col-md-4 col-sm-12 .col-xs-12">
- <input type="text" placeholder="Your Name">
- </div>
- <div class="col-lg-4 col-md-4 col-sm-12 .col-xs-12">
- <input type="text" placeholder="Email Address">
- </div>
- <div class="col-lg-4 col-md-4 col-sm-12 .col-xs-12">
- <input type="text" placeholder="Subject">
- </div>
- <div class="col-lg-8 col-md-8 col-sm-12 .col-xs-12">
- <textarea placeholder="Message"></textarea>
- </div>
- <div class="col-lg-4 col-md-4 col-sm-12 .col-xs-12">
- <button type="button" class="btn btn-primary backcolor"><span>Submit message</span><i class="fa fa-angle-right"></i></button>
- <p>Make sure you put a valid email.</p>
- </div>
+ <%= form_for (new_contact_message) do |f| %>
+ <div class="row">
+ <div class="col-lg-6 col-md-6 col-sm-12 .col-xs-12">
+ <%= f.text_field :full_name, :placeholder => "Name" %>
+ </div>
+ <div class="col-lg-6 col-md-6 col-sm-12 .col-xs-12">
+ <%= f.text_field :email, :placeholder => "Email Address" %>
+ </div>
+ <div class="col-lg-12 col-md-12 col-sm-12 .col-xs-12">
+ <%= f.text_field :subject, :placeholder => "Subject" %>
</div>
- </form>
+ <div class="col-lg-12 col-md-12 col-sm-12 .col-xs-12">
+ <%= f.text_area :body, :placeholder => "Message" %>
+ </div>
+ <%= f.hidden_field :source, :value => "CONTACT_FORM" %>
+ <%= f.hidden_field :recipient, :value => Setting.company_email %>
+ <div class="col-lg-12 col-md-12 col-sm-12 .col-xs-12">
+ <%= f.submit :class=> "btn btn-primary backcolor" do %>
+
+ <span>Submit message</span>
+ <i class="fa fa-angle-right"></i>
+
+ <% end %>
+ <p>Make sure you put a valid email.</p>
+ </div>
+ </div>
+ <% end %>
</div>
</div>
</div>
@@ -342,11 +343,21 @@
<div class="col-lg-2 col-md-2 col-sm-3 .col-xs-3">
<div class="socialnetworks">
<ul class="pull-right">
- <li><a href="#" data-toggle="tooltip" title="" class="facebook" data-original-title="Facebook"><i class="fa fa-facebook"></i></a></li>
- <li><a href="#" data-toggle="tooltip" title="" class="youtube" data-original-title="Youtube"><i class="fa fa-youtube"></i></a></li>
- <li><a href="#" data-toggle="tooltip" title="" class="twitter" data-original-title="Twitter"><i class="fa fa-twitter"></i></a></li>
- <li><a href="#" data-toggle="tooltip" title="" class="vimeo" data-original-title="Vimeo"><i class="fa fa-vimeo-square"></i></a></li>
- <li><a href="#" data-toggle="tooltip" title="" class="pinterest" data-original-title="Pinterest"><i class="fa fa-pinterest"></i></a></li>
+ <li>
+ <a href="http://www.facebook.com/eyeonthecountyhc" data-toggle="tooltip" title="" data-placement="bottom" class="facebook" data-original-title="Facebook">
+ <i class="fa fa-facebook"></i>
+ </a>
+ </li>
+ <li>
+ <a href="https://www.youtube.com/user/g4reel54" data-toggle="tooltip" title="" data-placement="bottom" class="youtube" data-original-title="Youtube">
+ <i class="fa fa-youtube"></i>
+ </a>
+ </li>
+ <li>
+ <a href="http://www.twitter.com/EOTCHC" data-toggle="tooltip" title="" data-placement="bottom" class="twitter" data-original-title="Twitter">
+ <i class="fa fa-twitter"></i>
+ </a>
+ </li>
</ul>
<div class="clearfix"></div>
</div>
View
2 app/views/pages/home.html.erb
@@ -271,7 +271,7 @@
<!-- Hot Videos Widget start -->
<div class="widget">
<h2 class="heading">Sponsored Videos</h2>
- <% featured_videos.each do |video| %>
+ <% sponsored_videos.each do |video| %>
<!-- Video Box Start -->
<div class="video-sidebar-container">
<div class="videobox2">

No commit comments for this range

Something went wrong with that request. Please try again.