-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Repo.teasers for event index #85
Conversation
2a373f1
to
64c7215
Compare
Codecov Report
@@ Coverage Diff @@
## master #85 +/- ##
==========================================
+ Coverage 96.76% 96.77% +<.01%
==========================================
Files 346 346
Lines 5446 5449 +3
==========================================
+ Hits 5270 5273 +3
Misses 176 176 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few suggestions / questions
sort_order: "ASC" | ||
) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit repetitive, how do you feel about:
def get_events_async(id, timeframe) do
fn ->
Repo.teasers(
type: :event,
related_to: id,
items_per_page: 10,
date_op: if timeframe == :past, do: "<", else: ">=",
date: [value: "now"],
sort_order: if timeframe == :past, do: "DESC" else: "ASC"
)
end
end
%Content.Teaser{path: path} -> fn -> cms_static_page_path(@conn, path) end | ||
%Content.Event{} -> fn -> event_path(@conn, :show, event) end | ||
end | ||
%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't read too deeply into this, but I though that the list would always be Teaser.t()
and not Event.t()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're keeping support for when this template is used by the very old (and not often used) Upcoming Board Meetings paragraph, which serves us Event.t()
structs. See this commit for a little more detail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e756f6a
to
8b9a0cb
Compare
This reverts commit d5d4b2e.
- make event times naive once parsed to avoid double TZ shift - we only have the start time at the moment, not the whole range
- event list is shared by multiple source functions, one of which is still providing %Event{} structs and is out of scope for changing at the moment
61fd5a6
to
914c80e
Compare
@ryan-mahoney now that the dependent branch is merged into master I changed the base of this. I think you already approved it via comment but now I need an official approval (pending tests). Thanks. |
Summary of changes
Asana Ticket: Use teaser request for Events