Project

General

Profile

RE: Command line ticket creation/modification? ยป patch.diff

patch - Kazuyoshi Tlacaelel, 2009-03-31 15:56

View differences:

app/helpers/application_helper.rb (working copy)
442 442
            end
443 443
          when 'commit'
444 444
            if project && (changeset = project.changesets.find(:first, :conditions => ["scmid LIKE ?", "#{name}%"]))
445
              link = link_to h("#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.revision},
446
                                           :class => 'changeset',
447
                                           :title => truncate_single_line(changeset.comments, 100)
445

  
446
              # Changes by Kazuyoshi Tlacaelel.
447
              # Last edited on: Sun Mar 15 15:33:23 JST 2009
448
              # Point users straight to the diff, rather than sending
449
              # them to the revision and make them click again to see
450
              # a diff and then again to see a diff side by side
451
              #
452
              my_hash = {:only_path => only_path, :controller => 'repositories',
453
                :action => 'diff', :id => project, :type => 'sbs', :rev => changeset.revision}
454

  
455
              link = link_to h("#{name}"), my_hash, :class => 'changeset', 
456
                :title => truncate_single_line(changeset.comments, 100)
457
              #
458
              #
459
              #
448 460
            end
449 461
          when 'source', 'export'
450 462
            if project && project.repository
app/controllers/issues_controller.rb (working copy)
102 102
    @edit_allowed = User.current.allowed_to?(:edit_issues, @project)
103 103
    @priorities = Enumeration::get_values('IPRI')
104 104
    @time_entry = TimeEntry.new
105
    my_query = "select * from changesets where comments like '%##{@issue.id} %' order by committed_on desc"
106
    @related_changesets = Changeset.find_by_sql(my_query)
105 107
    respond_to do |format|
106 108
      format.html { render :template => 'issues/show.rhtml' }
107 109
      format.atom { render :action => 'changes', :layout => false, :content_type => 'application/atom+xml' }
app/views/repositories/_revisions.rhtml (working copy)
1

  
2
<style>
3
  thead[latest_header] th {
4
    background:#507AAA;
5
    color:white;
6
  }
7
  table[latest] {
8
    border:solid 1px #111;
9
  }
10
  table caption {
11
    background:#2C4056;
12
    color:white;
13
    padding:2mm;
14
    font-size:5mm;
15
  }
16
</style>
17

  
1 18
<% form_tag({:controller => 'repositories', :action => 'diff', :id => @project, :path => to_path_param(path)}, :method => :get) do %>
2
<table class="list changesets">
3
<thead><tr>
4
<th>#</th>
5
<th></th>
6
<th></th>
7
<th><%= l(:label_date) %></th>
8
<th><%= l(:field_author) %></th>
9
<th><%= l(:field_comments) %></th>
10
</tr></thead>
19
  <br />
20
  <br />
21

  
22
<table class="list changesets" latest_table>
23
<caption><%= l(:label_latest_revision_plural) %></caption>
24

  
25
<thead latest_header>
26
  <tr>
27
    <th style='text-align:right;'>Info</th>
28
    <th>DIFF</th>
29
    <th><%= l(:field_comments) %></th>
30
  </tr>
31
</thead>
32

  
11 33
<tbody>
12 34
<% show_diff = entry && entry.is_file? && revisions.size > 1 %>
13 35
<% line_num = 1 %>
14 36
<% revisions.each do |changeset| %>
15 37
<tr class="changeset <%= cycle 'odd', 'even' %>">
16
<td class="id"><%= link_to format_revision(changeset.revision), :action => 'revision', :id => project, :rev => changeset.revision %></td>
17
<td class="checkbox"><%= radio_button_tag('rev', changeset.revision, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < revisions.size) %></td>
18
<td class="checkbox"><%= radio_button_tag('rev_to', changeset.revision, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('cb-#{line_num}').checked==true) {$('cb-#{line_num-1}').checked=true;}") if show_diff && (line_num > 1) %></td>
19
<td class="committed_on"><%= format_time(changeset.committed_on) %></td>
20
<td class="author"><%=h changeset.author %></td>
21
<td class="comments"><%= textilizable(truncate_at_line_break(changeset.comments)) %></td>
38

  
39
<td class="committed_on" style='text-align:right;'>
40
  <small>
41
    <%= format_time(changeset.committed_on) %> <br />
42
    <span class="author"><%=h changeset.author %></span> <br />
43
    <%= format_revision(changeset.revision) %> <br />
44
    <%= radio_button_tag('rev', changeset.revision, (line_num==1), :id => "cb-#{line_num}",:onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < revisions.size) %>
45
    <%= radio_button_tag('rev_to', changeset.revision, (line_num==2), :id => "cbto-#{line_num}", :onclick => "if ($('cb-#{line_num}').checked==true) {$('cb-#{line_num-1}').checked=true;}") if show_diff && (line_num > 1) %>
46
  </small>
47
</td>
48

  
49
<td class="id">
50
  <%
51
    my_hash = {:controller => 'repositories', :action => 'diff',
52
    :id => project, :type => 'sbs', :rev => changeset.revision}
53
  %>
54
  <small><%= link_to 'DIFF', my_hash, :title => "Show DIFF: #{format_revision(changeset.revision)}" %></small>
55
</td>
56

  
57
<td class="comments" width='90%' style='color:#111;'>
58
  <%= textilizable(truncate_at_line_break(changeset.comments)) %>
59
</td>
22 60
</tr>
23 61
<% line_num += 1 %>
24 62
<% end %>
app/views/repositories/show.rhtml (working copy)
9 9
<% end -%>
10 10
</div>
11 11

  
12
<h2><%= l(:label_repository) %> (<%= @repository.scm_name %>)</h2>
13 12

  
14
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
15
<%= render :partial => 'dir_list' %>
16
<% end %>
17 13

  
18 14
<% if !@changesets.empty? && authorize_for('repositories', 'revisions') %>
19
<h3><%= l(:label_latest_revision_plural) %></h3>
20 15
<%= render :partial => 'revisions', :locals => {:project => @project, :path => '', :revisions => @changesets, :entry => nil }%>
21
<p><%= link_to l(:label_view_revisions), :action => 'revisions', :id => @project %></p>
16
<p><%= link_to l(:label_latest_revision_plural), :action => 'revisions', :id => @project %></p>
22 17
<% content_for :header_tags do %>
23 18
  <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :action => 'revisions', :id => @project, :page => nil, :key => User.current.rss_key})) %>
