tkh_events 0.0.3 → 0.0.4

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: 1d1faf153218baeb0176fcdf6b06848733161d51
4
- data.tar.gz: c446b0d51065f1f5b77d22d5e8bde4ac9fce06b2
3
+ metadata.gz: b126c7a4a9b00bf411883692126888c7441dcc0d
4
+ data.tar.gz: 1ba336e77617ed8f90e57d33e54f254bb82d68a2
5
5
  SHA512:
6
- metadata.gz: f6d3737f5c7e43ad55987ab2c2c3a619bc0fff14486a6103a3a11fde17f61effa45d75127360d708eaf877c77f9541b7ea87710736409757ac5e2b59de5e4326
7
- data.tar.gz: f7cb5a37d005fb3da678d0827d116f709946acc272111025da937202d48728ddc38b5203eab1b1fbbf40be147b961ac8ad8e5940220973383fa5b00c72830ae0
6
+ metadata.gz: 3146af72ba4dae4a5f9817f59ac008a4780ede8b6f9cab695b88d51c3f9e897b32218077812bbbc068e229c5c184779c2ac06465a06499113bed4ec7cc66b3a9
7
+ data.tar.gz: 03092a9c9ed5d92c2625efd0b597928b4bcdcb115b692b4608f687fe2e5fb2006481ea4e0d4ae04fe05d3325548404ae6573b0ba8584288f2920ea2586c783f1
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # TKH Content
2
2
 
3
3
 
4
+
5
+ ## 0.0.4
6
+
7
+ * Added an info notice on events page for drafts.
8
+ * Added the ability to publish on event from the context admin sidebar.
9
+
10
+
4
11
  ## 0.0.3
5
12
 
6
13
  * Added a few scopes in event model and created a partial of upcoming events to go into sidebar.
@@ -3,7 +3,7 @@ class EventsController < ApplicationController
3
3
  before_filter :authenticate, :except => 'show'
4
4
  before_filter :authenticate_with_admin, :except => 'show'
5
5
 
6
- before_action :set_event, only: [ :show, :edit, :update, :destroy ]
6
+ before_action :set_event, only: [ :show, :edit, :update, :destroy, :publish ]
7
7
 
8
8
  def index
9
9
  @events = Event.by_recent
@@ -61,6 +61,12 @@ class EventsController < ApplicationController
61
61
  redirect_to events_path, notice: 'Your event has been duplicated.'
62
62
  end
63
63
 
64
+ def publish
65
+ @event.published = true
66
+ @event.save
67
+ redirect_to @event, notice: 'This event was published'
68
+ end
69
+
64
70
  private
65
71
  # Use callbacks to share common setup or constraints between actions.
66
72
  def set_event
@@ -1,14 +1,15 @@
1
1
  <% if administrator? %>
2
2
 
3
3
  <% content_for :admin_context_menu do %>
4
-
5
4
  <h2><%= t('admin_section') %></h2>
6
5
  <ul class="list-group">
7
6
  <li class="list-group-item"><%= link_to t('admin_panel'), events_path %></li>
8
7
  <%= content_tag :li, link_to( "#{t('activerecord.models.comments').capitalize} <span class='badge'>#{Comment.pending.count}</span>".html_safe, pending_comments_path ), class: 'list-group-item' if Comment.pending.count > 0 %>
9
8
  <li class="list-group-item"><%= link_to 'Modify this program', edit_event_path(event) %></li>
9
+ <% unless event.published? %>
10
+ <%= content_tag :li, link_to( 'Publish this program', publish_event_path(event), method: :post), class: 'list-group-item' %>
11
+ <% end %>
10
12
  </ul>
11
-
12
13
  <% end -%>
13
14
 
14
15
  <% end -%>
@@ -0,0 +1,5 @@
1
+ <div class="alert alert-info">
2
+ <span class='glyphicon glyphicon-wrench'></span>
3
+ <strong>Under Construction!</strong>
4
+ <br />This page is still a draft and has not been published yet. It still needs to be completed and edited. Thank you for your patience.
5
+ </div>
@@ -2,6 +2,8 @@
2
2
  <% content_for :meta_description, @event.description %>
3
3
  <% content_for :canonical_link, link_to('', @event, rel: 'canonical') %>
4
4
 
5
+ <%= render 'draft_notice' unless @event.published? %>
6
+
5
7
  <h1><%= @event.name %></h1>
6
8
  <p class='event-starting-date'>
7
9
  <strong>Starting Date & Time</strong><br />
data/config/routes.rb CHANGED
@@ -1,7 +1,10 @@
1
1
  Rails.application.routes.draw do
2
2
  scope "(:locale)", locale: /#{I18n.available_locales.join("|")}/ do
3
3
  resources :events do
4
- member { post :duplicate }
4
+ member do
5
+ post :duplicate
6
+ post :publish
7
+ end
5
8
  end
6
9
  end
7
10
  end
@@ -1,3 +1,3 @@
1
1
  module TkhEvents
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swami Atma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-09 00:00:00.000000000 Z
11
+ date: 2015-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,6 +84,7 @@ files:
84
84
  - app/controllers/events_controller.rb
85
85
  - app/models/event.rb
86
86
  - app/views/events/_admin_context_menu.html.erb
87
+ - app/views/events/_draft_notice.html.erb
87
88
  - app/views/events/_form.html.erb
88
89
  - app/views/events/_tab_admin_menu.html.erb
89
90
  - app/views/events/_upcoming_events_list.html.erb