Browse files

fix merge conflicts

  • Loading branch information...
2 parents c8bf2f0 + 67cc572 commit d33f832fe5f11ff41c588a4272b49fa55b4e2cab @ghostandthemachine ghostandthemachine committed Dec 10, 2012
Showing with 41 additions and 23 deletions.
  1. +11 −0 lib/helpers/helpers.rb
  2. +4 −0 lib/model/event.rb
  3. +20 −20 lib/public/css/site-styles.css
  4. +3 −3 lib/views/event/create_event.haml
  5. +3 −0 lib/views/event/event.haml
View
11 lib/helpers/helpers.rb
@@ -55,4 +55,15 @@ def unfollow_btn(user)
"<a class='btn btn-primary'> Follow #{user.user_name} </a>"
end
+ def youtube_embed(youtube_url)
+ if youtube_url[/youtu\.be\/([^\?]*)/]
+ youtube_id = $1
+ else
+ youtube_url[/^.*((v\/)|(embed\/)|(watch\?))\??v?=?([^\&\?]*).*/]
+ youtube_id = $5
+ end
+ "<iframe title='YouTube video player' width='480' height='360' src='http://www.youtube.com/embed/#{ youtube_id }' frameborder='0' allowfullscreen></iframe>"
+ #'%iframe{:allowfullscreen => "", :frameborder => "0", :height => "360", :src => "http://www.youtube.com/embed/\#{ youtube_id }", :title => "YouTube video player", :width => "480"}'
+ end
+
end
View
4 lib/model/event.rb
@@ -2,6 +2,7 @@
require './lib/controllers/session/session_controller'
class Event
+
include DataMapper::Resource
property :id, Serial # An auto-increment integer key
property :title, String, default: "" # A varchar type string, for short strings
@@ -17,6 +18,9 @@ class Event
property :video_url, String
property :google_calendar_id, String
+ validates_length_of :body, :max => 1000
+ #validates_format_of :img_url, :with => /regex/https?:\/\/.*\.(?:png|jpg)
+
after :update, :update_time
# after :create, :clean_title
View
40 lib/public/css/site-styles.css
@@ -716,45 +716,45 @@ bottom:14px;
background-color: red;
}
-.etc.element .event-date { border-bottom: 4px solid red; }
+.etc.element .event-date { border-bottom: 4px solid #17B2AF; }
.etc.element.large .event-date { border-bottom: 0px; }
-.etc.large .window-pane-buttons { border-bottom: 7px solid red; }
+.etc.large .window-pane-buttons { border-bottom: 7px solid #17B2AF; }
-.outdoor.element .event-date { border-bottom: 4px solid orange; }
+.outdoor.element .event-date { border-bottom: 4px solid #32943E; }
.outdoor.element.large .event-date { border-bottom: 0px; }
-.outdoor.large .window-pane-buttons { border-bottom: 7px solid orange;}
+.outdoor.large .window-pane-buttons { border-bottom: 7px solid #32943E;}
-.entertainment.element .event-date { border-bottom: 4px solid yellow; }
+.entertainment.element .event-date { border-bottom: 4px solid #CCAE1B; }
.entertainment.element.large .event-date { border-bottom: 0px; }
-.entertainment.large .window-pane-buttons { border-bottom: 7px solid yellow; }
+.entertainment.large .window-pane-buttons { border-bottom: 7px solid #CCAE1B; }
-.personal.element .event-date { border-bottom: 4px solid green; }
+.personal.element .event-date { border-bottom: 4px solid #E76295; }
.personal.element.large .event-date { border-bottom: 0px; }
-.personal.large .window-pane-buttons { border-bottom: 7px solid green; }
+.personal.large .window-pane-buttons { border-bottom: 7px solid #E76295; }
-.tv.element .event-date { border-bottom: 4px solid blue; }
+.tv.element .event-date { border-bottom: 4px solid #3BFFFC; }
.tv.element.large .event-date { border-bottom: 0px; }
-.tv.large .window-pane-buttons { border-bottom: 7px solid blue; }
+.tv.large .window-pane-buttons { border-bottom: 7px solid #3BFFFC; }
-.music.element .event-date { border-bottom: 4px solid purple; }
+.music.element .event-date { border-bottom: 4px solid #6C42CB; }
.music.element.large .event-date { border-bottom: 0px; }
-.music.large .window-pane-buttons { border-bottom: 7px solid purple; }
+.music.large .window-pane-buttons { border-bottom: 7px solid #6C42CB; }
-.movies.element .event-date { border-bottom: 4px solid aqua; }
+.movies.element .event-date { border-bottom: 4px solid #FFFB48; }
.movies.element.large .event-date { border-bottom: 0px; }
-.movies.large .window-pane-buttons { border-bottom: 7px solid aqua; }
+.movies.large .window-pane-buttons { border-bottom: 7px solid #FFFB48; }
-.art.element .event-date { border-bottom: 4px solid brown; }
+.art.element .event-date { border-bottom: 4px solid #916334; }
.art.element.large .event-date { border-bottom: 0px; }
-.art.large .window-pane-buttons { border-bottom: 7px solid brown; }
+.art.large .window-pane-buttons { border-bottom: 7px solid #916334; }
-.community.element .event-date { border-bottom: 4px solid crimson; }
+.community.element .event-date { border-bottom: 4px solid #A4B5BF; }
.community.element.large .event-date { border-bottom: 0px; }
-.community.large .window-pane-buttons { border-bottom: 7px solid crimson; }
+.community.large .window-pane-buttons { border-bottom: 7px solid #A4B5BF; }
-.sports.element .event-date { border-bottom: 4px solid #00A3D9; }
+.sports.element .event-date { border-bottom: 4px solid #DE8021; }
.sports.element.large .event-date { border-bottom: 0px; }
-.sports.large .window-pane-buttons { border-bottom: 7px solid red; }
+.sports.large .window-pane-buttons { border-bottom: 7px solid #DE8021; }
.school.element .event-date { border-bottom: 4px solid darkolivegreen; }
.school.element.large .event-date { border-bottom: 0px; }
View
6 lib/views/event/create_event.haml
@@ -65,7 +65,7 @@
%legend Create an Event
%h4 Event Info
%label Title
- %input.input-xlarge{:name => "title", :placeholder => "title", :type => "text"}
+ %input.input-xlarge{:name => "title", :placeholder => "title", :type => "text", :required => "required"}
%label Body
%textarea
%label Category
@@ -89,9 +89,9 @@
#creation_map{:style => "width:400px;height:300px;"}
%h4 Time
%label Starting (12:00:00)
- %input.input-xlarge#start_time{:name => "start", :placeholder => "starting date/time", :type => "text"}
+ %input.input-xlarge#start_time{:name => "start", :placeholder => "starting date/time", :type => "text", :required => "required"}
%label Ending (12:00:00)
- %input.input-xlarge#end_time{:name => "end", :placeholder => "ending date/time", :type => "text"}
+ %input.input-xlarge#end_time{:name => "end", :placeholder => "ending date/time", :type => "text", :required => "required"}
%h4 Event Media
%label Image url
%input.input-xlarge{:name => "image-url", :placeholder => "image url", :type => "url"}
View
3 lib/views/event/event.haml
@@ -35,10 +35,13 @@
.marketing
.row
%h1= event.title
+ %p= event.video_url
.row
- unless event.img_url.nil?
%img{src: event.img_url}
.row
+ <iframe width="420" height="315" src="http://www.youtube.com/embed/qQ-M9c2nQ34" frameborder="0" allowfullscreen></iframe>
+ .row
%p
Category:
%strong

0 comments on commit d33f832

Please sign in to comment.