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

Added helper which provide ability to add your html to <head> tag #2270

Merged
merged 1 commit into from Mar 30, 2015

Conversation

2 participants
@davydovanton
Collaborator

davydovanton commented Mar 27, 2015

Why this needed?

These changes will allow easily define custom tags for page <head> in any sidekiq plugins.

Use case

# in view
<% add_to_head do %>
  <link rel="stylesheet" href="/plugin.css" />
<% end %>
# in web extention
app.get '/plugin.css' do
  custom_css ['/sidekiq/plugin.css']

  # you page code here
end
@mperham

This comment has been minimized.

Show comment
Hide comment
@mperham

mperham Mar 27, 2015

Owner

I'd prefer to see a block helper for rendering the UI so the plugin author can inject any sort of head content:

<% add_to_head do %>
  <link rel="stylesheet" .../>
<% end %>
<h1>History</h1>
...
Owner

mperham commented Mar 27, 2015

I'd prefer to see a block helper for rendering the UI so the plugin author can inject any sort of head content:

<% add_to_head do %>
  <link rel="stylesheet" .../>
<% end %>
<h1>History</h1>
...
@davydovanton

This comment has been minimized.

Show comment
Hide comment
@davydovanton

davydovanton Mar 27, 2015

Collaborator

wow! I like it, thanks for great idea 👍

Collaborator

davydovanton commented Mar 27, 2015

wow! I like it, thanks for great idea 👍

@davydovanton davydovanton changed the title from Added web helper which provide ability to add your own css urls to page to Added helper which provide ability to add your html to <head> tag Mar 27, 2015

@davydovanton

This comment has been minimized.

Show comment
Hide comment
@davydovanton

davydovanton Mar 27, 2015

Collaborator

@mperham I changed helper. But rubinius test is failed in this and this tests. It's normal? %)

Collaborator

davydovanton commented Mar 27, 2015

@mperham I changed helper. But rubinius test is failed in this and this tests. It's normal? %)

@mperham

This comment has been minimized.

Show comment
Hide comment
@mperham

mperham Mar 27, 2015

Owner

Fantastic. 🤘

Owner

mperham commented Mar 27, 2015

Fantastic. 🤘

@mperham

This comment has been minimized.

Show comment
Hide comment
@mperham

mperham Mar 27, 2015

Owner

Can you make it support multiple blocks?

Owner

mperham commented Mar 27, 2015

Can you make it support multiple blocks?

@davydovanton

This comment has been minimized.

Show comment
Hide comment
@davydovanton

davydovanton Mar 28, 2015

Collaborator

@mperham I'm sorry, but i don't understand you correctly 😓
What do you mean by multiple blocks? Something like this:

# in partial #1
<% add_to_head do %>
  <link rel="stylesheet" href="css1.css"/>
<% end %>

# in partial #2
<% add_to_head do %>
  <link rel="stylesheet" href="css2.css"/>
<% end %>

# in partial #3
<% add_to_head do %>
  <link rel="stylesheet" href="css3.css"/>
<% end %>

# in layout partial
<%= display_custom_head %>
# => <link rel="stylesheet" href="css1.css"/>
     <link rel="stylesheet" href="css2.css"/>
     <link rel="stylesheet" href="css3.css"/>

?

Collaborator

davydovanton commented Mar 28, 2015

@mperham I'm sorry, but i don't understand you correctly 😓
What do you mean by multiple blocks? Something like this:

# in partial #1
<% add_to_head do %>
  <link rel="stylesheet" href="css1.css"/>
<% end %>

# in partial #2
<% add_to_head do %>
  <link rel="stylesheet" href="css2.css"/>
<% end %>

# in partial #3
<% add_to_head do %>
  <link rel="stylesheet" href="css3.css"/>
<% end %>

# in layout partial
<%= display_custom_head %>
# => <link rel="stylesheet" href="css1.css"/>
     <link rel="stylesheet" href="css2.css"/>
     <link rel="stylesheet" href="css3.css"/>

?

@mperham

This comment has been minimized.

Show comment
Hide comment
@mperham

mperham Mar 28, 2015

Owner

Exactly.

On Mar 27, 2015, at 17:06, Anton Davydov notifications@github.com wrote:

@mperham I'm sorry, but i don't understand you correctly
What do you mean by multiple blocks? Something like this:

in partial #1

<% add_to_head do %>

<% end %>

in partial #2

<% add_to_head do %>

<% end %>

in partial #3

<% add_to_head do %>

<% end %>

in layout partial

<%= display_custom_head %>

=>

 <link rel="stylesheet" href="css2.css"/>
 <link rel="stylesheet" href="css3.css"/>

?


Reply to this email directly or view it on GitHub.

Owner

mperham commented Mar 28, 2015

Exactly.

On Mar 27, 2015, at 17:06, Anton Davydov notifications@github.com wrote:

@mperham I'm sorry, but i don't understand you correctly
What do you mean by multiple blocks? Something like this:

in partial #1

<% add_to_head do %>

<% end %>

in partial #2

<% add_to_head do %>

<% end %>

in partial #3

<% add_to_head do %>

<% end %>

in layout partial

<%= display_custom_head %>

=>

 <link rel="stylesheet" href="css2.css"/>
 <link rel="stylesheet" href="css3.css"/>

?


Reply to this email directly or view it on GitHub.

@davydovanton

This comment has been minimized.

Show comment
Hide comment
@davydovanton

davydovanton Mar 28, 2015

Collaborator

@mperham I have a little problem with procs in erb, that why I'll hold PR a little 😟

Collaborator

davydovanton commented Mar 28, 2015

@mperham I have a little problem with procs in erb, that why I'll hold PR a little 😟

@davydovanton

This comment has been minimized.

Show comment
Hide comment
@davydovanton

davydovanton Mar 30, 2015

Collaborator

@mperham I solved my problem with erb 🎉 and also I wrote a post about solving this problem 😄

Collaborator

davydovanton commented Mar 30, 2015

@mperham I solved my problem with erb 🎉 and also I wrote a post about solving this problem 😄

@mperham

This comment has been minimized.

Show comment
Hide comment
@mperham

mperham Mar 30, 2015

Owner

Beautiful, really nice work.

Owner

mperham commented Mar 30, 2015

Beautiful, really nice work.

mperham added a commit that referenced this pull request Mar 30, 2015

Merge pull request #2270 from davydovanton/overall-css
Added helper which provide ability to add your html to <head> tag

@mperham mperham merged commit 71e5237 into mperham:master Mar 30, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@davydovanton

This comment has been minimized.

Show comment
Hide comment
@davydovanton

davydovanton Mar 30, 2015

Collaborator

Thanks! 🎆

Collaborator

davydovanton commented Mar 30, 2015

Thanks! 🎆

@davydovanton davydovanton deleted the davydovanton:overall-css branch Mar 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment