-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code block and create_gist button
- Loading branch information
Showing
3 changed files
with
61 additions
and
9 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 |
---|---|---|
@@ -1,12 +1,20 @@ | ||
defmodule ElixirGistWeb.CreateGistLive do | ||
use ElixirGistWeb, :live_view | ||
import Phoenix.HTML.Form | ||
alias ElixirGist.{Gists, Gists.Gist} | ||
|
||
def mount(_params, _session, socket) do | ||
socket = | ||
assign( | ||
socket, | ||
form: to_form(Gists.change_gist(%Gist{})) | ||
) | ||
{:ok, socket} | ||
end | ||
# def render(assigns) do | ||
# ~H""" | ||
|
||
# """ | ||
# end | ||
end | ||
|
||
# def render(assigns) do | ||
# ~H""" | ||
|
||
# """ | ||
# 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 |
---|---|---|
@@ -1,6 +1,26 @@ | ||
<.flash_group flash={@flash} /> | ||
<div class="em-gradient flex items-center justify-center"> | ||
<h1 class="font-brand font-bold text-3xl text-white"> | ||
Share Elixir code, notes, and snippets | ||
Share Elixir code, notes, and snippets. | ||
</h1> | ||
</div> | ||
</div> | ||
<.form for={@form}> | ||
<div class="justify center px-28 w-full space-y-4 mb-10"> | ||
<.input field={@form[:description]} placeholder="Gist description..." autocomplete="off" /> | ||
<div> | ||
<div class="flex p-2 items-center bg-emDark rounded-t-md border"> | ||
<div class="w-[300px] mb-2"> | ||
<.input field={@form[:name]} placeholder="Filename including extension.." autocomplete="off"/> | ||
</div> | ||
</div> | ||
<%=textarea(@form, :markup_text, | ||
class: "textarea w-full rounded-b-md", | ||
placeholder: "Insert Code..", | ||
spellcheck: "false", | ||
autocomplete: "off")%> | ||
</div> | ||
<div class="flex justify-end"> | ||
<.button class="create_button">Create Gist</.button> | ||
</div> | ||
</div> | ||
|
||
</.form> |