-
Notifications
You must be signed in to change notification settings - Fork 4
Conversation
Pull Request Test Coverage Report for Build 145
💛 - Coveralls |
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.
your code is so pretty!
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.
Can you split this up? I have zero objections to the table stuff, but the pagination things feel rather limited in their flexibility, and I'd like to address that separately.
block | ||
end | ||
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 should have said this before, but I think all these helper functions should follow the current standard Harmonium pattern where you can optionally pass CSS class modifiers as the 2nd arg:
@doc """
Constructs a callout class.
"""
def callout_class(modifiers \\ []), do: rev_class(@callout_class, modifiers)
@doc """
Renders a callout.
"""
def callout(do: block), do: callout([], do: block)
def callout(modifiers, do: block), do: callout(:div, modifiers, do: block)
def callout(tag, modifiers, do: block) do
content_tag tag, class: callout_class(modifiers) do
block
end
end
Our Harmonium SCSS Table does include some very useful SUIT modifiers: https://github.com/revelrylabs/harmonium/blob/master/scss/components/_Table.scss
lib/harmonium/table.ex
Outdated
import Phoenix.HTML.Tag | ||
|
||
def table(opts \\ [], do: block) do | ||
table_element(:table, [class: "rev-Table"], opts, do: block) |
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.
If we change all of these to...
def table_data(opts \\ []) do
{block, opts} = Keyword.pop(opts, :do, nil)
table_element(:td, [class: "rev-Table"], opts, do: block)
end
Then we can do something like...
<%= table_data colspan: 5 %>
<%= table_data do: sum %>
otherwise you have to do
<%= table_data colspan: 5 do %>
<%= sum %>
<% end %>
or you can also do this i guess but be nice to the other way i think
table_data([colspan: 5], [do: nil])
Should |
connects to #19
Table
Pagination