Skip to content

Commit 418d321

Browse files
authored
#2391 default events to unofficial and show event timestamps (#2410)
* Let admin see event create and update timestamps * default rpe events to unofficial
1 parent e5286f1 commit 418d321

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

app/data_grids/events_grid.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ class EventsGrid
4949
link_to "view", admin_event_path(event)
5050
end
5151

52+
column :created_at do
53+
created_at.strftime("%Y-%m-%d %H:%M %Z")
54+
end
55+
56+
column :updated_at, header: "Last updated at" do
57+
updated_at.strftime("%Y-%m-%d %H:%M %Z")
58+
end
59+
5260
filter :ambassador_name do |value|
5361
names = value.split(" ")
5462
first_name = names.first

app/views/admin/regional_pitch_events/show.en.html.erb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,25 @@
9595
</dl>
9696
</div>
9797
</div>
98+
99+
<hr />
100+
101+
<div class="grid grid--bleed">
102+
<div class="grid__col-auto">
103+
<dl>
104+
<dt>Created at</dt>
105+
106+
<dd>
107+
<%= @event.created_at.strftime("%Y-%m-%d %H:%M %Z") %>
108+
</dd>
109+
110+
<dt>Updated at</dt>
111+
112+
<dd>
113+
<%= @event.updated_at.strftime("%Y-%m-%d %H:%M %Z") %>
114+
</dd>
115+
</div>
116+
</div>
98117
</div>
99118

100119
<p>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class ChangeRegionalPitchEventUnofficialDefault < ActiveRecord::Migration[5.1]
2+
def change
3+
change_column_default :regional_pitch_events, :unofficial, true
4+
end
5+
end

db/structure.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,7 @@ CREATE TABLE public.regional_pitch_events (
10441044
venue_address character varying,
10451045
event_link character varying,
10461046
name character varying,
1047-
unofficial boolean DEFAULT false,
1047+
unofficial boolean DEFAULT true,
10481048
seasons text[] DEFAULT '{}'::text[],
10491049
teams_count integer DEFAULT 0,
10501050
capacity integer
@@ -3058,6 +3058,7 @@ INSERT INTO "schema_migrations" (version) VALUES
30583058
('20191120151220'),
30593059
('20191120151819'),
30603060
('20191220170611'),
3061-
('20200115211026');
3061+
('20200115211026'),
3062+
('20200303221521');
30623063

30633064

0 commit comments

Comments
 (0)