Patch #21245 » 0001-Replace-uses-of-image_tag-with-CSS-part-1-admin.patch
| app/helpers/application_helper.rb | ||
|---|---|---|
|
end
|
||
|
def reorder_links(name, url, method = :post)
|
||
|
link_to(image_tag('2uparrow.png', :alt => l(:label_sort_highest)),
|
||
|
url.merge({"#{name}[move_to]" => 'highest'}),
|
||
|
:method => method, :title => l(:label_sort_highest)) +
|
||
|
link_to(image_tag('1uparrow.png', :alt => l(:label_sort_higher)),
|
||
|
url.merge({"#{name}[move_to]" => 'higher'}),
|
||
|
:method => method, :title => l(:label_sort_higher)) +
|
||
|
link_to(image_tag('1downarrow.png', :alt => l(:label_sort_lower)),
|
||
|
url.merge({"#{name}[move_to]" => 'lower'}),
|
||
|
:method => method, :title => l(:label_sort_lower)) +
|
||
|
link_to(image_tag('2downarrow.png', :alt => l(:label_sort_lowest)),
|
||
|
url.merge({"#{name}[move_to]" => 'lowest'}),
|
||
|
:method => method, :title => l(:label_sort_lowest))
|
||
|
link_to('',
|
||
|
url.merge({"#{name}[move_to]" => 'highest'}), :method => method,
|
||
|
:title => l(:label_sort_highest), :class => 'icon-only icon-move-top') +
|
||
|
link_to('',
|
||
|
url.merge({"#{name}[move_to]" => 'higher'}), :method => method,
|
||
|
:title => l(:label_sort_higher), :class => 'icon-only icon-move-up') +
|
||
|
link_to('',
|
||
|
url.merge({"#{name}[move_to]" => 'lower'}), :method => method,
|
||
|
:title => l(:label_sort_lower), :class => 'icon-only icon-move-down') +
|
||
|
link_to('',
|
||
|
url.merge({"#{name}[move_to]" => 'lowest'}), :method => method,
|
||
|
:title => l(:label_sort_lowest), :class => 'icon-only icon-move-bottom')
|
||
|
end
|
||
|
def breadcrumb(*args)
|
||
| ... | ... | |
|
@current_section += 1
|
||
|
if @current_section > 1
|
||
|
content_tag('div',
|
||
|
link_to(image_tag('edit.png'), options[:edit_section_links].merge(:section => @current_section)),
|
||
|
link_to('', options[:edit_section_links].merge(:section => @current_section),
|
||
|
:class => 'icon-only icon-edit'),
|
||
|
:class => 'contextual',
|
||
|
:title => l(:button_edit_section),
|
||
|
:id => "section-#{@current_section}") + heading.html_safe
|
||
| ... | ... | |
|
end
|
||
|
def toggle_checkboxes_link(selector)
|
||
|
link_to_function image_tag('toggle_check.png'),
|
||
|
link_to_function '',
|
||
|
"toggleCheckboxesBySelector('#{selector}')",
|
||
|
:title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}"
|
||
|
:title => "#{l(:button_check_all)} / #{l(:button_uncheck_all)}",
|
||
|
:class => 'toggle-checkboxes'
|
||
|
end
|
||
|
def progress_bar(pcts, options={})
|
||
| ... | ... | |
|
def checked_image(checked=true)
|
||
|
if checked
|
||
|
@checked_image_tag ||= image_tag('toggle_check.png')
|
||
|
@checked_image_tag ||= content_tag(:span, nil, :class => 'icon-only icon-checked')
|
||
|
end
|
||
|
end
|
||
| app/helpers/email_addresses_helper.rb | ||
|---|---|---|
|
# Returns a link to enable or disable notifications for the address
|
||
|
def toggle_email_address_notify_link(address)
|
||
|
if address.notify?
|
||
|
link_to image_tag('email.png'),
|
||
|
link_to '',
|
||
|
user_email_address_path(address.user, address, :notify => '0'),
|
||
|
:method => :put,
|
||
|
:method => :put, :remote => true,
|
||
|
:title => l(:label_disable_notifications),
|
||
|
:remote => true
|
||
|
:class => 'icon icon-email'
|
||
|
else
|
||
|
link_to image_tag('email_disabled.png'),
|
||
|
link_to '',
|
||
|
user_email_address_path(address.user, address, :notify => '1'),
|
||
|
:method => :put,
|
||
|
:method => :put, :remote => true,
|
||
|
:title => l(:label_enable_notifications),
|
||
|
:remote => true
|
||
|
:class => 'icon icon-email-disabled'
|
||
|
end
|
||
|
end
|
||
|
end
|
||
| app/views/admin/info.html.erb | ||
|---|---|---|
|
<% @checklist.each do |label, result| %>
|
||
|
<tr class="<%= cycle 'odd', 'even' %>">
|
||
|
<td class="name"><%= label.is_a?(Symbol) ? l(label) : label %></td>
|
||
|
<td class="tick"><%= image_tag((result ? 'true.png' : 'exclamation.png'),
|
||
|
:style => "vertical-align:bottom;") %></td>
|
||
|
<td class="tick"><span class="icon-only <%= (result ? 'icon-ok' : 'icon-error') %>"></span></td>
|
||
|
</tr>
|
||
|
<% end %>
|
||
|
</table>
|
||
| app/views/admin/plugins.html.erb | ||
|---|---|---|
|
$("table.plugins td.version span").addClass("unknown");
|
||
|
$.each(data, function(plugin_id, plugin_data){
|
||
|
var s = $("tr#plugin-"+plugin_id+" td.version span");
|
||
|
s.removeClass("icon-checked icon-warning unknown");
|
||
|
s.removeClass("icon-ok icon-warning unknown");
|
||
|
if (plugin_data.url) {
|
||
|
if (s.parent("a").length>0) {
|
||
|
s.unwrap();
|
||
| ... | ... | |
|
s.wrap($("<a></a>").attr("href", plugin_data.url).attr("target", "_blank"));
|
||
|
}
|
||
|
if (plugin_data.c == s.text()) {
|
||
|
s.addClass("icon-checked");
|
||
|
s.addClass("icon-ok");
|
||
|
} else if (plugin_data.c) {
|
||
|
s.addClass("icon-warning");
|
||
|
s.attr("title", "<%= escape_javascript l(:label_latest_compatible_version) %>: "+plugin_data.c);
|
||
| app/views/roles/permissions.html.erb | ||
|---|---|---|
|
<th><%=l(:label_permissions)%></th>
|
||
|
<% @roles.each do |role| %>
|
||
|
<th>
|
||
|
<%= link_to_function('',
|
||
|
"toggleCheckboxesBySelector('input.role-#{role.id}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||
|
:class => 'icon-only icon-checked') %>
|
||
|
<%= content_tag(role.builtin? ? 'em' : 'span', role.name) %>
|
||
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.role-#{role.id}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||
|
</th>
|
||
|
<% end %>
|
||
|
</tr>
|
||
| ... | ... | |
|
<% perms_by_module[mod].each do |permission| %>
|
||
|
<tr class="<%= cycle('odd', 'even') %> permission-<%= permission.name %>">
|
||
|
<td class="name">
|
||
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('.permission-#{permission.name} input')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||
|
<%= link_to_function('',
|
||
|
"toggleCheckboxesBySelector('.permission-#{permission.name} input')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||
|
:class => 'icon-only icon-checked') %>
|
||
|
<%= l_or_humanize(permission.name, :prefix => 'permission_') %>
|
||
|
</td>
|
||
|
<% @roles.each do |role| %>
|
||
| app/views/settings/_repositories.html.erb | ||
|---|---|---|
|
</td>
|
||
|
<td>
|
||
|
<% if enabled %>
|
||
|
<%=
|
||
|
image_tag(
|
||
|
(scm_class.scm_available ? 'true.png' : 'exclamation.png'),
|
||
|
:style => "vertical-align:bottom;"
|
||
|
)
|
||
|
%>
|
||
|
<span class="icon <%= (scm_class.scm_available ? 'icon-ok' : 'icon-error') %>"></span>
|
||
|
<%= scm_class.scm_command %>
|
||
|
<% end %>
|
||
|
</td>
|
||
| ... | ... | |
|
) %>
|
||
|
</td>
|
||
|
<td class="buttons">
|
||
|
<%= link_to(image_tag('delete.png'), '#', :class => 'delete-commit-keywords') %>
|
||
|
<%= link_to('', '#',
|
||
|
:class => 'delete-commit-keywords icon-only icon-del') %>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<% end %>
|
||
| ... | ... | |
|
<td><em class="info"><%= l(:text_comma_separated) %></em></td>
|
||
|
<td></td>
|
||
|
<td></td>
|
||
|
<td class="buttons"><%= link_to(image_tag('add.png'), '#', :class => 'add-commit-keywords') %></td>
|
||
|
<td class="buttons">
|
||
|
<%= link_to('', '#',
|
||
|
:class => 'add-commit-keywords icon-only icon-add') %>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
| app/views/trackers/fields.html.erb | ||
|---|---|---|
|
<th></th>
|
||
|
<% @trackers.each do |tracker| %>
|
||
|
<th>
|
||
|
<%= link_to_function('', "toggleCheckboxesBySelector('input.tracker-#{tracker.id}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||
|
:class => 'icon-only icon-checked') %>
|
||
|
<%= tracker.name %>
|
||
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.tracker-#{tracker.id}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||
|
</th>
|
||
|
<% end %>
|
||
|
</tr>
|
||
| ... | ... | |
|
<% Tracker::CORE_FIELDS.each do |field| %>
|
||
|
<tr class="<%= cycle("odd", "even") %>">
|
||
|
<td class="name">
|
||
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.core-field-#{field}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||
|
<%= link_to_function('', "toggleCheckboxesBySelector('input.core-field-#{field}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||
|
:class => 'icon-only icon-checked') %>
|
||
|
<%= l("field_#{field}".sub(/_id$/, '')) %>
|
||
|
</td>
|
||
|
<% @trackers.each do |tracker| %>
|
||
| ... | ... | |
|
<% @custom_fields.each do |field| %>
|
||
|
<tr class="<%= cycle("odd", "even") %>">
|
||
|
<td class="name">
|
||
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.custom-field-#{field.id}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||
|
<%= link_to_function('', "toggleCheckboxesBySelector('input.custom-field-#{field.id}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||
|
:class => 'icon-only icon-checked') %>
|
||
|
<%= field.name %>
|
||
|
</td>
|
||
|
<% @trackers.each do |tracker| %>
|
||
| app/views/workflows/_form.html.erb | ||
|---|---|---|
|
<thead>
|
||
|
<tr>
|
||
|
<th>
|
||
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||
|
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||
|
:class => 'icon-only icon-checked') %>
|
||
|
<%=l(:label_current_status)%>
|
||
|
</th>
|
||
|
<th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
|
||
| ... | ... | |
|
<td></td>
|
||
|
<% for new_status in @statuses %>
|
||
|
<td style="width:<%= 75 / @statuses.size %>%;">
|
||
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input.new-status-#{new_status.id}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||
|
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input.new-status-#{new_status.id}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||
|
:class => 'icon-only icon-checked') %>
|
||
|
<%= new_status.name %>
|
||
|
</td>
|
||
|
<% end %>
|
||
| ... | ... | |
|
<% next if old_status.nil? && name != 'always' %>
|
||
|
<tr class="<%= cycle("odd", "even") %>">
|
||
|
<td class="name">
|
||
|
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('table.transitions-#{name} input.old-status-#{old_status.try(:id) || 0}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||
|
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input.old-status-#{old_status.try(:id) || 0}')",
|
||
|
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
|
||
|
:class => 'icon-only icon-checked') %>
|
||
|
<%= old_status ? old_status.name : content_tag('em', l(:label_issue_new)) %>
|
||
|
</td>
|
||
| app/views/workflows/edit.html.erb | ||
|---|---|---|
|
<label><%=l(:label_role)%>:
|
||
|
<%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %>
|
||
|
</label>
|
||
|
<a href="#" data-expands="#role_id"><%= image_tag 'bullet_toggle_plus.png' %></a>
|
||
|
<a href="#" data-expands="#role_id"><span class="toggle-multiselect"></span></a>
|
||
|
<label><%=l(:label_tracker)%>:
|
||
|
<%= options_for_workflow_select 'tracker_id[]', Tracker.sorted, @trackers, :id => 'tracker_id', :class => 'expandable' %>
|
||
|
</label>
|
||
|
<a href="#" data-expands="#tracker_id"><%= image_tag 'bullet_toggle_plus.png' %></a>
|
||
|
<a href="#" data-expands="#tracker_id"><span class="toggle-multiselect"></span></a>
|
||
|
<%= submit_tag l(:button_edit), :name => nil %>
|
||
| app/views/workflows/index.html.erb | ||
|---|---|---|
|
<% @roles.each do |role| -%>
|
||
|
<% count = @workflow_counts[[tracker.id, role.id]] || 0 %>
|
||
|
<td>
|
||
|
<%= link_to((count > 0 ? count : image_tag('false.png')), {:action => 'edit', :role_id => role, :tracker_id => tracker}, :title => l(:button_edit)) %>
|
||
|
<%= link_to((count > 0 ? count : content_tag(:span, nil, :class => 'icon-only icon-not-ok')),
|
||
|
{:action => 'edit', :role_id => role, :tracker_id => tracker},
|
||
|
:title => l(:button_edit)) %>
|
||
|
</td>
|
||
|
<% end -%>
|
||
|
</tr>
|
||
| app/views/workflows/permissions.html.erb | ||
|---|---|---|
|
<label><%=l(:label_role)%>:
|
||
|
<%= options_for_workflow_select 'role_id[]', Role.sorted.select(&:consider_workflow?), @roles, :id => 'role_id', :class => 'expandable' %>
|
||
|
</label>
|
||
|
<a href="#" data-expands="#role_id"><%= image_tag 'bullet_toggle_plus.png' %></a>
|
||
|
<a href="#" data-expands="#role_id"><span class="toggle-multiselect"></a>
|
||
|
<label><%=l(:label_tracker)%>:
|
||
|
<%= options_for_workflow_select 'tracker_id[]', Tracker.sorted, @trackers, :id => 'tracker_id', :class => 'expandable' %>
|
||
|
</label>
|
||
|
<a href="#" data-expands="#tracker_id"><%= image_tag 'bullet_toggle_plus.png' %></a>
|
||
|
<a href="#" data-expands="#tracker_id"><span class="toggle-multiselect"></a>
|
||
|
<%= submit_tag l(:button_edit), :name => nil %>
|
||
| public/stylesheets/application.css | ||
|---|---|---|
|
a.collapsible.collapsed {background: url(../images/arrow_collapsed.png) no-repeat -5px 40%;}
|
||
|
a#toggle-completed-versions {color:#999;}
|
||
|
a.toggle-checkboxes { margin-left: 5px; padding-left: 12px; background: url(../images/toggle_check.png) no-repeat 0% 50%; }
|
||
|
/***** Tables *****/
|
||
|
table.list { border: 1px solid #e4e4e4; border-collapse: collapse; width: 100%; margin-bottom: 4px; }
|
||
|
table.list th { background-color:#EEEEEE; padding: 4px; white-space:nowrap; }
|
||
| ... | ... | |
|
.add-filter {width:35%; float:right; text-align: right; vertical-align: top;}
|
||
|
#issue_is_private_wrap {float:right; margin-right:1em;}
|
||
|
.toggle-multiselect {background: url(../images/bullet_toggle_plus.png) no-repeat 0% 40%; padding-left:8px; margin-left:0; cursor:pointer;}
|
||
|
.toggle-multiselect {background: url(../images/bullet_toggle_plus.png) no-repeat 0% 40%; padding-left:16px; margin-left:0; margin-right:5px; cursor:pointer;}
|
||
|
.buttons { font-size: 0.9em; margin-bottom: 1.4em; margin-top: 1em; }
|
||
|
div#issue-changesets {float:right; width:45%; margin-left: 1em; margin-bottom: 1em; background: #fff; padding-left: 1em; font-size: 90%;}
|
||
| ... | ... | |
|
padding-top: 2px;
|
||
|
padding-bottom: 3px;
|
||
|
}
|
||
|
.icon-only {
|
||
|
background-position: 0% 50%;
|
||
|
background-repeat: no-repeat;
|
||
|
padding-left: 16px;
|
||
|
}
|
||
|
.icon-add { background-image: url(../images/add.png); }
|
||
|
.icon-edit { background-image: url(../images/edit.png); }
|
||
| ... | ... | |
|
.icon-time-add { background-image: url(../images/time_add.png); }
|
||
|
.icon-stats { background-image: url(../images/stats.png); }
|
||
|
.icon-warning { background-image: url(../images/warning.png); }
|
||
|
.icon-error { background-image: url(../images/exclamation.png); }
|
||
|
.icon-fav { background-image: url(../images/fav.png); }
|
||
|
.icon-fav-off { background-image: url(../images/fav_off.png); }
|
||
|
.icon-reload { background-image: url(../images/reload.png); }
|
||
|
.icon-lock { background-image: url(../images/locked.png); }
|
||
|
.icon-unlock { background-image: url(../images/unlock.png); }
|
||
|
.icon-checked { background-image: url(../images/true.png); }
|
||
|
.icon-checked { background-image: url(../images/toggle_check.png); }
|
||
|
.icon-details { background-image: url(../images/zoom_in.png); }
|
||
|
.icon-report { background-image: url(../images/report.png); }
|
||
|
.icon-comment { background-image: url(../images/comment.png); }
|
||
| ... | ... | |
|
.icon-zoom-out { background-image: url(../images/zoom_out.png); }
|
||
|
.icon-passwd { background-image: url(../images/textfield_key.png); }
|
||
|
.icon-test { background-image: url(../images/bullet_go.png); }
|
||
|
.icon-email { background-image: url(../images/email.png); }
|
||
|
.icon-email-disabled { background-image: url(../images/email_disabled.png); }
|
||
|
.icon-email-add { background-image: url(../images/email_add.png); }
|
||
|
.icon-move-up { background-image: url(../images/1uparrow.png); }
|
||
|
.icon-move-top { background-image: url(../images/2uparrow.png); }
|
||
|
.icon-move-down { background-image: url(../images/1downarrow.png); }
|
||
|
.icon-move-bottom { background-image: url(../images/2downarrow.png); }
|
||
|
.icon-ok { background-image: url(../images/true.png); }
|
||
|
.icon-not-ok { background-image: url(../images/false.png); }
|
||
|
.icon-file { background-image: url(../images/files/default.png); }
|
||
|
.icon-file.text-plain { background-image: url(../images/files/text.png); }
|
||
| test/unit/helpers/application_helper_test.rb | ||
|---|---|---|
|
# heading that contains inline code
|
||
|
assert_match Regexp.new('<div class="contextual" title="Edit this section" id="section-4">' +
|
||
|
'<a href="/projects/1/wiki/Test/edit\?section=4"><img src="/images/edit.png(\?\d+)?" alt="Edit" /></a></div>' +
|
||
|
'<a class="icon-only icon-edit" href="/projects/1/wiki/Test/edit\?section=4"></a></div>' +
|
||
|
'<a name="Subtitle-with-inline-code"></a>' +
|
||
|
'<h2 >Subtitle with <code>inline code</code><a href="#Subtitle-with-inline-code" class="wiki-anchor">¶</a></h2>'),
|
||
|
result
|
||
|
# last heading
|
||
|
assert_match Regexp.new('<div class="contextual" title="Edit this section" id="section-5">' +
|
||
|
'<a href="/projects/1/wiki/Test/edit\?section=5"><img src="/images/edit.png(\?\d+)?" alt="Edit" /></a></div>' +
|
||
|
'<a class="icon-only icon-edit" href="/projects/1/wiki/Test/edit\?section=5"></a></div>' +
|
||
|
'<a name="Subtitle-after-pre-tag"></a>' +
|
||
|
'<h2 >Subtitle after pre tag<a href="#Subtitle-after-pre-tag" class="wiki-anchor">¶</a></h2>'),
|
||
|
result
|
||