-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename your .html.eex and .html.leex templates to .html.heex (#283)
* Rename your .html.eex and .html.leex templates to .html.heex * Fix some attribute interpolation errors * More template fixes * More template fixes
- Loading branch information
Showing
18 changed files
with
121 additions
and
112 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
File renamed without changes.
13 changes: 1 addition & 12 deletions
13
...templates/game/index/game_table.html.leex → ...templates/game/index/game_table.html.heex
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
File renamed without changes.
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
File renamed without changes.
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
24 changes: 24 additions & 0 deletions
24
apps/demon_spirit_web/lib/demon_spirit_web/templates/game/show/card.html.heex
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,24 @@ | ||
<div class={DemonSpiritWeb.CardView.outer_card_class(@class, @card.color)}> | ||
<div class={DemonSpiritWeb.CardView.inner_card_class(@flip)}> | ||
<span class={DemonSpiritWeb.CardView.span_class(@card.name)}> | ||
<%= @card.name %> | ||
</span> | ||
|
||
<table class="border-collapse mb-0 w-full"> | ||
<tbody> | ||
<%= for i <- 0..4 do %> | ||
<tr class="card_row"> | ||
<%= for j <- 0..4 do %> | ||
<% | ||
x = j - 2 | ||
y = (i * -1) + 2 | ||
%> | ||
<td class={DemonSpiritWeb.CardView.cell_class(x, y, @card.moves)}> | ||
</td> | ||
<% end %> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> |
48 changes: 0 additions & 48 deletions
48
apps/demon_spirit_web/lib/demon_spirit_web/templates/game/show/card.html.leex
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
2 changes: 1 addition & 1 deletion
2
...s/game/show/ready_player_column.html.leex → ...s/game/show/ready_player_column.html.heex
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions
29
apps/demon_spirit_web/lib/demon_spirit_web/views/card_view.ex
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,29 @@ | ||
defmodule DemonSpiritWeb.CardView do | ||
use DemonSpiritWeb, :view | ||
|
||
def outer_card_class(card_class, card_color) do | ||
"card #{card_class} bg-gray-200 border shadow-md rounded inline-block w-20 md:w-24 lg:w-32 #{card_color} text-sm" | ||
end | ||
|
||
def inner_card_class(flip) do | ||
base_class = "p-2 pt-0" | ||
flip_class = if flip, do: " flip", else: "" | ||
|
||
"#{base_class}#{flip_class}" | ||
end | ||
|
||
def span_class(card_name) do | ||
base_class = "title font-semibold py-1 inline-block" | ||
size_class = if String.length(card_name) > 8, do: " text-md", else: " text-lg" | ||
|
||
"#{base_class}#{size_class}" | ||
end | ||
|
||
def cell_class(x, y, card_moves) do | ||
base_class = "card_cell border border-black w-1/5 p-0" | ||
move_class = if {x, y} in card_moves, do: " move", else: "" | ||
center_class = if {x, y} == {0, 0}, do: " center", else: "" | ||
|
||
"#{base_class}#{move_class}#{center_class}" | ||
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