Project

General

Profile

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

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

View differences:

app/views/issues/tabs/_changesets.html.erb
1
<% @changesets.each do |changeset| %>
2
  <div id="changeset-<%= changeset.id %>" class="changeset journal">
3
    <div>
4
      <h4>
5
        <%= avatar(changeset.user, :size => "24") %>
6
        <%= authoring changeset.committed_on, changeset.author, :label => :label_added_time_by %>
7
      </h4>
8
      <p><%= link_to_revision(changeset, changeset.repository,
9
                          :text => "#{l(:label_revision)} #{changeset.format_identifier}") %>
10
      <% if changeset.filechanges.any? && User.current.allowed_to?(:browse_repository, changeset.project) %>
11
      (<%= link_to(l(:label_diff),
12
             :controller => 'repositories',
13
             :action => 'diff',
14
             :id     => changeset.project,
15
             :repository_id => changeset.repository.identifier_param,
16
             :path   => "",
17
             :rev    => changeset.identifier) %>)
18
      <% end %></p>
1
<div class="entries">
2
  <% @changesets.each do |changeset| %>
3
    <div id="changeset-<%= changeset.id %>" class="changeset journal">
4
      <div>
5
        <h4>
6
          <%= avatar(changeset.user, :size => "24") %>
7
          <%= authoring changeset.committed_on, changeset.author, :label => :label_added_time_by %>
8
        </h4>
9
        <p><%= link_to_revision(changeset, changeset.repository,
10
                            :text => "#{l(:label_revision)} #{changeset.format_identifier}") %>
11
        <% if changeset.filechanges.any? && User.current.allowed_to?(:browse_repository, changeset.project) %>
12
        (<%= link_to(l(:label_diff),
13
               :controller => 'repositories',
14
               :action => 'diff',
15
               :id     => changeset.project,
16
               :repository_id => changeset.repository.identifier_param,
17
               :path   => "",
18
               :rev    => changeset.identifier) %>)
19
        <% end %></p>
19 20

  
20
      <div class="wiki changeset-comments">
21
        <%= format_changeset_comments changeset %>
21
        <div class="wiki changeset-comments">
22
          <%= format_changeset_comments changeset %>
23
        </div>
22 24
      </div>
23 25
    </div>
24
  </div>
25
  <%= call_hook(:view_issues_history_changeset_bottom, { :changeset => changeset }) %>
26
<% end %>
26
    <%= call_hook(:view_issues_history_changeset_bottom, { :changeset => changeset }) %>
27
  <% end %>
28
</div>
app/views/issues/tabs/_history.html.erb
4 4
%>
5 5

  
6 6
<% reply_links = issue.notes_addable? -%>
7
<% for journal in journals %>
8
  <div id="change-<%= journal.id %>" class="<%= journal.css_classes %>">
9
    <div id="note-<%= journal.indice %>">
10
    <div class="contextual">
11
      <span class="journal-actions"><%= render_journal_actions(issue, journal, :reply_links => reply_links) %></span>
12
      <a href="#note-<%= journal.indice %>" class="journal-link">#<%= journal.indice %></a>
13
    </div>
14
    <h4>
15
      <%= avatar(journal.user) %>
16
      <%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %>
17
      <%= render_private_notes_indicator(journal) %>
18
    </h4>
7
<div class="entries">
8
  <% for journal in journals %>
9
    <div id="change-<%= journal.id %>" class="<%= journal.css_classes %>">
10
      <div id="note-<%= journal.indice %>">
11
      <div class="contextual">
12
        <span class="journal-actions"><%= render_journal_actions(issue, journal, :reply_links => reply_links) %></span>
13
        <a href="#note-<%= journal.indice %>" class="journal-link">#<%= journal.indice %></a>
14
      </div>
15
      <h4>
16
        <%= avatar(journal.user) %>
17
        <%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %>
18
        <%= render_private_notes_indicator(journal) %>
19
      </h4>
19 20

  
20
    <% if journal.details.any? %>
21
    <ul class="details">
22
      <% details_to_strings(journal.visible_details).each do |string| %>
23
       <li><%= string %></li>
24
      <% end %>
25
    </ul>
26
    <% if Setting.thumbnails_enabled? && (thumbnail_attachments = journal_thumbnail_attachments(journal)).any? %>
27
      <div class="thumbnails">
28
        <% thumbnail_attachments.each do |attachment| %>
29
          <div><%= thumbnail_tag(attachment) %></div>
21
      <% if journal.details.any? %>
22
      <ul class="details">
