-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:EyraCo/eylixir
- Loading branch information
Showing
55 changed files
with
966 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import _ from 'lodash' | ||
|
||
let resizeHandler | ||
|
||
export const ViewportResize = { | ||
|
||
mounted () { | ||
// Direct push of current window size to properly update view | ||
this.pushResizeEvent() | ||
|
||
resizeHandler = _.debounce(() => { | ||
this.pushResizeEvent() | ||
}, 100) | ||
window.addEventListener('resize', resizeHandler) | ||
}, | ||
|
||
pushResizeEvent () { | ||
console.log("pushResizeEvent") | ||
this.pushEvent('viewport_resize', { | ||
width: window.innerWidth, | ||
height: window.innerHeight | ||
}) | ||
}, | ||
|
||
turbolinksDisconnected () { | ||
window.removeEventListener('resize', resizeHandler) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,12 +49,16 @@ defmodule Link.Index do | |
<Intro> | ||
{{ dgettext("eyra-link", "link.message") }} | ||
</Intro> | ||
<Intro> | ||
{{ dgettext("eyra-link", "link.message.interested") }} | ||
<a href="mailto:[email protected]" class="text-primary" >[email protected]</a>. | ||
</Intro> | ||
</div> | ||
<div> | ||
<div :if={{ @current_user != nil }}> | ||
<PrimaryCTA | ||
title={{ cta_title(@current_user) }} | ||
button_label={{ dgettext("eyra-link", "dashboard-button") }} | ||
button_label={{ if @current_user.researcher do dgettext("eyra-link", "dashboard-button") else dgettext("eyra-link", "marketplace-button") end }} | ||
to={{ Routes.live_path(@socket, CoreWeb.Dashboard)}} /> | ||
</div> | ||
<div :if={{ @current_user == nil }}> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
defmodule Core.Helpdesk do | ||
@moduledoc """ | ||
The Helpdesk context. | ||
""" | ||
|
||
import Ecto.Query, warn: false | ||
alias Core.Repo | ||
|
||
alias Core.Helpdesk.Ticket | ||
|
||
def list_open_tickets do | ||
from(t in Ticket, | ||
where: is_nil(t.completed_at), | ||
order_by: {:asc, :inserted_at}, | ||
preload: :user | ||
) | ||
|> Repo.all() | ||
end | ||
|
||
def close_ticket_by_id(id) do | ||
from(t in Ticket, where: t.id == ^id) | ||
|> Repo.update_all(set: [completed_at: DateTime.utc_now()]) | ||
end | ||
|
||
def create_ticket(user, attrs \\ %{}) do | ||
%Ticket{} | ||
|> Ticket.changeset(attrs) | ||
|> Ecto.Changeset.put_assoc(:user, user) | ||
|> Repo.insert() | ||
end | ||
|
||
def new_ticket_changeset(attrs \\ %{}) do | ||
Ticket.changeset(%Ticket{}, attrs) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
defmodule Core.Helpdesk.Ticket do | ||
use Ecto.Schema | ||
import Ecto.Changeset | ||
alias Core.Accounts.User | ||
|
||
schema "helpdesk_tickets" do | ||
belongs_to(:user, User) | ||
field(:description, :string) | ||
field(:title, :string) | ||
field(:completed_at, :utc_datetime) | ||
|
||
timestamps() | ||
end | ||
|
||
@doc false | ||
def changeset(ticket, attrs) do | ||
ticket | ||
|> cast(attrs, [:title, :description, :completed_at]) | ||
|> validate_required([:title, :description]) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.