social_stream-events 0.9.2 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/social_stream.event.js +33 -0
- data/app/assets/stylesheets/events.css.scss +37 -0
- data/app/views/events/_event.html.erb +3 -44
- data/app/views/events/_event_date.html.erb +20 -0
- data/app/views/events/_event_date_sidebar.html.erb +14 -0
- data/app/views/events/_event_details.html.erb +21 -0
- data/app/views/events/_event_poster.html.erb +9 -0
- data/app/views/events/_event_sidebar.html.erb +10 -0
- data/app/views/events/index.html.erb +1 -1
- data/app/views/events/index.js.erb +1 -1
- data/config/locales/en.yml +6 -0
- data/config/locales/es.yml +7 -0
- data/lib/social_stream/events/version.rb +1 -1
- data/social_stream-events.gemspec +2 -2
- metadata +17 -13
- data/lib/social_stream/toolbar_config/events.rb +0 -22
@@ -1,3 +1,5 @@
|
|
1
|
+
//= require social_stream.timeline
|
2
|
+
|
1
3
|
SocialStream.Event = (function(SS, $, undefined) {
|
2
4
|
var indexCallbacks = [];
|
3
5
|
|
@@ -9,6 +11,37 @@ SocialStream.Event = (function(SS, $, undefined) {
|
|
9
11
|
$.each(indexCallbacks, function(i, callback){ callback(); });
|
10
12
|
}
|
11
13
|
|
14
|
+
var fixDates = function(){
|
15
|
+
$(".event").each(function(){
|
16
|
+
dateString = $(this).find("time").attr("datetime");
|
17
|
+
|
18
|
+
date = new Date(dateString);
|
19
|
+
|
20
|
+
var dayEl = $(this).find(".event_day");
|
21
|
+
if (dayEl.length) {
|
22
|
+
dayEl.text($.datepicker.formatDate('d', date));
|
23
|
+
}
|
24
|
+
|
25
|
+
var monthEl = $(this).find(".event_month");
|
26
|
+
if (monthEl.length) {
|
27
|
+
monthEl.text($.datepicker.formatDate('M', date));
|
28
|
+
}
|
29
|
+
|
30
|
+
var hourEl = $(this).find(".event_hour");
|
31
|
+
if(hourEl.length) {
|
32
|
+
var minutes = date.getMinutes();
|
33
|
+
if (minutes<10) minutes = "0" + minutes;
|
34
|
+
hourEl.text(date.getHours() + ':' + minutes);
|
35
|
+
}
|
36
|
+
|
37
|
+
});
|
38
|
+
|
39
|
+
}
|
40
|
+
|
41
|
+
addIndexCallback(fixDates);
|
42
|
+
|
43
|
+
SocialStream.Timeline.addInitCallback(index);
|
44
|
+
|
12
45
|
return {
|
13
46
|
addIndexCallback: addIndexCallback,
|
14
47
|
index: index
|
@@ -46,8 +46,15 @@ div.event_date {
|
|
46
46
|
min-width: 30px;
|
47
47
|
}
|
48
48
|
|
49
|
+
.event_sidebar .event_hour {
|
50
|
+
font-size: 2em;
|
51
|
+
line-height: 90%;
|
52
|
+
}
|
53
|
+
|
54
|
+
|
49
55
|
.event_details {
|
50
56
|
padding-top: 10px;
|
57
|
+
float: left;
|
51
58
|
}
|
52
59
|
|
53
60
|
.event_poster {
|
@@ -74,6 +81,30 @@ div.event_date {
|
|
74
81
|
-MS-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
|
75
82
|
}
|
76
83
|
|
84
|
+
.event_frequency {
|
85
|
+
text-align: center;
|
86
|
+
font-size: 0.8em;
|
87
|
+
}
|
88
|
+
|
89
|
+
.event_details .description {
|
90
|
+
overflow: hidden;
|
91
|
+
text-overflow: ellipsis;
|
92
|
+
height: 50px;
|
93
|
+
}
|
94
|
+
|
95
|
+
.event_details .follow_form {
|
96
|
+
float: left;
|
97
|
+
}
|
98
|
+
|
99
|
+
.event_details .follow_sentence {
|
100
|
+
float: left;
|
101
|
+
padding: 20px 10px;
|
102
|
+
}
|
103
|
+
|
104
|
+
.event_sidebar .event_frequency {
|
105
|
+
font-size: 1em;
|
106
|
+
}
|
107
|
+
|
77
108
|
#calendar {
|
78
109
|
margin-top: 20px;
|
79
110
|
}
|
@@ -165,6 +196,12 @@ div.event_date {
|
|
165
196
|
padding: 2px 10px;
|
166
197
|
}
|
167
198
|
|
199
|
+
.event_sidebar {
|
200
|
+
float: left;
|
201
|
+
border-bottom: 1px solid $secondary-color;
|
202
|
+
padding: 5px;
|
203
|
+
}
|
204
|
+
|
168
205
|
.tipsy-sidebar_calendar {
|
169
206
|
min-width: 300px;
|
170
207
|
width: 300px;
|
@@ -1,51 +1,10 @@
|
|
1
1
|
<%= div_for event do %>
|
2
|
-
<%= link_to event, :class => "event_date" do %>
|
3
|
-
<div class="event_date_image">
|
4
|
-
<div class="event_day">
|
5
|
-
<%= event.start_at.day %>
|
6
|
-
</div>
|
7
|
-
<div class="event_month">
|
8
|
-
<%= l event.start_at, :format => "%b" %>
|
9
|
-
</div>
|
10
|
-
<% unless event.all_day? %>
|
11
|
-
<div class="event_hour">
|
12
|
-
<%= l event.start_at, :format => "%H:%M" %>
|
13
|
-
</div>
|
14
|
-
<% end %>
|
15
|
-
</div>
|
16
|
-
<% end %>
|
17
2
|
|
18
|
-
<%=
|
19
|
-
var d = new Date(<%= 1000*event.start_at.to_i %>);
|
20
|
-
$("#<%= dom_id event %> .event_day").text($.datepicker.formatDate('d', d));
|
21
|
-
$("#<%= dom_id event %> .event_month").text($.datepicker.formatDate('M', d));
|
22
|
-
if($("#<%= dom_id event %> .event_hour").length) {
|
23
|
-
var minutes = d.getMinutes();
|
24
|
-
if (minutes<10) minutes = "0" + minutes;
|
25
|
-
$("#<%= dom_id event %> .event_hour").text(d.getHours() + ':' + minutes);
|
26
|
-
}
|
27
|
-
<% end %>
|
3
|
+
<%= render :partial => "events/event_date", :locals => { :event => event } %>
|
28
4
|
|
29
|
-
|
30
|
-
<%= event_timeline_thumb(event) %>
|
5
|
+
<%= render :partial => "events/event_poster", :locals => { :event => event } %>
|
31
6
|
|
32
|
-
|
33
|
-
<div class="event_poster_update">
|
34
|
-
<%= link_to t('event.poster.update'), edit_event_path(event, :poster => true), :remote => true %>
|
35
|
-
</div>
|
36
|
-
<% end %>
|
37
|
-
</div>
|
38
|
-
|
39
|
-
<div class="event_details">
|
40
|
-
<div class="title">
|
41
|
-
<%= link_to event.title, event %>
|
42
|
-
</div>
|
43
|
-
|
44
|
-
<div class="description">
|
45
|
-
<%= simple_format auto_link(event.description) %>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
</div>
|
7
|
+
<%= render :partial => "events/event_details", :locals => { :event => event } %>
|
49
8
|
<% end %>
|
50
9
|
|
51
10
|
<div class="clearfloat"></div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="event_date">
|
2
|
+
<%= link_to event, :class => "event_date" do %>
|
3
|
+
<time datetime="<%= event.start_at.xmlschema %>">
|
4
|
+
<div class="event_day">
|
5
|
+
<%= event.start_at.day %>
|
6
|
+
</div>
|
7
|
+
<div class="event_month">
|
8
|
+
<%= l event.start_at, :format => "%b" %>
|
9
|
+
</div>
|
10
|
+
<% unless event.all_day? %>
|
11
|
+
<div class="event_hour">
|
12
|
+
<%= l event.start_at, :format => "%H:%M" %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
<div class="event_frequency">
|
16
|
+
<%= event.frequency_description %>
|
17
|
+
</div>
|
18
|
+
</time>
|
19
|
+
<% end %>
|
20
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="event_date">
|
2
|
+
<%= link_to event, :class => "event_date" do %>
|
3
|
+
<time datetime="<%= event.start_at.xmlschema %>">
|
4
|
+
<% unless event.all_day? %>
|
5
|
+
<div class="event_hour">
|
6
|
+
<%= l event.start_at, :format => "%H:%M" %>
|
7
|
+
</div>
|
8
|
+
<% end %>
|
9
|
+
<div class="event_frequency">
|
10
|
+
<%= event.frequency_description %>
|
11
|
+
</div>
|
12
|
+
</time>
|
13
|
+
<% end %>
|
14
|
+
</div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div class="event_details">
|
2
|
+
<div class="title">
|
3
|
+
<%= link_to event.title, event %>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div class="description">
|
7
|
+
<%= simple_format auto_link(event.description) %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="follow">
|
11
|
+
<div class="follow_form">
|
12
|
+
<%= render :partial => 'activity_actions/follow_form',
|
13
|
+
:locals => { :activity_object => event.activity_object } %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="follow_sentence">
|
17
|
+
<%= render :partial => 'activity_actions/follow_sentence',
|
18
|
+
:locals => { :activity_object => event.activity_object } %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<%= div_for event_sidebar, :class => "event_sidebar" do %>
|
2
|
+
|
3
|
+
<%= render :partial => "events/event_date_sidebar", :locals => { :event => event_sidebar } %>
|
4
|
+
|
5
|
+
<%= render :partial => "events/event_poster", :locals => { :event => event_sidebar } %>
|
6
|
+
|
7
|
+
<%= render :partial => "events/event_details", :locals => { :event => event_sidebar } %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<div class="clearfloat"></div>
|
data/config/locales/en.yml
CHANGED
@@ -19,6 +19,12 @@ en:
|
|
19
19
|
boxy:
|
20
20
|
close_text: "[close]"
|
21
21
|
event:
|
22
|
+
activity_action:
|
23
|
+
follow: "Follow"
|
24
|
+
sentence:
|
25
|
+
one: "%{followers} follows this"
|
26
|
+
other: "%{followers} follow this"
|
27
|
+
unfollow: "Unfollow"
|
22
28
|
calendar: "Calendar"
|
23
29
|
confirm_delete: "Delete event?"
|
24
30
|
new:
|
data/config/locales/es.yml
CHANGED
@@ -19,6 +19,13 @@ es:
|
|
19
19
|
boxy:
|
20
20
|
close_text: "[cerrar]"
|
21
21
|
event:
|
22
|
+
activity_action:
|
23
|
+
follow: "Me lo apunto"
|
24
|
+
sentence:
|
25
|
+
follow:
|
26
|
+
one: "%{followers} se ha apuntado esto"
|
27
|
+
other: "%{followers} se han apuntado esto"
|
28
|
+
unfollow: "Desapuntar"
|
22
29
|
calendar: "Calendario"
|
23
30
|
confirm_delete: "¿Borrar evento?"
|
24
31
|
new:
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
|
14
14
|
# Gem dependencies
|
15
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.
|
16
|
-
s.add_runtime_dependency('rails-scheduler', '~> 0.0.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.18.0')
|
16
|
+
s.add_runtime_dependency('rails-scheduler', '~> 0.0.8')
|
17
17
|
s.add_runtime_dependency('coffee-rails', '>= 3.1.0')
|
18
18
|
|
19
19
|
# Development Gem dependencies
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-events
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,33 +10,33 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-21 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: social_stream-base
|
17
|
-
requirement: &
|
17
|
+
requirement: &84488380 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.18.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *84488380
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rails-scheduler
|
28
|
-
requirement: &
|
28
|
+
requirement: &84487690 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0.
|
33
|
+
version: 0.0.8
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *84487690
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: coffee-rails
|
39
|
-
requirement: &
|
39
|
+
requirement: &84487110 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 3.1.0
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *84487110
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: sqlite3-ruby
|
50
|
-
requirement: &
|
50
|
+
requirement: &84486800 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *84486800
|
59
59
|
description: ! 'Social Stream is a Ruby on Rails engine providing your application
|
60
60
|
with social networking features and activity streams.
|
61
61
|
|
@@ -87,6 +87,11 @@ files:
|
|
87
87
|
- app/models/room.rb
|
88
88
|
- app/views/events/_calendar_month.erb
|
89
89
|
- app/views/events/_event.html.erb
|
90
|
+
- app/views/events/_event_date.html.erb
|
91
|
+
- app/views/events/_event_date_sidebar.html.erb
|
92
|
+
- app/views/events/_event_details.html.erb
|
93
|
+
- app/views/events/_event_poster.html.erb
|
94
|
+
- app/views/events/_event_sidebar.html.erb
|
90
95
|
- app/views/events/_form_poster.html.erb
|
91
96
|
- app/views/events/_new.html.erb
|
92
97
|
- app/views/events/_sidebar_calendar.html.erb
|
@@ -117,7 +122,6 @@ files:
|
|
117
122
|
- lib/social_stream/events/models/document.rb
|
118
123
|
- lib/social_stream/events/version.rb
|
119
124
|
- lib/social_stream/migrations/events.rb
|
120
|
-
- lib/social_stream/toolbar_config/events.rb
|
121
125
|
- lib/social_stream/views/settings/events.rb
|
122
126
|
- lib/social_stream/views/sidebar/events.rb
|
123
127
|
- social_stream-events.gemspec
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module SocialStream
|
2
|
-
module ToolbarConfig
|
3
|
-
module Events
|
4
|
-
def profile_toolbar_items(subject = current_subject)
|
5
|
-
items = super
|
6
|
-
|
7
|
-
if SocialStream.activity_forms.include?(:event) &&
|
8
|
-
subject.is_a?(Event) &&
|
9
|
-
subject.agenda.present?
|
10
|
-
|
11
|
-
items.insert(1, {
|
12
|
-
:key => :outline_info,
|
13
|
-
:name => image_tag("btn/btn_outline.png")+t('menu.outline'),
|
14
|
-
:url => agenda_path(subject)
|
15
|
-
})
|
16
|
-
end
|
17
|
-
|
18
|
-
items
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|