Skip to content
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

Event page #34

Draft
wants to merge 37 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ebf9318
Generated event crud operations
adriansalamon Nov 22, 2022
afb5e32
fix: Date inputs in cronological order
hampfh Nov 25, 2022
3433071
feat: Add events page and move events-admin to separate route
hampfh Dec 26, 2022
cc4e56e
Fixed some naming of modules, logic integration for events, including…
adriansalamon Jan 31, 2023
fb8b40b
fix: Add date format to events on events page
hampfh Feb 14, 2023
2791c9c
feat: Add live counter to event page
hampfh Feb 14, 2023
b039b0f
fix: Fix typo remove dataloger, add metaloger
hampfh Feb 14, 2023
3eac45c
fix: Remove unused module
hampfh Feb 14, 2023
4129266
Merge branch 'dev' of github.com:datasektionen/haj into hampus/events…
hampfh Feb 28, 2023
0556c8c
Merge branch 'dev' of github.com:datasektionen/haj into hampus/events…
hampfh Feb 28, 2023
f7edd43
feat: Add editable event types and event ticket types
hampfh Feb 28, 2023
33e6824
fix: Make form component deletable
hampfh Mar 26, 2023
38a5d31
fix: Available tickets are now tied to a specific event and not a sum…
hampfh Mar 26, 2023
4a7938d
feat: crud for events
adriansalamon Mar 30, 2023
86950a7
Add events to sidebar, and add single event page
hampfh Mar 30, 2023
3f5ab48
Add data fetching for single page event, and improved layout of events
hampfh Mar 30, 2023
69b95ab
Merge branch 'main' into hampus/events_listings
adriansalamon Feb 8, 2024
fa8db44
bump deps
adriansalamon Feb 8, 2024
499f358
feat: working events settings
adriansalamon Feb 8, 2024
d2ca9a0
first stab att event ui
adriansalamon Feb 8, 2024
55c2188
added ticketless events and formatting
adriansalamon Feb 10, 2024
b32d3b7
checkpoint: added basic forms
adriansalamon Mar 6, 2023
2c3bf10
formatting
adriansalamon Feb 10, 2024
0ef2bfa
checkpoint: it is now possible to submit forms
adriansalamon Mar 7, 2023
bcf999d
added functioning form creation
adriansalamon Feb 11, 2024
408d128
feat: add reusable search combobox component
adriansalamon Feb 11, 2024
614b6f3
wip event registration with forms
adriansalamon Feb 11, 2024
61b5e91
fix creation of event when assoc not loaded
adriansalamon Feb 11, 2024
f8815ad
minor improvement to queries on load
adriansalamon Feb 12, 2024
f7b662c
bump tailwind
adriansalamon Feb 12, 2024
3d0478d
ui consistency fixes
adriansalamon Feb 12, 2024
0f11e54
event signups now possible, and ui to view event registrations
adriansalamon Feb 12, 2024
e5fa653
fix broken things
adriansalamon Feb 12, 2024
8a44fdc
mobile friendly
adriansalamon Feb 12, 2024
bf37379
fix warnings
adriansalamon Aug 28, 2024
c6d29d7
minor fixes
adriansalamon Aug 28, 2024
055ab83
fix logic when getting previous form submission
adriansalamon Sep 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .formatter.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
import_deps: [:ecto, :phoenix, :let_me],
import_deps: [:ecto, :ecto_sql, :phoenix, :let_me],
plugins: [TailwindFormatter.MultiFormatter],
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs,heex}"],
subdirectories: ["priv/*/migrations"],
Expand Down
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ config :logger, :console,
config :phoenix, :json_library, Jason

config :tailwind,
version: "3.0.24",
version: "3.4.1",
default: [
args: ~w(
--config=tailwind.config.js
Expand Down
7 changes: 7 additions & 0 deletions lib/haj/accounts/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defmodule Haj.Accounts.User do

many_to_many :foods, Haj.Foods.Food, join_through: "food_preferences", on_replace: :delete
has_many :group_memberships, Haj.Spex.GroupMembership
has_many :user_tokens, Haj.Accounts.UserToken

field :food_preference_other, :string

Expand Down Expand Up @@ -65,3 +66,9 @@ defmodule Haj.Accounts.User do
end)
end
end

defimpl Phoenix.HTML.Safe, for: Haj.Accounts.User do
def to_iodata(user) do
Phoenix.HTML.Engine.html_escape(user.full_name)
end
end
10 changes: 6 additions & 4 deletions lib/haj/accounts/user_token.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule Haj.Accounts.UserToken do
use Ecto.Schema
import Ecto.Query
alias Haj.Accounts.UserToken
alias Haj.Accounts.User

@rand_size 32
@session_validity_in_days 60
Expand Down Expand Up @@ -49,10 +50,11 @@ defmodule Haj.Accounts.UserToken do
"""
def verify_session_token_query(token) do
query =
from token in token_and_context_query(token, "session"),
join: user in assoc(token, :user),
where: token.inserted_at > ago(@session_validity_in_days, "day"),
select: user
from user in User,
join: ut in assoc(user, :user_tokens),
where: ut.token == ^token,
where: ut.context == "session",
where: ut.inserted_at > ago(@session_validity_in_days, "day")

{:ok, query}
end
Expand Down
4 changes: 3 additions & 1 deletion lib/haj/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ defmodule Haj.Application do
# Start the PubSub system
{Phoenix.PubSub, name: Haj.PubSub},
# Start the Endpoint (http/https)
HajWeb.Endpoint
HajWeb.Endpoint,
# Start the presence tracker (for online users)
Haj.Presence,
# Start a worker by calling: Haj.Worker.start_link(arg)
# {Haj.Worker, arg}
]
Expand Down
Loading