24 19
<% end %>
......
28 23
</p>
29 24
<% end %>
30 25

  
26

  
27

  
28

  
29

  
30

  
31
<h2><%= l(:label_repository) %> (<%= @repository.scm_name %>)</h2>
32

  
33
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
34
<%= render :partial => 'dir_list' %>
35
<% end %>
36

  
37

  
31 38
<% content_for :header_tags do %>
32 39
<%= stylesheet_link_tag "scm" %>
33 40
<% end %>
app/views/issues/show.rhtml (working copy)
93 93
</div>
94 94
<% end %>
95 95

  
96
<%= render :partial => 'related_changesets', :locals => {:related_changesets => @related_changesets} %>
97

  
96 98
<% if @journals.any? %>
97 99
<div id="history">
98 100
<h3><%=l(:label_history)%></h3>
......
124 126
    <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject}") %>
125 127
    <%= stylesheet_link_tag 'scm' %>
126 128
<% end %>
129

  
130

  
131

  
public/stylesheets/application.css (working copy)
133 133
table.list tbody tr:hover { background-color:#ffffdd; }
134 134
table td {padding:2px;}
135 135
table p {margin:0;}
136
.odd {background-color:#f6f7f8;}
137
.even {background-color: #fff;}
138 136

  
137
.odd, .even {
138
  padding: 5px 4px;
139
  color: #333;
140
  font-family: Verdana, sans-serif;
141
  background-color: #E6F2FF;
142
  border-bottom: solid 1px #C5DBF7;
143
  border-left: solid 1px #C5DBF7;
144
}
145

  
146
.odd td, .even td {
147
  border-right: solid 1px #ccc;
148
}
149
.even {
150
  background-color: #fff;
151
  border-left: solid 1px #ddd;
152
}
153

  
139 154
.highlight { background-color: #FCFD8D;}
140 155
.highlight.token-1 { background-color: #faa;}
141 156
.highlight.token-2 { background-color: #afa;}
    (1-1/1)