Project

General

Profile

Feature #31573 » 0002-Connect-journal-boxes.patch

Marius BĂLTEANU, 2019-06-21 00:03

View differences:

app/views/issues/tabs/_changesets.html.erb
<% @changesets.each do |changeset| %>
<div id="changeset-<%= changeset.id %>" class="changeset journal">
<div>
<h4>
<%= avatar(changeset.user, :size => "24") %>
<%= authoring changeset.committed_on, changeset.author, :label => :label_added_time_by %>
</h4>
<p><%= 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) %>
(<%= link_to(l(:label_diff),
:controller => 'repositories',
:action => 'diff',
:id => changeset.project,
:repository_id => changeset.repository.identifier_param,
:path => "",
:rev => changeset.identifier) %>)
<% end %></p>
<div class="entries">
<% @changesets.each do |changeset| %>
<div id="changeset-<%= changeset.id %>" class="changeset journal">
<div>
<h4>
<%= avatar(changeset.user, :size => "24") %>
<%= authoring changeset.committed_on, changeset.author, :label => :label_added_time_by %>
</h4>
<p><%= 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) %>
(<%= link_to(l(:label_diff),
:controller => 'repositories',
:action => 'diff',
:id => changeset.project,
:repository_id => changeset.repository.identifier_param,
:path => "",
:rev => changeset.identifier) %>)
<% end %></p>
<div class="wiki changeset-comments">
<%= format_changeset_comments changeset %>
<div class="wiki changeset-comments">
<%= format_changeset_comments changeset %>
</div>
</div>
</div>
</div>
<%= call_hook(:view_issues_history_changeset_bottom, { :changeset => changeset }) %>
<% end %>
<%= call_hook(:view_issues_history_changeset_bottom, { :changeset => changeset }) %>
<% end %>
</div>
app/views/issues/tabs/_history.html.erb
%>
<% reply_links = issue.notes_addable? -%>
<% for journal in journals %>
<div id="change-<%= journal.id %>" class="<%= journal.css_classes %>">
<div id="note-<%= journal.indice %>">
<div class="contextual">
<span class="journal-actions"><%= render_journal_actions(issue, journal, :reply_links => reply_links) %></span>
<a href="#note-<%= journal.indice %>" class="journal-link">#<%= journal.indice %></a>
</div>
<h4>
<%= avatar(journal.user) %>
<%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %>
<%= render_private_notes_indicator(journal) %>
</h4>
<div class="entries">
<% for journal in journals %>
<div id="change-<%= journal.id %>" class="<%= journal.css_classes %>">
<div id="note-<%= journal.indice %>">
<div class="contextual">
<span class="journal-actions"><%= render_journal_actions(issue, journal, :reply_links => reply_links) %></span>
<a href="#note-<%= journal.indice %>" class="journal-link">#<%= journal.indice %></a>
</div>
<h4>
<%= avatar(journal.user) %>
<%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %>
<%= render_private_notes_indicator(journal) %>
</h4>
<% if journal.details.any? %>
<ul class="details">
<% details_to_strings(journal.visible_details).each do |string| %>
<li><%= string %></li>
<% end %>
</ul>
<% if Setting.thumbnails_enabled? && (thumbnail_attachments = journal_thumbnail_attachments(journal)).any? %>
<div class="thumbnails">
<% thumbnail_attachments.each do |attachment| %>
<div><%= thumbnail_tag(attachment) %></div>
<% if journal.details.any? %>
<ul class="details">
<% details_to_strings(journal.visible_details).each do |string| %>
<li><%= string %></li>
<% end %>
</ul>
<% if Setting.thumbnails_enabled? && (thumbnail_attachments = journal_thumbnail_attachments(journal)).any? %>
<div class="thumbnails">
<% thumbnail_attachments.each do |attachment| %>
<div><%= thumbnail_tag(attachment) %></div>
<% end %>
</div>
<% end %>
<% end %>
<%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
</div>
<% end %>
<% end %>
<%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
</div>
</div>
<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
<% end %>
<%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
<% end %>
</div>
<% heads_for_wiki_formatter if User.current.allowed_to?(:edit_issue_notes, issue.project) || User.current.allowed_to?(:edit_own_issue_notes, issue.project) %>
app/views/issues/tabs/_time_entries.html.erb
<% for time_entry in time_entries%>
<div id="time-entry-<%= time_entry.id %>" class="time_entry journal">
<div>
<% if time_entry.editable_by?(User.current) -%>
<div class="contextual">
<%= link_to l(:button_edit), edit_time_entry_path(time_entry),
:title => l(:button_edit),
:class => 'icon-only icon-edit' %>
<%= link_to l(:button_delete), time_entry_path(time_entry),
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:title => l(:button_delete),
:class => 'icon-only icon-del' %>
</div>
<% end -%>
<h4>
<%= avatar(time_entry.user, :size => "24") %>
<%= authoring time_entry.created_on, time_entry.user, :label => :label_added_time_by %>
</h4>
<ul class="details">
<li>
<strong><%= l(:label_time_entry_plural) %></strong>:
<%= l_hours_short time_entry.hours %>
</li>
</ul>
<p><%= time_entry.comments %></p>
<div class="entries">
<% for time_entry in time_entries%>
<div id="time-entry-<%= time_entry.id %>" class="time_entry journal">
<div>
<% if time_entry.editable_by?(User.current) -%>
<div class="contextual">
<%= link_to l(:button_edit), edit_time_entry_path(time_entry),
:title => l(:button_edit),
:class => 'icon-only icon-edit' %>
<%= link_to l(:button_delete), time_entry_path(time_entry),
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:title => l(:button_delete),
:class => 'icon-only icon-del' %>
</div>
<% end -%>
<h4>
<%= avatar(time_entry.user, :size => "24") %>
<%= authoring time_entry.created_on, time_entry.user, :label => :label_added_time_by %>
</h4>
<ul class="details">
<li>
<strong><%= l(:label_time_entry_plural) %></strong>:
<%= l_hours_short time_entry.hours %>
</li>
</ul>
<p><%= time_entry.comments %></p>
</div>
</div>
</div>
<%= call_hook(:view_issues_history_time_entry_bottom, { :time_entry => time_entry }) %>
<% end %>
<%= call_hook(:view_issues_history_time_entry_bottom, { :time_entry => time_entry }) %>
<% end %>
</div>
public/stylesheets/application.css
div#issue-changesets p { margin-top: 0; margin-bottom: 1em;}
.changeset-comments {margin-bottom:1em;}
#history div.entries {position: relative;}
#history div.entries:before {
content: '';
border-left: 2px solid #d7d7d7;
position: absolute;
top: 0;
bottom: 0;
left: 17px;
}
div.journal {padding: 15px 6px; border: 1px solid #d7d7d7; border-radius: 3px; margin: 10px 0; position:relative; background-color: #fff;}
div.journal {padding: 15px 6px; border: 1px solid #d7d7d7; border-radius: 3px; margin: 10px 0;}
div.journal .contextual {margin-top: 0;}
div.journal div.wiki > :last-child {margin-bottom: 0;}
(5-5/8)