23
        <% details_to_strings(journal.visible_details).each do |string| %>
24
         <li><%= string %></li>
30 25
        <% end %>
26
      </ul>
27
      <% if Setting.thumbnails_enabled? && (thumbnail_attachments = journal_thumbnail_attachments(journal)).any? %>
28
        <div class="thumbnails">
29
          <% thumbnail_attachments.each do |attachment| %>
30
            <div><%= thumbnail_tag(attachment) %></div>
31
          <% end %>
32
        </div>
33
      <% end %>
34
      <% end %>
35
      <%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
31 36
      </div>
32
    <% end %>
33
    <% end %>
34
    <%= render_notes(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>
35 37
    </div>
36
  </div>
37
  <%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
38
<% end %>
38
    <%= call_hook(:view_issues_history_journal_bottom, { :journal => journal }) %>
39
  <% end %>
40
</div>
39 41

  
40 42
<% 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
1
<% for time_entry in time_entries%>
2
  <div id="time-entry-<%= time_entry.id %>" class="time_entry journal">
3
    <div>
4
      <% if time_entry.editable_by?(User.current) -%>
5
        <div class="contextual">
6
          <%= link_to l(:button_edit), edit_time_entry_path(time_entry),
7
                      :title => l(:button_edit),
8
                      :class => 'icon-only icon-edit' %>
9
          <%= link_to l(:button_delete), time_entry_path(time_entry),
10
                      :data => {:confirm => l(:text_are_you_sure)},
11
                      :method => :delete,
12
                      :title => l(:button_delete),
13
                      :class => 'icon-only icon-del' %>
14
        </div>
15
      <% end -%>
16
      <h4>
17
        <%= avatar(time_entry.user, :size => "24") %>
18
        <%= authoring time_entry.created_on, time_entry.user, :label => :label_added_time_by %>
19
      </h4>
20
      <ul class="details">
21
        <li>
22
          <strong><%= l(:label_time_entry_plural) %></strong>:
23
          <%= l_hours_short time_entry.hours %>
24
        </li>
25
      </ul>
26
      <p><%= time_entry.comments %></p>
1
<div class="entries">
2
  <% for time_entry in time_entries%>
3
    <div id="time-entry-<%= time_entry.id %>" class="time_entry journal">
4
      <div>
5
        <% if time_entry.editable_by?(User.current) -%>
6
          <div class="contextual">
7
            <%= link_to l(:button_edit), edit_time_entry_path(time_entry),
8
                        :title => l(:button_edit),
9
                        :class => 'icon-only icon-edit' %>
10
            <%= link_to l(:button_delete), time_entry_path(time_entry),
11
                        :data => {:confirm => l(:text_are_you_sure)},
12
                        :method => :delete,
13
                        :title => l(:button_delete),
14
                        :class => 'icon-only icon-del' %>
15
          </div>
16
        <% end -%>
17
        <h4>
18
          <%= avatar(time_entry.user, :size => "24") %>
19
          <%= authoring time_entry.created_on, time_entry.user, :label => :label_added_time_by %>
20
        </h4>
21
        <ul class="details">
22
          <li>
23
            <strong><%= l(:label_time_entry_plural) %></strong>:
24
            <%= l_hours_short time_entry.hours %>
25
          </li>
26
        </ul>
27
        <p><%= time_entry.comments %></p>
28
      </div>
27 29
    </div>
28
  </div>
29
  <%= call_hook(:view_issues_history_time_entry_bottom, { :time_entry => time_entry }) %>
30
<% end %>
30
    <%= call_hook(:view_issues_history_time_entry_bottom, { :time_entry => time_entry }) %>
31
  <% end %>
32
</div>
public/stylesheets/application.css
540 540
div#issue-changesets p { margin-top: 0; margin-bottom: 1em;}
541 541
.changeset-comments {margin-bottom:1em;}
542 542

  
543
#history div.entries {position: relative;}
544
#history div.entries:before {
545
  content: '';
546
  border-left: 2px solid #d7d7d7;
547
  position: absolute;
548
  top: 0;
549
  bottom: 0;
550
  left: 17px;
551
}
552

  
553
div.journal {padding: 15px 6px; border: 1px solid #d7d7d7; border-radius: 3px; margin: 10px 0; position:relative; background-color: #fff;}
554

  
543 555
div.journal {padding: 15px 6px; border: 1px solid #d7d7d7; border-radius: 3px; margin: 10px 0;}
544 556
div.journal .contextual {margin-top: 0;}
545 557
div.journal div.wiki > :last-child {margin-bottom: 0;}
(5-5/8)