Skip to content
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

davydovanton
Copy link
Contributor

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
Copy link
Collaborator

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
Copy link
Contributor Author

wow! I like it, thanks for great idea 👍

@davydovanton davydovanton force-pushed the overall-css branch 3 times, most recently from 3756789 to 8488dee Compare March 27, 2015 23:31
@davydovanton davydovanton changed the title Added web helper which provide ability to add your own css urls to page Added helper which provide ability to add your html to <head> tag Mar 27, 2015
@davydovanton
Copy link
Contributor Author

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

@mperham
Copy link
Collaborator

mperham commented Mar 27, 2015

Fantastic. 🤘

@mperham
Copy link
Collaborator

mperham commented Mar 27, 2015

Can you make it support multiple blocks?

@davydovanton
Copy link
Contributor Author

@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
Copy link
Collaborator

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
Copy link
Contributor Author

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

@davydovanton
Copy link
Contributor Author

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

@mperham
Copy link
Collaborator

mperham commented Mar 30, 2015

Beautiful, really nice work.

mperham added a commit that referenced this pull request Mar 30, 2015
Added helper which provide ability to add your html to <head> tag
@mperham mperham merged commit 71e5237 into sidekiq:master Mar 30, 2015
@davydovanton
Copy link
Contributor Author

Thanks! 🎆

@davydovanton davydovanton deleted the overall-css branch March 30, 2015 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants