Skip to content

Commit

Permalink
#2391 default events to unofficial and show event timestamps (#2410)
Browse files Browse the repository at this point in the history
* Let admin see event create and update timestamps

* default rpe events to unofficial
  • Loading branch information
stenington authored Mar 4, 2020
1 parent e5286f1 commit 418d321
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
8 changes: 8 additions & 0 deletions app/data_grids/events_grid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ class EventsGrid
link_to "view", admin_event_path(event)
end

column :created_at do
created_at.strftime("%Y-%m-%d %H:%M %Z")
end

column :updated_at, header: "Last updated at" do
updated_at.strftime("%Y-%m-%d %H:%M %Z")
end

filter :ambassador_name do |value|
names = value.split(" ")
first_name = names.first
Expand Down
19 changes: 19 additions & 0 deletions app/views/admin/regional_pitch_events/show.en.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,25 @@
</dl>
</div>
</div>

<hr />

<div class="grid grid--bleed">
<div class="grid__col-auto">
<dl>
<dt>Created at</dt>

<dd>
<%= @event.created_at.strftime("%Y-%m-%d %H:%M %Z") %>
</dd>

<dt>Updated at</dt>

<dd>
<%= @event.updated_at.strftime("%Y-%m-%d %H:%M %Z") %>
</dd>
</div>
</div>
</div>

<p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class ChangeRegionalPitchEventUnofficialDefault < ActiveRecord::Migration[5.1]
def change
change_column_default :regional_pitch_events, :unofficial, true
end
end
5 changes: 3 additions & 2 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ CREATE TABLE public.regional_pitch_events (
venue_address character varying,
event_link character varying,
name character varying,
unofficial boolean DEFAULT false,
unofficial boolean DEFAULT true,
seasons text[] DEFAULT '{}'::text[],
teams_count integer DEFAULT 0,
capacity integer
Expand Down Expand Up @@ -3058,6 +3058,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20191120151220'),
('20191120151819'),
('20191220170611'),
('20200115211026');
('20200115211026'),
('20200303221521');


0 comments on commit 418d321

Please sign in to comment.