Skip to content

Commit

Permalink
Exchanged (help) links for the information.png 'refinery icon'. This …
Browse files Browse the repository at this point in the history
…will happen automatically if you used refinery_help_tag.
  • Loading branch information
parndt committed Mar 8, 2011
1 parent 6c7d61b commit d239bba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.md
Expand Up @@ -3,6 +3,7 @@
* Added `:per_page` option to `crudify` for overriding the number of items to display per page with will_paginate. [Josef Šimánek](https://github.com/simi)
* Deprecated `rake refinery:update` in favour of rails `generate refinerycms --update`. [Philip Arndt](https://github.com/parndt)
* Added `--skip-db` option to `bin/refinerycms` installer which doesn't automate any database creation/migration and skips the `rails generate refinerycms` generator. [Philip Arndt](https:/github.com/parndt)
* Exchanged (help) links for the information.png 'refinery icon'. This will happen automatically if you used `refinery_help_tag`. [Philip Arndt](https://github.com/parndt)
* [See full list](https://github.com/resolve/refinerycms/compare/0.9.9.6...0.9.9.7)

## 0.9.9.6 [7 March 2011]
Expand Down
5 changes: 3 additions & 2 deletions core/lib/refinery/helpers/tag_helper.rb
Expand Up @@ -2,17 +2,18 @@ module Refinery
module Helpers
module TagHelper

# Returns <span class='help' title='Your Input'>(help)</span>
# Returns <img class='help' tooltip='Your Input' src='refinery/icons/information.png' />
# Remember to wrap your block with <span class='label_with_help'></span> if you're using a label next to the help tag.
def refinery_help_tag(title='')
title = h(title) unless title.html_safe?

"<span class=\"help\" title=\"#{title}\">(#{t('help', :scope => 'shared.admin')})</span>".html_safe
refinery_icon_tag('information', :class => 'help', :tooltip => title)
end

# This is just a quick wrapper to render an image tag that lives inside refinery/icons.
# They are all 16x16 so this is the default but is able to be overriden with supplied options.
def refinery_icon_tag(filename, options = {})
filename = "#{filename}.png" unless filename.split('.').many?
image_tag "refinery/icons/#{filename}", {:width => 16, :height => 16}.merge(options)
end

Expand Down
8 changes: 7 additions & 1 deletion core/public/stylesheets/refinery/refinery.css
Expand Up @@ -1369,9 +1369,15 @@ input.button.close_dialog:active, a.button.close_dialog:active, #content a.butto
.hemisquare small {
font-size: 0.9em;
}
.label_with_help label, .label_with_help span.help {
.label_with_help {
vertical-align: middle;
}
.label_with_help label, .label_with_help span.help, .label_with_help img.help {
display: inline;
}
.label_with_help img.help {
vertical-align: middle;
}
.label_with_help span.help {
font-weight: normal;
margin-left: 3px;
Expand Down

0 comments on commit d239bba

Please sign in to comment.