Revision 912:5e80956cc792 app/views/common

View differences:

app/views/common/_calendar.html.erb
1
<table class="cal">
2
<thead>
3
<tr><th scope="col" title="<%= l(:label_week) %>" class="week-number"></th><% 7.times do |i| %><th scope="col"><%= day_name( (calendar.first_wday+i)%7 ) %></th><% end %></tr>
4
</thead>
5
<tbody>
6
<tr>
7
<% day = calendar.startdt
8
while day <= calendar.enddt %>
9
<%= "<td class='week-number' title='#{ l(:label_week) }'>#{(day+(11-day.cwday)%7).cweek}</td>" if day.cwday == calendar.first_wday %>
10
<td class="<%= day.month==calendar.month ? 'even' : 'odd' %><%= ' today' if Date.today == day %>">
11
<p class="day-num"><%= day.day %></p>
12
<% calendar.events_on(day).each do |i| %>
13
  <% if i.is_a? Issue %>
14
  <div class="<%= i.css_classes %> <%= 'starting' if day == i.start_date %> <%= 'ending' if day == i.due_date %> tooltip">
15
  <%= h("#{i.project} -") unless @project && @project == i.project %>
16
  <%= link_to_issue i, :truncate => 30 %>
17
  <span class="tip"><%= render_issue_tooltip i %></span>
18
  </div>
19
  <% else %>
20
  <span class="icon icon-package">
21
    <%= h("#{i.project} -") unless @project && @project == i.project %>
22
    <%= link_to_version i%>
23
  </span>
24
  <% end %>
25
<% end %>
26
</td>
27
<%= '</tr><tr>' if day.cwday==calendar.last_wday and day!=calendar.enddt %>
28
<% day = day + 1
29
end %>
30
</tr>
31
</tbody>
32
</table>
app/views/common/_calendar.rhtml
1
<table class="cal">
2
<thead>
3
<tr><th scope="col" title="<%= l(:label_week) %>" class="week-number"></th><% 7.times do |i| %><th scope="col"><%= day_name( (calendar.first_wday+i)%7 ) %></th><% end %></tr>
4
</thead>
5
<tbody>
6
<tr>
7
<% day = calendar.startdt
8
while day <= calendar.enddt %>
9
<%= "<td class='week-number' title='#{ l(:label_week) }'>#{(day+(11-day.cwday)%7).cweek}</td>" if day.cwday == calendar.first_wday %>
10
<td class="<%= day.month==calendar.month ? 'even' : 'odd' %><%= ' today' if Date.today == day %>">
11
<p class="day-num"><%= day.day %></p>	
12
<% calendar.events_on(day).each do |i| %>
13
  <% if i.is_a? Issue %>
14
  <div class="<%= i.css_classes %> <%= 'starting' if day == i.start_date %> <%= 'ending' if day == i.due_date %> tooltip">
15
  <%= h("#{i.project} -") unless @project && @project == i.project %>
16
  <%= link_to_issue i, :truncate => 30 %>
17
  <span class="tip"><%= render_issue_tooltip i %></span>
18
  </div>
19
  <% else %>
20
  <span class="icon icon-package">  
21
    <%= h("#{i.project} -") unless @project && @project == i.project %>
22
    <%= link_to_version i%>
23
  </span>
24
  <% end %>
25
<% end %>
26
</td>
27
<%= '</tr><tr>' if day.cwday==calendar.last_wday and day!=calendar.enddt %>
28
<% day = day + 1
29
end %>
30
</tr>
31
</tbody>
32
</table>
app/views/common/_diff.html.erb
1
<% diff = Redmine::UnifiedDiff.new(
2
            diff, :type => diff_type,
3
            :max_lines => Setting.diff_max_lines_displayed.to_i) -%>
4

  
5
<% diff.each do |table_file| -%>
6
<div class="autoscroll">
7
<% if diff.diff_type == 'sbs' -%>
8
<table class="filecontent">
9
<thead>
10
<tr>
11
  <th colspan="4" class="filename">
