Project

General

Profile

Feature #23980 » 0005-Replace-tags-with-helper.patch

Takashi Kato, 2022-03-21 22:32

View differences:

app/views/activities/_activities.html.erb
<h3><%= format_activity_day(day) %></h3>
<dl>
<% sort_activity_events(events_by_day[day]).each do |e, in_group| -%>
<dt class="<%= e.event_type %> icon icon-<%= e.event_type %> <%= "grouped" if in_group %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
<%= avatar(e.event_author) if e.respond_to?(:event_author) %>
<span class="time"><%= format_time(e.event_datetime, false) %></span>
<%= content_tag('span', e.project, :class => 'project') if @project.nil? || @project != e.project %>
<%= link_to format_activity_title(e.event_title), e.event_url %>
</dt>
<%= tag.dt class: [e.event_type, :icon, "icon-#{e.event_type}", ("grouped" if in_group), (User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author) ? 'me' : nil] do %>
<%= avatar(e.event_author) if e.respond_to?(:event_author) %>
<span class="time"><%= format_time(e.event_datetime, false) %></span>
<%= content_tag('span', e.project, :class => 'project') if @project.nil? || @project != e.project %>
<%= link_to format_activity_title(e.event_title), e.event_url %>
<% end %>
<dd class="<%= "grouped" if in_group %>"><span class="description"><%= format_activity_description(e.event_description) %></span>
<span class="author"><%= link_to_user(e.event_author) if e.respond_to?(:event_author) %></span></dd>
<% end -%>
app/views/admin/info.html.erb
<% @checklist.each do |label, result| %>
<tr>
<td class="name"><%= label.is_a?(Symbol) ? l(label) : label %></td>
<td class="tick"><span class="icon-only <%= (result ? 'icon-ok' : 'icon-error') %>"></span></td>
<td class="tick"><%= tag.span class: ['icon-only', result ? 'icon-ok' : 'icon-error' ] %></td>
</tr>
<% end %>
</table>
app/views/attachments/edit_all.html.erb
<% @attachments.each do |attachment| %>
<tr>
<td colspan="2">
<span class="icon icon-attachment"><%= attachment.filename_was %></span>
<%= tag.span attachment.filename_was, class: 'icon icon-attachment' %>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<span class="author"><%= attachment.author %>, <%= format_time(attachment.created_on) %></span>
</td>
app/views/boards/show.html.erb
<tbody>
<% @topics.each do |topic| %>
<tr id="message-<%= topic.id %>" class="message <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
<td class="subject icon <%= 'icon-sticky' if topic.sticky? %> <%= 'icon-locked' if topic.locked? %>"><%= link_to topic.subject, board_message_path(@board, topic) %></td>
<%= tag.td link_to(topic.subject, board_message_path(@board, topic)), class: ['subject', 'icon', ('icon-sticky' if topic.sticky?), ('icon-locked' if topic.locked?)] %>
<td class="author"><%= link_to_user(topic.author) %></td>
<td class="created_on"><%= format_time(topic.created_on) %></td>
<td class="reply-count"><%= topic.replies_count %></td>
app/views/common/_calendar.html.erb
<%= check_box_tag 'ids[]', i.id, false, :style => 'display:none;', :id => nil %>
</div>
<% else %>
<span class="icon icon-package">
<%= tag.span(class: 'icon icon-package') do %>
<%= "#{i.project} -" unless @project && @project == i.project %>
<%= link_to_version i %>
</span>
<% end %>
<% end %>
<% end %>
</td>
app/views/custom_field_enumerations/index.html.erb
<ul id="custom_field_enumerations" class="flat">
<% @custom_field.enumerations.each_with_index do |value, position| %>
<li>
<span class="icon-only icon-sort-handle sort-handle"></span>
<%= tag.span class: 'icon-only icon-sort-handle sort-handle' %>
<%= hidden_field_tag "custom_field_enumerations[#{value.id}][position]", position, :class => 'position' %>
<%= text_field_tag "custom_field_enumerations[#{value.id}][name]", value.name, :size => 40 %>
<%= hidden_field_tag "custom_field_enumerations[#{value.id}][active]", 0 %>
app/views/issue_statuses/index.html.erb
<td><%= checked_image status.is_closed? %></td>
<td>
<% unless WorkflowTransition.where('old_status_id = ? OR new_status_id = ?', status.id, status.id).exists? %>
<span class="icon icon-warning">
<%= tag.span(class: 'icon icon-warning') do %>
<%= l(:text_status_no_workflow) %> (<%= link_to l(:button_edit), edit_workflows_path(:used_statuses_only => 0) %>)
</span>
<% end %>
<% end %>
</td>
<td class="buttons">
app/views/issues/_attributes.html.erb
<%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true},
:onchange => "updateIssueFrom('#{escape_javascript(update_issue_form_path(@project, @issue))}', this)" %>
<% if @issue.transition_warning %>
<span class="icon-only icon-warning" title="<%= @issue.transition_warning %>"><%= @issue.transition_warning %></span>
<%= tag.span @issue.transition_warning, class: 'icon-only icon-warning', title: @issue.transition_warning %>
<% end %>
</p>
<%= hidden_field_tag 'was_default_status', @issue.status_id, :id => nil if @issue.status == @issue.default_status %>
app/views/issues/index.html.erb
<% end %>
<%= export_csv_encoding_select_tag %>
<% if @issue_count > Setting.issues_export_limit.to_i %>
<p class="icon icon-warning">
<%= tag.p(class: 'icon icon-warning') do %>
<%= l(:setting_issues_export_limit) %>: <%= Setting.issues_export_limit.to_i %>
</p>
<% end %>
<% end %>
<p class="buttons">
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);", :data => { :disable_with => false } %>
app/views/messages/show.html.erb
<% unless @replies.empty? %>
<div id="replies">
<h3 class="comments icon icon-comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
<%= tag.h3 "#{l(:label_reply_plural)}(#{@reply_count})", class: 'comments icon icon-comments' %>
<% if !@topic.locked? && authorize_for('messages', 'reply') && @replies.size >= 3 %>
<p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content', :scroll => "message_content" %></p>
<% end %>
app/views/projects/_members_box.html.erb
<% if @principals_by_role.any? %>
<div class="members box">
<h3 class="icon icon-group"><%=l(:label_member_plural)%></h3>
<%= tag.h3 l(:label_member_plural), class: 'icon icon-group' %>
<% @principals_by_role.keys.sort.each do |role| %>
<p><span class="label"><%= role %>:</span> <%= @principals_by_role[role].sort.collect{|p| link_to_principal(p, :class => p.is_a?(Group) ? 'icon icon-group' : nil)}.join(", ").html_safe %></p>
<% end %>
app/views/projects/index.html.erb
<% if User.current.logged? %>
<p style="text-align:right;">
<span class="icon icon-user my-project"><%= l(:label_my_projects) %></span>
<span class="icon icon-bookmarked-project"><%= l(:label_my_bookmarks) %></span>
<%= tag.span l(:label_my_projects), class: 'icon icon-user my-project' %>
<%= tag.span l(:label_my_bookmarks), class: 'icon icon-bookmarked-project' %>
</p>
<% end %>
app/views/projects/settings/_members.html.erb
<% members.each do |member| %>
<% next if member.new_record? %>
<tr id="member-<%= member.id %>" class="member">
<td class="name icon icon-<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td>
<%= tag.td link_to_user(member.principal), class: "name icon icon-#{member.principal.class.name.downcase}" %>
<td class="roles">
<span id="member-<%= member.id %>-roles"><%= member.roles.sort.collect(&:to_s).join(', ') %></span>
<div id="member-<%= member.id %>-form"></div>
app/views/projects/settings/_versions.html.erb
<tbody>
<% @versions.each do |version| %>
<tr class="version <%=h version.status %> <%= 'shared' if version.project != @project %>">
<td class="name <%= 'icon icon-shared' if version.project != @project %>"><%= link_to_version version %></td>
<%= tag.td link_to_version(version), :class => ['name', ('icon icon-shared' if version.project != @project)] %>
<td class="tick"><%= checked_image(version.id == @project.default_version_id) %></td>
<td class="date"><%= format_date(version.effective_date) %></td>
<td class="description"><%= version.description %></td>
app/views/projects/show.html.erb
<h2><%=l(:label_overview)%></h2>
<% unless @project.active? %>
<p class="warning"><span class="icon icon-lock"><%= l(:text_project_closed) %></span></p>
<p class="warning"><%= tag.span l(:text_project_closed), class: 'icon icon-lock' %></p>
<% end %>
<div class="splitcontent">
......
<% if User.current.allowed_to?(:view_issues, @project) %>
<div class="issues box">
<h3 class="icon icon-issue">
<%= tag.h3(class: 'icon icon-issue') do %>
<%=l(:label_issue_tracking)%>&nbsp;
<%= link_to l(:label_details),
project_issues_report_details_path(@project, :detail => 'tracker'),
:class => 'icon-only icon-zoom-in',
:title => l(:label_details) %>
</h3>
<% end %>
<% if @trackers.present? %>
<table class="list issue-report">
<thead>
......
<% if User.current.allowed_to?(:view_time_entries, @project) %>
<div class="spent_time box">
<h3 class="icon icon-time"><%= l(:label_time_tracking) %></h3>
<%= tag.h3 l(:label_time_tracking), class: 'icon icon-time' %>
<ul>
<% if @total_estimated_hours.present? %>
<li><%= l(:field_estimated_hours) %>: <%= l_hours(@total_estimated_hours) %>
......
<div class="splitcontentright">
<% if @news.any? && authorize_for('news', 'index') %>
<div class="news box">
<h3 class="icon icon-news"><%=l(:label_news_latest)%></h3>
<%= tag.h3 l(:label_news_latest), class: 'icon icon-news' %>
<%= render :partial => 'news/news', :collection => @news %>
<p><%= link_to l(:label_news_view_all), project_news_index_path(@project) %></p>
</div>
......
<% if @subprojects.any? %>
<div class="projects box">
<h3 class="icon icon-projects"><%=l(:label_subproject_plural)%></h3>
<%= tag.h3 l(:label_subproject_plural), class: 'icon icon-projects' %>
<ul class="subprojects">
<% @subprojects.each do |project| %>
<li><%= link_to(project.name, project_path(project), :class => project.css_classes).html_safe %></li>
app/views/roles/index.html.erb
<td class="name"><%= content_tag(role.builtin? ? 'em' : 'span', link_to(role.name, edit_role_path(role))) %></td>
<td>
<% unless role.builtin? || role.workflow_rules.exists? %>
<span class="icon icon-warning">
<%= tag.span(class: 'icon icon-warning') do %>
<%= l(:text_role_no_workflow) %> (<%= link_to l(:button_edit), edit_workflows_path(:role_id => role) %>)
</span>
<% end %>
<% end %>
</td>
<td class="buttons">
app/views/search/index.html.erb
<h3><%= l(:label_result_plural) %> (<%= @result_count %>)</h3>
<dl id="search-results">
<% @results.each do |e| %>
<dt class="<%= e.event_type %> icon icon-<%= e.event_type %>">
<%= tag.dt class: "#{e.event_type} icon icon-#{e.event_type}" do %>
<%= content_tag('span', e.project, :class => 'project') unless @project == e.project %>
<%= link_to(highlight_tokens(e.event_title.truncate(255), @tokens), e.event_url) %>
</dt>
<% end %>
<dd><span class="description"><%= highlight_tokens(e.event_description, @tokens) %></span>
<span class="author"><%= format_time(e.event_datetime) %></span></dd>
<% end %>
app/views/settings/_repositories.html.erb
</td>
<td>
<% if enabled %>
<span class="icon <%= (scm_class.scm_available ? 'icon-ok' : 'icon-error') %>"></span>
<%= tag.span class: ['icon', (scm_class.scm_available ? 'icon-ok' : 'icon-error')] %>
<%= scm_class.scm_command %>
<% end %>
</td>
app/views/trackers/index.html.erb
<td class="description"><%= tracker.description %></td>
<td>
<% unless tracker.workflow_rules.exists? %>
<span class="icon icon-warning">
<%= tag.span(class: 'icon icon-warning') do %>
<%= l(:text_tracker_no_workflow) %> (<%= link_to l(:button_edit), edit_workflows_path(:tracker_id => tracker) %>)
</span>
<% end %>
<% end %>
</td>
<td class="buttons">
app/views/versions/index.html.erb
</div>
<% end %>
<header>
<h3 class="icon icon-package version inline-flex"><%= link_to_version version, :name => version_anchor(version) %></h3>
<%= tag.h3(class: 'icon icon-package version inline-flex') do %>
<%= link_to_version version, :name => version_anchor(version) %>
<% end %>
<span class="badge badge-status-<%= version.status %>"><%= l("version_status_#{version.status}") %></span>
</header>
<%= render :partial => 'versions/overview', :locals => {:version => version} %>
extra/sample_plugin/app/views/example/say_goodbye.html.erb
<h2>Good Bye</h2>
<p class="icon icon-example-works"><%= l(:text_say_goodbye) %></p>
<%= tag.p l(:text_say_goodbye), :class => 'icon icon-example-works' %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'example', :plugin => 'sample_plugin', :media => "screen" %>
extra/sample_plugin/app/views/example/say_hello.html.erb
<h2>Hello</h2>
<p class="icon icon-example-works"><%= l(:text_say_hello) %></p>
<%= tag.p l(:text_say_hello), :class => 'icon icon-example-works' %>
<p><label>Example setting</label>: <%= @value %></p>
(25-25/54)