tkh_events 0.0.2.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 40fbec7b4c4893ab3fc571dd2b6845d858062422
4
- data.tar.gz: 0a2d6d1c10e297664c4604a264dded5edc8da692
3
+ metadata.gz: 1d1faf153218baeb0176fcdf6b06848733161d51
4
+ data.tar.gz: c446b0d51065f1f5b77d22d5e8bde4ac9fce06b2
5
5
  SHA512:
6
- metadata.gz: 55b4c90eba126bcb39de34bd36e484fe330cc457691703ca98478a13e46aaf605ac4ff9cdc95b2400b1d9e7f463d633be01be9ecf2c2848447d9972c17e61b5e
7
- data.tar.gz: 85c16e82c0e7b127410d90e6eae769efd5d6cef938b0e6cb4f70a199d1dfd28c35089ed123a6572b734c02128316ffb7d1f2cc5200120ffc58052b5a5e49f3e1
6
+ metadata.gz: f6d3737f5c7e43ad55987ab2c2c3a619bc0fff14486a6103a3a11fde17f61effa45d75127360d708eaf877c77f9541b7ea87710736409757ac5e2b59de5e4326
7
+ data.tar.gz: f7cb5a37d005fb3da678d0827d116f709946acc272111025da937202d48728ddc38b5203eab1b1fbbf40be147b961ac8ad8e5940220973383fa5b00c72830ae0
data/CHANGELOG.md CHANGED
@@ -1,11 +1,17 @@
1
1
  # TKH Content
2
2
 
3
3
 
4
+ ## 0.0.3
5
+
6
+ * Added a few scopes in event model and created a partial of upcoming events to go into sidebar.
7
+ * Added an 'upcoming events list' partial to be generated in CMS pages.
8
+
4
9
 
5
10
  ## 0.0.2.1
6
11
 
7
12
  * Debugged the create_or_update_migrations generator
8
13
 
14
+
9
15
  ## 0.0.2
10
16
 
11
17
  * Show view generates shared menus partial
data/app/models/event.rb CHANGED
@@ -14,6 +14,8 @@ class Event < ActiveRecord::Base
14
14
  end
15
15
 
16
16
  scope :published, -> { where( published: true ) }
17
+ scope :in_the_future, -> { where( 'starts_at >= ?', Time.zone.now.beginning_of_day ) }
18
+ scope :chronologically, -> { order 'starts_at' }
17
19
  scope :by_recent, -> { order('updated_at desc') }
18
20
 
19
21
  def self.duplicate( source_event_id )
@@ -0,0 +1,14 @@
1
+ <% @events = Event.published.in_the_future.chronologically %>
2
+
3
+ <% unless @events.blank? %>
4
+ <% @events.each do |event| %>
5
+ <div class="sidebar-individual-event">
6
+ <h3><%= link_to event.name, event %></h3>
7
+ <h4>starting: <%= l event.starts_at, format: :tkh_default %></h4>
8
+ <p>
9
+ <%= event.description %><br />
10
+ <%= link_to 'see details', event %>
11
+ </p>
12
+ </div>
13
+ <% end %>
14
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <% @events = Event.published.in_the_future.chronologically %>
2
+
3
+ <% unless @events.blank? %>
4
+ <h2><%= heading || 'upcoming events' %></h2>
5
+ <% @events.each do |event| %>
6
+ <div class="sidebar-individual-event">
7
+ <h3><%= link_to event.name, event %></h3>
8
+ <h4>starting: <%= l event.starts_at, format: :tkh_default %></h4>
9
+ <p>
10
+ <%= event.description %><br />
11
+ <%= link_to 'see details', event %>
12
+ </p>
13
+ </div>
14
+ <% end %>
15
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module TkhEvents
2
- VERSION = "0.0.2.1"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swami Atma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-24 00:00:00.000000000 Z
11
+ date: 2015-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,6 +86,8 @@ files:
86
86
  - app/views/events/_admin_context_menu.html.erb
87
87
  - app/views/events/_form.html.erb
88
88
  - app/views/events/_tab_admin_menu.html.erb
89
+ - app/views/events/_upcoming_events_list.html.erb
90
+ - app/views/events/_upcoming_in_sidebar.html.erb
89
91
  - app/views/events/edit.html.erb
90
92
  - app/views/events/index.html.erb
91
93
  - app/views/events/new.html.erb