12
    <%= h(Redmine::CodesetUtil.to_utf8_by_setting(table_file.file_name)) %>
13
  </th>
14
</tr>
15
</thead>
16
<tbody>
17
<% table_file.each_line do |spacing, line| -%>
18
<% if spacing -%>
19
<tr class="spacing">
20
  <th class="line-num">...</th><td></td><th class="line-num">...</th><td></td>
21
</tr>
22
<% end -%>
23
<tr>
24
  <th class="line-num"><%= line.nb_line_left %></th>
25
  <td class="line-code <%= line.type_diff_left %>">
26
    <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line_left) %></pre>
27
  </td>
28
  <th class="line-num"><%= line.nb_line_right %></th>
29
  <td class="line-code <%= line.type_diff_right %>">
30
    <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line_right) %></pre>
31
  </td>
32
</tr>
33
<% end -%>
34
</tbody>
35
</table>
36

  
37
<% else -%>
38
<table class="filecontent">
39
<thead>
40
  <tr>
41
    <th colspan="3" class="filename">
42
      <%= h(Redmine::CodesetUtil.to_utf8_by_setting(table_file.file_name)) %>
43
    </th>
44
  </tr>
45
</thead>
46
<tbody>
47
<% table_file.each_line do |spacing, line| %>
48
<% if spacing -%>
49
<tr class="spacing">
50
  <th class="line-num">...</th><th class="line-num">...</th><td></td>
51
</tr>
52
<% end -%>
53
<tr>
54
  <th class="line-num"><%= line.nb_line_left %></th>
55
  <th class="line-num"><%= line.nb_line_right %></th>
56
  <td class="line-code <%= line.type_diff %>">
57
    <pre><%= Redmine::CodesetUtil.to_utf8_by_setting(line.html_line) %></pre>
58
  </td>
59
</tr>
60
<% end -%>
61
</tbody>
62
</table>
63
<% end -%>
64
</div>
65
<% end -%>
66

  
67
<%= l(:text_diff_truncated) if diff.truncated? %>
app/views/common/_diff.rhtml
1
<% diff = Redmine::UnifiedDiff.new(diff, :type => diff_type, :max_lines => Setting.diff_max_lines_displayed.to_i) -%>
2

  
3
<% diff.each do |table_file| -%>
4
<div class="autoscroll">
5
<% if diff.diff_type == 'sbs' -%>
6
<table class="filecontent">
7
<thead>
8
<tr><th colspan="4" class="filename"><%=to_utf8 table_file.file_name %></th></tr>
9
</thead>
10
<tbody>
11
<% table_file.each_line do |spacing, line| -%>
12
<% if spacing -%>
13
<tr class="spacing">
14
  <th class="line-num">...</th><td></td><th class="line-num">...</th><td></td>
15
</tr>
16
<% end -%>
17
<tr>
18
  <th class="line-num"><%= line.nb_line_left %></th>
19
  <td class="line-code <%= line.type_diff_left %>">
20
    <pre><%=to_utf8 line.html_line_left %></pre>
21
  </td>
22
  <th class="line-num"><%= line.nb_line_right %></th>
23
  <td class="line-code <%= line.type_diff_right %>">
24
    <pre><%=to_utf8 line.html_line_right %></pre>
25
  </td>
26
</tr>
27
<% end -%>
28
</tbody>
29
</table>
30

  
31
<% else -%>
32
<table class="filecontent">
33
<thead>
34
<tr><th colspan="3" class="filename"><%=to_utf8 table_file.file_name %></th></tr>
35
</thead>
36
<tbody>
37
<% table_file.each_line do |spacing, line| %>
38
<% if spacing -%>
39
<tr class="spacing">
40
  <th class="line-num">...</th><th class="line-num">...</th><td></td>
41
</tr>
42
<% end -%>
43
<tr>
44
  <th class="line-num"><%= line.nb_line_left %></th>
45
  <th class="line-num"><%= line.nb_line_right %></th>
