From: Jean-Philippe Lang Date: Sat, 3 Dec 2016 09:15:31 +0000 (+0000) Subject: Use css pseudo-classes instead "odd", "even" classes (#15361). X-Git-Tag: 3.4.0~526 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=48f72a3d15def45352c0be4e7f27b2ba3852f949;p=redmine.git Use css pseudo-classes instead "odd", "even" classes (#15361). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@16050 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/views/admin/info.html.erb b/app/views/admin/info.html.erb index 2be1d28fd..c56d14eb6 100644 --- a/app/views/admin/info.html.erb +++ b/app/views/admin/info.html.erb @@ -4,7 +4,7 @@ <% @checklist.each do |label, result| %> - + diff --git a/app/views/admin/plugins.html.erb b/app/views/admin/plugins.html.erb index 020dbc818..e04e06a7b 100644 --- a/app/views/admin/plugins.html.erb +++ b/app/views/admin/plugins.html.erb @@ -3,7 +3,7 @@ <% if @plugins.any? %>
<%= label.is_a?(Symbol) ? l(label) : label %>
<% @plugins.each do |plugin| %> - + <% project_tree(@projects, :init_level => true) do |project, level| %> - <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> + "> diff --git a/app/views/auth_sources/index.html.erb b/app/views/auth_sources/index.html.erb index ecde2bf95..7a0ffa59d 100644 --- a/app/views/auth_sources/index.html.erb +++ b/app/views/auth_sources/index.html.erb @@ -14,7 +14,7 @@ <% for source in @auth_sources %> - "> + diff --git a/app/views/boards/index.html.erb b/app/views/boards/index.html.erb index 29074130b..21280e1af 100644 --- a/app/views/boards/index.html.erb +++ b/app/views/boards/index.html.erb @@ -9,7 +9,7 @@ <% Board.board_tree(@boards) do |board, level| %> - + <% @topics.each do |topic| %> - + diff --git a/app/views/custom_fields/_index.html.erb b/app/views/custom_fields/_index.html.erb index 7a5d37283..417f1c345 100644 --- a/app/views/custom_fields/_index.html.erb +++ b/app/views/custom_fields/_index.html.erb @@ -12,7 +12,7 @@ <% (@custom_fields_by_type[tab[:name]] || []).sort.each do |custom_field| -%> <% back_url = custom_fields_path(:tab => tab[:name]) %> - "> + diff --git a/app/views/email_addresses/_index.html.erb b/app/views/email_addresses/_index.html.erb index 644cd759b..2fcf0b496 100644 --- a/app/views/email_addresses/_index.html.erb +++ b/app/views/email_addresses/_index.html.erb @@ -1,7 +1,7 @@ <% if @addresses.present? %>
<%= plugin.name %> <%= content_tag('span', plugin.description, :class => 'description') unless plugin.description.blank? %> <%= content_tag('span', link_to(plugin.url, plugin.url), :class => 'url') unless plugin.url.blank? %> diff --git a/app/views/admin/projects.html.erb b/app/views/admin/projects.html.erb index d9c32280d..a5667f272 100644 --- a/app/views/admin/projects.html.erb +++ b/app/views/admin/projects.html.erb @@ -27,7 +27,7 @@
<%= link_to_project_settings(project, {}, :title => project.short_description) %> <%= checked_image project.is_public? %> <%= format_date(project.created_on) %>
<%= link_to(source.name, :action => 'edit', :id => source)%> <%= source.auth_method_name %> <%= source.host %>
<%= link_to board.name, project_board_path(board.project, board), :class => "board" %>
<%=h board.description %> diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index 1f58acdc8..4a0a588e9 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -35,7 +35,7 @@
<%= link_to topic.subject, board_message_path(@board, topic) %> <%= link_to_user(topic.author) %> <%= format_time(topic.created_on) %>
<%= link_to custom_field.name, edit_custom_field_path(custom_field) %> <%= l(custom_field.format.label) %> <%= checked_image custom_field.is_required? %>
<% @addresses.each do |address| %> - "> + <% enumerations.each do |enumeration| %> - + diff --git a/app/views/files/index.html.erb b/app/views/files/index.html.erb index decc7314e..e4c61fb1d 100644 --- a/app/views/files/index.html.erb +++ b/app/views/files/index.html.erb @@ -26,7 +26,7 @@ <% end -%> <% container.attachments.each do |file| %> - "> + diff --git a/app/views/groups/_users.html.erb b/app/views/groups/_users.html.erb index 391edf4d8..8c2ab7e4b 100644 --- a/app/views/groups/_users.html.erb +++ b/app/views/groups/_users.html.erb @@ -8,7 +8,7 @@ <% @group.users.sort.each do |user| %> - + <% @groups.each do |group| %> - "> + "> diff --git a/app/views/issue_statuses/index.html.erb b/app/views/issue_statuses/index.html.erb index 8608402ca..f5e6538c2 100644 --- a/app/views/issue_statuses/index.html.erb +++ b/app/views/issue_statuses/index.html.erb @@ -16,7 +16,7 @@ <% for status in @issue_statuses %> - "> + <% if Issue.use_status_for_done_ratio? %> diff --git a/app/views/issues/_changesets.html.erb b/app/views/issues/_changesets.html.erb index f4b47c617..0751e79ff 100644 --- a/app/views/issues/_changesets.html.erb +++ b/app/views/issues/_changesets.html.erb @@ -1,5 +1,5 @@ <% changesets.each do |changeset| %> -
+

<%= link_to_revision(changeset, changeset.repository, :text => "#{l(:label_revision)} #{changeset.format_identifier}") %> <% if changeset.filechanges.any? && User.current.allowed_to?(:browse_repository, changeset.project) %> diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 851fca1a3..9c29a8308 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -26,7 +26,7 @@

<% end %> - "> + "> <%= raw query.inline_columns.map {|column| ""}.join %> diff --git a/app/views/issues/_list_simple.html.erb b/app/views/issues/_list_simple.html.erb index 0d2850cd0..1e23b161b 100644 --- a/app/views/issues/_list_simple.html.erb +++ b/app/views/issues/_list_simple.html.erb @@ -9,7 +9,7 @@ <% for issue in issues %> - + <% principal.memberships.preload(:member_roles => :role).each do |membership| %> <% next if membership.new_record? %> - + diff --git a/app/views/projects/settings/_activities.html.erb b/app/views/projects/settings/_activities.html.erb index db1a3c286..27a27de5d 100644 --- a/app/views/projects/settings/_activities.html.erb +++ b/app/views/projects/settings/_activities.html.erb @@ -12,7 +12,7 @@ <% @project.activities(true).each do |enumeration| %> <%= fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %> - + <% for category in @project.issue_categories %> <% unless category.new_record? %> - + <% members.each do |member| %> <% next if member.new_record? %> - + <% @project.repositories.sort.each do |repository| %> - + diff --git a/app/views/projects/settings/_versions.html.erb b/app/views/projects/settings/_versions.html.erb index 8173433f6..81f3d3353 100644 --- a/app/views/projects/settings/_versions.html.erb +++ b/app/views/projects/settings/_versions.html.erb @@ -22,7 +22,7 @@ <% @versions.sort.each do |version| %> - + diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 87e398ee4..7de31023c 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -49,7 +49,7 @@ <% @trackers.each do |tracker| %> - "> + diff --git a/app/views/queries/index.html.erb b/app/views/queries/index.html.erb index b0dbc05be..c36c0ca1a 100644 --- a/app/views/queries/index.html.erb +++ b/app/views/queries/index.html.erb @@ -9,7 +9,7 @@ <% else %>
<%= toggle_email_address_notify_link(address) %> diff --git a/app/views/enumerations/index.html.erb b/app/views/enumerations/index.html.erb index 5f1d2eafb..542be0873 100644 --- a/app/views/enumerations/index.html.erb +++ b/app/views/enumerations/index.html.erb @@ -13,7 +13,7 @@
<%= link_to enumeration, edit_enumeration_path(enumeration) %> <%= checked_image enumeration.is_default? %> <%= checked_image enumeration.active? %>
<%= link_to_attachment file, :download => true, :title => file.description %> <%= format_time(file.created_on) %> <%= number_to_human_size(file.filesize) %>
<%= link_to_user user %> <%= delete_link group_user_path(@group, :user_id => user), :remote => true %> diff --git a/app/views/groups/index.html.erb b/app/views/groups/index.html.erb index a8886d0d8..7b77fec22 100644 --- a/app/views/groups/index.html.erb +++ b/app/views/groups/index.html.erb @@ -24,7 +24,7 @@
<%= link_to group, edit_group_path(group) %> <%= (@user_count_by_group_id[group.id] || 0) unless group.builtin? %> <%= delete_link group unless group.builtin? %>
<%= link_to status.name, edit_issue_status_path(status) %><%= status.default_done_ratio %>
<%= check_box_tag("ids[]", issue.id, false, :id => nil) %>#{column_content(column, issue)}
<%= check_box_tag("ids[]", issue.id, false, :style => 'display:none;', :id => nil) %> <%= link_to("#{issue.tracker} ##{issue.id}", issue_path(issue)) %> diff --git a/app/views/principal_memberships/_index.html.erb b/app/views/principal_memberships/_index.html.erb index 76a629f95..7cf6f55bb 100644 --- a/app/views/principal_memberships/_index.html.erb +++ b/app/views/principal_memberships/_index.html.erb @@ -13,7 +13,7 @@
<%= link_to_project membership.project %>
<%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %> <%= enumeration %> diff --git a/app/views/projects/settings/_boards.html.erb b/app/views/projects/settings/_boards.html.erb index 16506c889..186a25b2a 100644 --- a/app/views/projects/settings/_boards.html.erb +++ b/app/views/projects/settings/_boards.html.erb @@ -4,7 +4,7 @@
<%= l(:label_board) %>
<%= render_boards_tree(@project.boards) do |board, level| %> -
+
<%= link_to board.name, project_board_path(@project, board) %>
diff --git a/app/views/projects/settings/_issue_categories.html.erb b/app/views/projects/settings/_issue_categories.html.erb index 8a04f2555..2eb416c12 100644 --- a/app/views/projects/settings/_issue_categories.html.erb +++ b/app/views/projects/settings/_issue_categories.html.erb @@ -8,7 +8,7 @@
<%= category.name %> <%= category.assigned_to.name if category.assigned_to %> diff --git a/app/views/projects/settings/_members.html.erb b/app/views/projects/settings/_members.html.erb index 05707fe78..cb24c39cb 100644 --- a/app/views/projects/settings/_members.html.erb +++ b/app/views/projects/settings/_members.html.erb @@ -16,7 +16,7 @@
<%= link_to_user member.principal %> <%= member.roles.sort.collect(&:to_s).join(', ') %> diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb index e60164caa..d0756742a 100644 --- a/app/views/projects/settings/_repositories.html.erb +++ b/app/views/projects/settings/_repositories.html.erb @@ -11,9 +11,9 @@
- <%= link_to repository.identifier, + <%= link_to repository.identifier, {:controller => 'repositories', :action => 'show',:id => @project, :repository_id => repository.identifier_param} if repository.identifier.present? %> <%= checked_image repository.is_default? %>
<%= link_to_version version %> <%= format_date(version.effective_date) %> <%= version.description %>
<%= link_to tracker.name, project_issues_path(@project, :set_filter => 1, :tracker_id => tracker.id) %>
<% @queries.each do |query| %> - + diff --git a/app/views/reports/_details.html.erb b/app/views/reports/_details.html.erb index ab7fe3620..584162939 100644 --- a/app/views/reports/_details.html.erb +++ b/app/views/reports/_details.html.erb @@ -13,7 +13,7 @@ <% for row in rows %> -"> + <% for status in @statuses %> diff --git a/app/views/reports/_simple.html.erb b/app/views/reports/_simple.html.erb index 9dca3554c..c7c88aff4 100644 --- a/app/views/reports/_simple.html.erb +++ b/app/views/reports/_simple.html.erb @@ -10,7 +10,7 @@ <% for row in rows %> -"> + diff --git a/app/views/repositories/_revisions.html.erb b/app/views/repositories/_revisions.html.erb index 9c72204fa..84ef2cdd5 100644 --- a/app/views/repositories/_revisions.html.erb +++ b/app/views/repositories/_revisions.html.erb @@ -33,7 +33,7 @@ end %> <% show_diff = revisions.size > 1 %> <% line_num = 1 %> <% revisions.each do |changeset| %> - + <% id_style = (show_revision_graph ? "padding-left:#{(graph_space + 1) * 20}px" : nil) %> <%= content_tag(:td, :class => 'id', :style => id_style) do %> <%= link_to_revision(changeset, @repository) %> diff --git a/app/views/repositories/committers.html.erb b/app/views/repositories/committers.html.erb index b942e4b82..f23e10252 100644 --- a/app/views/repositories/committers.html.erb +++ b/app/views/repositories/committers.html.erb @@ -17,7 +17,7 @@ <% i = 0 -%> <% @committers.each do |committer, user_id| -%> - + <% Tracker.sorted.all.each do |tracker| %> - "> + <% permissions.each do |permission| %> <% for role in @roles %> - <%= role.builtin? ? "builtin" : "givable" %>"> + "> <% end %> <% perms_by_module[mod].each do |permission| %> - + <% end %> - hascontextmenu"> + <%= raw @query.inline_columns.map {|column| ""}.join %> + <%= ("" * level).html_safe %> <%= ("" * (criterias.length - level - 1)).html_safe -%> diff --git a/app/views/trackers/fields.html.erb b/app/views/trackers/fields.html.erb index b53f1fa0f..61d1da46a 100644 --- a/app/views/trackers/fields.html.erb +++ b/app/views/trackers/fields.html.erb @@ -25,7 +25,7 @@ <% Tracker::CORE_FIELDS.each do |field| %> - "> + <% @custom_fields.each do |field| %> - "> + <% for tracker in @trackers %> - "> + <% for user in @users -%> - "> + diff --git a/app/views/wiki/history.html.erb b/app/views/wiki/history.html.erb index 136923460..e5e72b102 100644 --- a/app/views/wiki/history.html.erb +++ b/app/views/wiki/history.html.erb @@ -19,7 +19,7 @@ <% show_diff = @versions.size > 1 %> <% line_num = 1 %> <% @versions.each do |ver| %> -"> + diff --git a/app/views/workflows/_form.html.erb b/app/views/workflows/_form.html.erb index 9fb2705e7..def117b3f 100644 --- a/app/views/workflows/_form.html.erb +++ b/app/views/workflows/_form.html.erb @@ -24,7 +24,7 @@ <% for old_status in [nil] + @statuses %> <% next if old_status.nil? && name != 'always' %> - "> + <% @trackers.each do |tracker| -%> - + <% @roles.each do |role| -%> <% count = @workflow_counts[[tracker.id, role.id]] || 0 %> diff --git a/app/views/workflows/permissions.html.erb b/app/views/workflows/permissions.html.erb index 0fb4c8bb6..fc886e0d4 100644 --- a/app/views/workflows/permissions.html.erb +++ b/app/views/workflows/permissions.html.erb @@ -60,7 +60,7 @@ <% @fields.each do |field, name| %> - "> + @@ -80,7 +80,7 @@ <% @custom_fields.each do |field| %> - "> + diff --git a/public/javascripts/application.js b/public/javascripts/application.js index f38b69b3c..8d703ade1 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -685,10 +685,6 @@ function beforeShowDatePicker(input, inst) { type: 'put', dataType: 'script', data: data, - success: function(data){ - sortable.children(":even").removeClass("even").addClass("odd"); - sortable.children(":odd").removeClass("odd").addClass("even"); - }, error: function(jqXHR, textStatus, errorThrown){ alert(jqXHR.status); sortable.sortable("cancel"); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index bb2b0b888..4ed40bcb1 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -317,6 +317,8 @@ table.permissions td.role {color:#999;font-size:90%;font-weight:normal !importan tr.wiki-page-version td.updated_on, tr.wiki-page-version td.author {text-align:center;} +div.mypage-box table.time-entries tr.time-entry { background-color: #fff; } +div.mypage-box table.time-entries tr.odd { background-color:#f6f7f8; } tr.time-entry { text-align: center; white-space: nowrap; } tr.time-entry td.issue, tr.time-entry td.comments, tr.time-entry td.subject, tr.time-entry td.activity { text-align: left; white-space: normal; } td.hours { text-align: right; font-weight: bold; padding-right: 0.5em; } @@ -330,7 +332,7 @@ table.plugins span.url { display: block; font-size: 0.9em; } table.list.enumerations {table-layout: fixed;} -tr.group td { padding: 0.8em 0 0.5em 0.3em; border-bottom: 1px solid #ccc; text-align:left; } +tr.group td { padding: 0.8em 0 0.5em 0.3em; border-bottom: 1px solid #ccc; text-align:left; background-color: #fff;} tr.group span.name {font-weight:bold;} tr.group span.count {font-weight:bold; position:relative; top:-1px; color:#fff; font-size:10px; background:#9DB9D5; padding:0px 6px 1px 6px; border-radius:3px; margin-left:4px;} tr.group span.totals {color: #aaa; font-size: 80%;} @@ -343,8 +345,8 @@ table.list tbody tr:hover { background-color:#ffffdd; } table.list tbody tr.group:hover { background-color:inherit; } table td {padding:2px;} table p {margin:0;} -.odd {background-color:#f6f7f8;} -.even {background-color: #fff;} +table.list tbody tr:nth-child(odd), #issue-changesets div.changeset:nth-child(odd) {background-color:#f6f7f8;} +table.list tbody tr:nth-child(even), #issue-changesets div.changeset:nth-child(even) {background-color: #fff;} tr.builtin td.name {font-style:italic;}
<%= link_to query.name, :controller => 'issues', :action => 'index', :project_id => @project, :query_id => query %>
<%= link_to row.name, aggregate_path(@project, field_name, row) %><%= aggregate_link data, { field_name => row.id, "status_id" => status.id }, aggregate_path(@project, field_name, row, :status_id => status.id) %>
<%= link_to row.name, aggregate_path(@project, field_name, row) %> <%= aggregate_link data, { field_name => row.id, "closed" => 0 }, aggregate_path(@project, field_name, row, :status_id => "o") %> <%= aggregate_link data, { field_name => row.id, "closed" => 1 }, aggregate_path(@project, field_name, row, :status_id => "c") %>
<%= committer %> <%= hidden_field_tag "committers[#{i}][]", committer, :id => nil %> diff --git a/app/views/roles/_form.html.erb b/app/views/roles/_form.html.erb index 39acc34a4..5f095e7b2 100644 --- a/app/views/roles/_form.html.erb +++ b/app/views/roles/_form.html.erb @@ -91,7 +91,7 @@ <% end %>
<%= tracker.name %>"><%= check_box_tag "role[permissions_tracker_ids][#{permission}][]", diff --git a/app/views/roles/index.html.erb b/app/views/roles/index.html.erb index 8f059648b..ab0bbe8da 100644 --- a/app/views/roles/index.html.erb +++ b/app/views/roles/index.html.erb @@ -12,7 +12,7 @@
<%= content_tag(role.builtin? ? 'em' : 'span', link_to(role.name, edit_role_path(role))) %> <%= reorder_handle(role) unless role.builtin? %> diff --git a/app/views/roles/permissions.html.erb b/app/views/roles/permissions.html.erb index b403cffe1..ccaa95058 100644 --- a/app/views/roles/permissions.html.erb +++ b/app/views/roles/permissions.html.erb @@ -33,7 +33,7 @@
<%= link_to_function('', "toggleCheckboxesBySelector('.permission-#{permission.name} input')", diff --git a/app/views/timelog/_list.html.erb b/app/views/timelog/_list.html.erb index 3721df274..e84f428c3 100644 --- a/app/views/timelog/_list.html.erb +++ b/app/views/timelog/_list.html.erb @@ -31,7 +31,7 @@
<%= check_box_tag("ids[]", entry.id, false, :id => nil) %>#{column_content(column, entry)} diff --git a/app/views/timelog/_report_criteria.html.erb b/app/views/timelog/_report_criteria.html.erb index f4181172f..6af122ec4 100644 --- a/app/views/timelog/_report_criteria.html.erb +++ b/app/views/timelog/_report_criteria.html.erb @@ -1,7 +1,7 @@ <% @report.hours.collect {|h| h[criterias[level]].to_s}.uniq.each do |value| %> <% hours_for_value = select_hours(hours, criterias[level], value) -%> <% next if hours_for_value.empty? -%> -
<%= format_criteria_value(@report.available_criteria[criterias[level]], value) %>
<%= link_to_function('', "toggleCheckboxesBySelector('input.core-field-#{field}')", :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}", @@ -48,7 +48,7 @@
<%= link_to_function('', "toggleCheckboxesBySelector('input.custom-field-#{field.id}')", :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}", diff --git a/app/views/trackers/index.html.erb b/app/views/trackers/index.html.erb index 5f40cf0ee..8f6c210b7 100644 --- a/app/views/trackers/index.html.erb +++ b/app/views/trackers/index.html.erb @@ -13,7 +13,7 @@
<%= link_to tracker.name, edit_tracker_path(tracker) %> <% unless tracker.workflow_rules.count > 0 %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 60e42c603..3fc82b640 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -37,7 +37,7 @@
<%= avatar(user, :size => "14") %><%= link_to user.login, edit_user_path(user) %> <%= user.firstname %> <%= user.lastname %>
<%= link_to ver.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => ver.version %> <%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').prop('checked', true);") if show_diff && (line_num < @versions.size) %> <%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %>
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input.old-status-#{old_status.try(:id) || 0}')", :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}", diff --git a/app/views/workflows/index.html.erb b/app/views/workflows/index.html.erb index 1a0780532..66785a40c 100644 --- a/app/views/workflows/index.html.erb +++ b/app/views/workflows/index.html.erb @@ -17,7 +17,7 @@
<%= tracker.name %>
<%= name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
<%= field.name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>