46
  <td class="line-code <%= line.type_diff %>">
47
    <pre><%=to_utf8 line.html_line %></pre>
48
  </td>
49
</tr>
50
<% end -%>
51
</tbody>
52
</table>
53
<% end -%>
54
</div>
55
<% end -%>
56

  
57
<%= l(:text_diff_truncated) if diff.truncated? %>
app/views/common/_file.html.erb
1
<div class="autoscroll">
2
<table class="filecontent syntaxhl">
3
<tbody>
4
<% line_num = 1 %>
5
<% syntax_highlight(filename, Redmine::CodesetUtil.to_utf8_by_setting(content)).each_line do |line| %>
6
  <tr>
7
    <th class="line-num" id="L<%= line_num %>">
8
      <a href="#L<%= line_num %>"><%= line_num %></a>
9
    </th>
10
    <td class="line-code">
11
      <pre><%= line %></pre>
12
    </td>
13
  </tr>
14
  <% line_num += 1 %>
15
<% end %>
16
</tbody>
17
</table>
18
</div>
app/views/common/_file.rhtml
1
<div class="autoscroll">
2
<table class="filecontent syntaxhl">
3
<tbody>
4
<% line_num = 1 %>
5
<% syntax_highlight(filename, to_utf8(content)).each_line do |line| %>
6
<tr><th class="line-num" id="L<%= line_num %>"><a href="#L<%= line_num %>"><%= line_num %></a></th><td class="line-code"><pre><%= line %></pre></td></tr>
7
<% line_num += 1 %>
8
<% end %>
9
</tbody>
10
</table>
11
</div>
app/views/common/_preview.html.erb
1
<fieldset class="preview"><legend><%= l(:label_preview) %></legend>
2
<%= textilizable @text, :attachments => @attachements, :object => @previewed %>
3
</fieldset>
app/views/common/_preview.rhtml
1
<fieldset class="preview"><legend><%= l(:label_preview) %></legend>
2
<%= textilizable @text, :attachments => @attachements, :object => @previewed %>
3
</fieldset>
app/views/common/_tabs.html.erb
1
<% selected_tab = params[:tab] ? params[:tab].to_s : tabs.first[:name] %>
2

  
3
<div class="tabs">
4
  <ul>
5
  <% tabs.each do |tab| -%>
6
    <li><%= link_to l(tab[:label]), { :tab => tab[:name] },
7
                                    :id => "tab-#{tab[:name]}",
8
                                    :class => (tab[:name] != selected_tab ? nil : 'selected'),
9
                                    :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li>
10
  <% end -%>
11
  </ul>
12
  <div class="tabs-buttons" style="display:none;">
13
    <button class="tab-left" onclick="moveTabLeft(this);"></button>
14
    <button class="tab-right" onclick="moveTabRight(this);"></button>
15
  </div>
16
</div>
17

  
18
<script>
19
  Event.observe(window, 'load', function() { displayTabsButtons(); });
20
  Event.observe(window, 'resize', function() { displayTabsButtons(); });
21
</script>
22

  
23
<% tabs.each do |tab| -%>
24
  <%= content_tag('div', render(:partial => tab[:partial], :locals => {:tab => tab} ),
25
                       :id => "tab-content-#{tab[:name]}",
26
                       :style => (tab[:name] != selected_tab ? 'display:none' : nil),
27
                       :class => 'tab-content') %>
28
<% end -%>
app/views/common/_tabs.rhtml
1
<% selected_tab = params[:tab] ? params[:tab].to_s : tabs.first[:name] %>
2

  
3
<div class="tabs">
4
  <ul>
5
  <% tabs.each do |tab| -%>
6
    <li><%= link_to l(tab[:label]), { :tab => tab[:name] },
7
                                    :id => "tab-#{tab[:name]}",
8
                                    :class => (tab[:name] != selected_tab ? nil : 'selected'),
9
                                    :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li>
10
  <% end -%>
11
  </ul>
12
  <div class="tabs-buttons" style="display:none;">
13
  	<button class="tab-left" onclick="moveTabLeft(this);"></button>
14
  	<button class="tab-right" onclick="moveTabRight(this);"></button>
15
  </div>
16
</div>
17

  
18
<script>
19
	Event.observe(window, 'load', function() { displayTabsButtons(); });
20
	Event.observe(window, 'resize', function() { displayTabsButtons(); }); 
21
</script>
22

  
23
<% tabs.each do |tab| -%>
24
  <%= content_tag('div', render(:partial => tab[:partial], :locals => {:tab => tab} ), 
25
                       :id => "tab-content-#{tab[:name]}",
26
                       :style => (tab[:name] != selected_tab ? 'display:none' : nil),
27
                       :class => 'tab-content') %>
28
<% end -%>
app/views/common/error.html.erb
1 1
<h2><%=h @status %></h2>
2 2

  
3
<p id="errorExplanation"><%=h @message %></p>
3
<% if @message.present? %>
4
  <p id="errorExplanation"><%=h @message %></p>
5
<% end %>
4 6
<p><a href="javascript:history.back()">Back</a></p>
5 7

  
6 8
<% html_title @status %>
app/views/common/feed.atom.builder
1
xml.instruct!
2
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
3
  xml.title   truncate_single_line(@title, :length => 100)
4
  xml.link    "rel" => "self", "href" => url_for(params.merge(:only_path => false))
5
  xml.link    "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil))
6
  xml.id      url_for(:controller => 'welcome', :only_path => false)
7
  xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
8
  xml.author  { xml.name "#{Setting.app_title}" }
9
  xml.generator(:uri => Redmine::Info.url) { xml.text! Redmine::Info.app_name; }
10
  @items.each do |item|
11
    xml.entry do
12
      url = url_for(item.event_url(:only_path => false))
13
      if @project
14
        xml.title truncate_single_line(item.event_title, :length => 100)
15
      else
16
        xml.title truncate_single_line("#{item.project} - #{item.event_title}", :length => 100)
17
      end
18
      xml.link "rel" => "alternate", "href" => url
19
      xml.id url
20
      xml.updated item.event_datetime.xmlschema
21
      author = item.event_author if item.respond_to?(:event_author)
22
      xml.author do
23
        xml.name(author)
24
        xml.email(author.mail) if author.is_a?(User) && !author.mail.blank? && !author.pref.hide_mail
25
      end if author
26
      xml.content "type" => "html" do
27
        xml.text! textilizable(item, :event_description, :only_path => false)
28
      end
29
    end
30
  end
31
end
app/views/common/feed.atom.rxml
1
xml.instruct!
2
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
3
  xml.title   truncate_single_line(@title, :length => 100)
4
  xml.link    "rel" => "self", "href" => url_for(params.merge(:only_path => false))
5
  xml.link    "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil))
6
  xml.id      url_for(:controller => 'welcome', :only_path => false)
7
  xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
8
  xml.author  { xml.name "#{Setting.app_title}" }
9
  xml.generator(:uri => Redmine::Info.url) { xml.text! Redmine::Info.app_name; }
10
  @items.each do |item|
11
    xml.entry do
12
      url = url_for(item.event_url(:only_path => false))
13
      if @project
14
        xml.title truncate_single_line(item.event_title, :length => 100)
15
      else
16
        xml.title truncate_single_line("#{item.project} - #{item.event_title}", :length => 100)
17
      end
18
      xml.link "rel" => "alternate", "href" => url
19
      xml.id url
20
      xml.updated item.event_datetime.xmlschema
21
      author = item.event_author if item.respond_to?(:event_author)
22
      xml.author do
23
        xml.name(author)
24
        xml.email(author.mail) if author.is_a?(User) && !author.mail.blank? && !author.pref.hide_mail
25
      end if author
26
      xml.content "type" => "html" do
27
        xml.text! textilizable(item, :event_description, :only_path => false)
28
      end
29
    end
30
  end
31
end

Also available in: Unified diff