Project

General

Profile

« Previous | Next » 

Revision 1032

Slight improvements to the browser views.
ApplicationHelper#set_html_title replaced by html_title with arguments and can be called several times in views to append elements to the title.

View differences:

trunk/app/helpers/application_helper.rb
145 145
    links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil
146 146
  end
147 147
  
148
  def set_html_title(text)
149
    @html_header_title = text
148
  def html_title(*args)
149
    if args.empty?
150
      title = []
151
      title << @project.name if @project
152
      title += @html_title if @html_title
153
      title << Setting.app_title
154
      title.compact.join(' - ')
155
    else
156
      @html_title ||= []
157
      @html_title += args
158
    end
150 159
  end
151 160
  
152
  def html_title
153
    title = []
154
    title << @project.name if @project
155
    title << @html_header_title
156
    title << Setting.app_title
157
    title.compact.join(' - ')
158
  end
159
  
160 161
  ACCESSKEYS = {:edit => 'e',
161 162
                :preview => 'r',
162 163
                :quick_search => 'f',
trunk/app/helpers/repositories_helper.rb
55 55
  
56 56
  def with_leading_slash(path)
57 57
    path ||= ''
58
    path.starts_with?("/") ? "/#{path}" : path
58
    path.starts_with?('/') ? path : "/#{path}"
59 59
  end
60 60

  
61 61
  def subversion_field_tags(form, repository)
trunk/app/views/admin/index.rhtml
44 44
<%= link_to l(:label_information_plural), :controller => 'admin', :action => 'info' %>
45 45
</p>
46 46

  
47
<% set_html_title l(:label_administration) -%>
47
<% html_title(l(:label_administration)) -%>
trunk/app/views/admin/info.rhtml
24 24
</table>
25 25
<% end %>
26 26

  
27
<% set_html_title(l(:label_information_plural)) -%>
27
<% html_title(l(:label_information_plural)) -%>
trunk/app/views/admin/mail_options.rhtml
30 30
<%= submit_tag l(:button_save) %>
31 31
<% end %>
32 32

  
33
<% set_html_title(l(:field_mail_notification)) -%>
33
<% html_title(l(:field_mail_notification)) -%>
trunk/app/views/admin/projects.rhtml
47 47

  
48 48
<p class="pagination"><%= pagination_links_full @project_pages, @project_count %></p>
49 49

  
50
<% set_html_title l(:label_project_plural) -%>
50
<% html_title(l(:label_project_plural)) -%>
trunk/app/views/common/403.rhtml
3 3
<p><%= l(:notice_not_authorized) %></p>
4 4
<p><a href="javascript:history.back()">Back</a></p>
5 5

  
6
<% set_html_title '403' %>
6
<% html_title '403' %>
trunk/app/views/common/404.rhtml
3 3
<p><%= l(:notice_file_not_found) %></p>
4 4
<p><a href="javascript:history.back()">Back</a></p>
5 5

  
6
<% set_html_title '404' %>
6
<% html_title '404' %>
trunk/app/views/custom_fields/list.rhtml
52 52

  
53 53
<%= javascript_tag "showTab('#{@tab}');" %>
54 54

  
55
<% set_html_title(l(:label_custom_field_plural)) -%>
55
<% html_title(l(:label_custom_field_plural)) -%>
trunk/app/views/documents/index.rhtml
36 36
    <% end %>
37 37
<% end %>
38 38

  
39
<% set_html_title l(:label_document_plural) -%>
39
<% html_title(l(:label_document_plural)) -%>
trunk/app/views/documents/show.rhtml
35 35
  <% end %> 
36 36
<% end %>
37 37

  
38
<% set_html_title h(@document.title) -%>
38
<% html_title @document.title -%>
trunk/app/views/enumerations/list.rhtml
25 25
<p><%= link_to l(:label_enumeration_new), { :action => 'new', :opt => option } %></p>
26 26
<% end %>
27 27

  
28
<% set_html_title(l(:label_enumerations)) -%>
28
<% html_title(l(:label_enumerations)) -%>
trunk/app/views/issue_statuses/list.rhtml
34 34

  
35 35
<p class="pagination"><%= pagination_links_full @issue_status_pages %></p>
36 36

  
37
<% set_html_title(l(:label_issue_status_plural)) -%>
37
<% html_title(l(:label_issue_status_plural)) -%>
trunk/app/views/issues/index.rhtml
1 1
<% if @query.new_record? %>
2 2
    <h2><%=l(:label_issue_plural)%></h2>
3
    <% set_html_title l(:label_issue_plural) %>
3
    <% html_title(l(:label_issue_plural)) %>
4 4
    
5 5
    <% form_tag({ :controller => 'queries', :action => 'new' }, :id => 'query_form') do %>
6 6
    <%= hidden_field_tag('project_id', @project.id) if @project %>
......
32 32
    <% end %>
33 33
    </div>
34 34
    
35
    <h2><%= @query.name %></h2>
35
    <h2><%=h @query.name %></h2>
36 36
    <div id="query_form"></div>
37
    <% set_html_title @query.name %>
37
    <% html_title @query.name %>
38 38
<% end %>
39 39
<%= error_messages_for 'query' %>
40 40
<% if @query.valid? %>
trunk/app/views/issues/show.rhtml
116 116
</div>
117 117
&nbsp;
118 118

  
119
<% set_html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
119
<% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
120 120

  
121 121
<% content_for :sidebar do %>
122 122
    <%= render :partial => 'issues/sidebar' %>
trunk/app/views/my/account.rhtml
45 45
<%= render :partial => 'sidebar' %>
46 46
<% end %>
47 47

  
48
<% set_html_title l(:label_my_account) -%>
48
<% html_title(l(:label_my_account)) -%>
trunk/app/views/my/page.rhtml
39 39
<div id="context-menu" style="display: none;"></div>
40 40
<%= javascript_tag 'new ContextMenu({})' %>
41 41

  
42
<% set_html_title l(:label_my_page) -%>
42
<% html_title(l(:label_my_page)) -%>
trunk/app/views/news/index.rhtml
33 33
  <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
34 34
<% end %>
35 35

  
36
<% set_html_title l(:label_news_plural) -%>
36
<% html_title(l(:label_news_plural)) -%>
trunk/app/views/news/show.rhtml
43 43
<% end %>
44 44
<% end %>
45 45

  
46
<% set_html_title(h(@news.title)) -%>
46
<% html_title @news.title -%>
trunk/app/views/projects/activity.rhtml
40 40
<% end %>
41 41
<% end %>
42 42

  
43
<% set_html_title l(:label_activity) -%>
43
<% html_title(l(:label_activity)) -%>
trunk/app/views/projects/calendar.rhtml
39 39
    <% end %>
40 40
<% end %>
41 41

  
42
<% set_html_title l(:label_calendar) -%>
42
<% html_title(l(:label_calendar)) -%>
trunk/app/views/projects/gantt.rhtml
246 246
    <% end %>
247 247
<% end %>
248 248

  
249
<% set_html_title l(:label_gantt) -%>
249
<% html_title(l(:label_gantt)) -%>
trunk/app/views/projects/list.rhtml
17 17
</div>
18 18
<% end %>
19 19

  
20
<% set_html_title l(:label_project_plural) -%>
20
<% html_title(l(:label_project_plural)) -%>
trunk/app/views/projects/list_files.rhtml
43 43
  </tbody>
44 44
</table>
45 45

  
46
<% set_html_title l(:label_attachment_plural) -%>
46
<% html_title(l(:label_attachment_plural)) -%>
trunk/app/views/projects/roadmap.rhtml
47 47
<% end %>
48 48
<% end %>
49 49

  
50
<% set_html_title l(:label_roadmap) %>
50
<% html_title(l(:label_roadmap)) %>
trunk/app/views/projects/settings.rhtml
15 15
<%= tab = params[:tab] ? h(params[:tab]) : project_settings_tabs.first[:name]
16 16
javascript_tag "showTab('#{tab}');" %>
17 17

  
18
<% set_html_title l(:label_settings) -%>
18
<% html_title(l(:label_settings)) -%>
trunk/app/views/projects/show.rhtml
82 82
<%= auto_discovery_link_tag(:atom, {:action => 'activity', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
83 83
<% end %>
84 84

  
85
<% set_html_title l(:label_overview) -%>
85
<% html_title(l(:label_overview)) -%>
trunk/app/views/repositories/_dir_list.rhtml
1
<table class="list" id="browser">
1
<table class="list entries" id="browser">
2 2
<thead>
3 3
<tr id="root">
4 4
<th><%= l(:field_name) %></th>
5 5
<th><%= l(:field_filesize) %></th>
6 6
<th><%= l(:label_revision) %></th>
7
<th><%= l(:label_date) %></th>
7
<th><%= l(:label_age) %></th>
8 8
<th><%= l(:field_author) %></th>
9 9
<th><%= l(:field_comments) %></th>
10 10
</tr>
trunk/app/views/repositories/_dir_list_content.rhtml
1 1
<% @entries.each do |entry| %>
2 2
<% tr_id = Digest::MD5.hexdigest(entry.path)
3 3
   depth = params[:depth].to_i %>
4
<tr id="<%= tr_id %>" class="<%= params[:parent_id] %>">
5
<td>
4
<tr id="<%= tr_id %>" class="<%= params[:parent_id] %> entry">
5
<td class="filename">
6 6
<%= if entry.is_dir?
7 7
  link_to_remote h(entry.name),
8 8
                 {:url => {:action => 'browse', :id => @project, :path => entry.path, :rev => @rev, :depth => (depth + 1), :parent_id => tr_id},
......
22 22
          :style => "margin-left: #{18 * depth}px;"
23 23
end %>
24 24
</td>
25
<td align="right"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>
26
<td align="right"><%= link_to(entry.lastrev.name, :action => 'revision', :id => @project, :rev => entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %></td>
27
<td align="center"><%= format_time(entry.lastrev.time) if entry.lastrev %></td>
28
<td align="center"><em><%=h(entry.lastrev.author) if entry.lastrev %></em></td>
25
<td class="size"><%= (entry.size ? number_to_human_size(entry.size) : "?") unless entry.is_dir? %></td>
26
<td class="revision"><%= link_to(entry.lastrev.name, :action => 'revision', :id => @project, :rev => entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %></td>
27
<td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td>
28
<td class="author"><%=h(entry.lastrev.author) if entry.lastrev %></td>
29 29
<% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev %>
30
<td><%=h truncate(changeset.comments, 50) unless changeset.nil? %></td>
30
<td class="comments"><%=h truncate(changeset.comments, 50) unless changeset.nil? %></td>
31 31
</tr>
32 32
<% end %>
trunk/app/views/repositories/_navigation.rhtml
17 17
<% end %>
18 18

  
19 19
<%= "@ #{revision}" if revision %>
20

  
21
<% html_title(with_leading_slash(path)) -%>
trunk/app/views/repositories/_revisions.rhtml
1 1
<% form_tag({:controller => 'repositories', :action => 'diff', :id => @project, :path => path}, :method => :get) do %>
2
<table class="list">
2
<table class="list changesets">
3 3
<thead><tr>
4 4
<th>#</th>
5 5
<th></th>
......
12 12
<% show_diff = entry && entry.is_file? && revisions.size > 1 %>
13 13
<% line_num = 1 %>
14 14
<% revisions.each do |changeset| %>
15
<tr class="<%= cycle 'odd', 'even' %>">
15
<tr class="changeset <%= cycle 'odd', 'even' %>">
16 16
<td class="id"><%= link_to changeset.revision, :action => 'revision', :id => project, :rev => changeset.revision %></td>
17 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 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 align="center" style="width:15%"><%= format_time(changeset.committed_on) %></td>
20
<td align="center" style="width:15%"><em><%=h changeset.committer %></em></td>
21
<td align="left"><%= textilizable(changeset.comments) %></td>
19
<td class="committed_on"><%= format_time(changeset.committed_on) %></td>
20
<td class="author"><%=h changeset.committer %></td>
21
<td class="comments"><%= textilizable(changeset.comments) %></td>
22 22
</tr>
23 23
<% line_num += 1 %>
24 24
<% end %>
25 25
</tbody>
26 26
</table>
27
<%= submit_tag(l(:label_view_diff), :class => 'small', :name => nil) if show_diff %>
27
<%= submit_tag(l(:label_view_diff), :name => nil) if show_diff %>
28 28
<% end %>
trunk/app/views/repositories/annotate.rhtml
21 21
</table>
22 22
</div>
23 23

  
24
<% html_title(l(:button_annotate)) -%>
25

  
24 26
<% content_for :header_tags do %>
25 27
<%= stylesheet_link_tag 'scm' %>
26 28
<% end %>
trunk/app/views/repositories/browse.rhtml
10 10

  
11 11
<% content_for :header_tags do %>
12 12
<%= stylesheet_link_tag "scm" %>
13
<% end %>
13
<% end %>
trunk/app/views/repositories/changes.rhtml
17 17

  
18 18
<%= render :partial => 'revisions', :locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => @entry }%>
19 19

  
20
<% set_html_title(h(@entry.name)) -%>
20
<% html_title(l(:label_change_plural)) -%>
trunk/app/views/repositories/diff.rhtml
88 88
<% end %>
89 89
<% end %>
90 90

  
91
<% html_title(with_leading_slash(@path), 'Diff') -%>
92

  
91 93
<% content_for :header_tags do %>
92 94
<%= stylesheet_link_tag "scm" %>
93 95
<% end %>
trunk/app/views/repositories/revision.rhtml
62 62
<%= stylesheet_link_tag "scm" %>
63 63
<% end %>
64 64

  
65
<% set_html_title("#{l(:label_revision)} #{@changeset.revision}") -%>
65
<% html_title("#{l(:label_revision)} #{@changeset.revision}") -%>
trunk/app/views/repositories/revisions.rhtml
16 16
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
17 17
<% end %>
18 18

  
19
<% set_html_title l(:label_revision_plural) -%>
19
<% html_title(l(:label_revision_plural)) -%>
trunk/app/views/repositories/show.rhtml
22 22
<%= stylesheet_link_tag "scm" %>
23 23
<% end %>
24 24

  
25
<% set_html_title l(:label_repository) -%>
25
<% html_title(l(:label_repository)) -%>
trunk/app/views/repositories/stats.rhtml
8 8
</td></tr>
9 9
</table>
10 10
<br />
11
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
11
<p><%= link_to l(:button_back), :action => 'show', :id => @project %></p>
12

  
13
<% html_title(l(:label_repository), l(:label_statistics)) -%>
trunk/app/views/roles/list.rhtml
33 33

  
34 34
<p><%= link_to l(:label_permissions_report), :action => 'report' %></p>
35 35

  
36
<% set_html_title(l(:label_role_plural)) -%>
36
<% html_title(l(:label_role_plural)) -%>
trunk/app/views/roles/workflow.rhtml
55 55

  
56 56
<% end %>
57 57

  
58
<% set_html_title(l(:label_workflow)) -%>
58
<% html_title(l(:label_workflow)) -%>
trunk/app/views/search/index.rhtml
42 42
<% end %>
43 43
</center></p>
44 44

  
45
<% set_html_title(l(:label_search)) -%>
45
<% html_title(l(:label_search)) -%>
trunk/app/views/settings/edit.rhtml
102 102
<%= submit_tag l(:button_save) %>
103 103
<% end %>
104 104

  
105
<% set_html_title(l(:label_settings)) -%>
105
<% html_title(l(:label_settings)) -%>
trunk/app/views/trackers/list.rhtml
32 32

  
33 33
<p class="pagination"><%= pagination_links_full @tracker_pages %></p>
34 34

  
35
<% set_html_title(l(:label_tracker_plural)) -%>
35
<% html_title(l(:label_tracker_plural)) -%>
trunk/app/views/users/list.rhtml
57 57

  
58 58
<p class="pagination"><%= pagination_links_full @user_pages, @user_count %></p>
59 59

  
60
<% set_html_title(l(:label_user_plural)) -%>
60
<% html_title(l(:label_user_plural)) -%>
trunk/app/views/versions/show.rhtml
11 11
<%= render :partial => 'versions/overview', :locals => {:version => @version} %>
12 12
<%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %>
13 13

  
14
<% set_html_title h(@version.name) %>
14
<% html_title @version.name %>
trunk/app/views/wiki/edit.rhtml
28 28
  <%= stylesheet_link_tag 'scm' %>
29 29
<% end %>
30 30

  
31
<% set_html_title @page.pretty_title %>
31
<% html_title @page.pretty_title %>
trunk/app/views/wiki/show.rhtml
47 47
  <%= render :partial => 'sidebar' %>
48 48
<% end %>
49 49

  
50
<% set_html_title @page.pretty_title %>
50
<% html_title @page.pretty_title %>
trunk/lang/bg.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/cs.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/de.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/en.yml
458 458
label_registration_manual_activation: manual account activation
459 459
label_registration_automatic_activation: automatic account activation
460 460
label_display_per_page: 'Per page: %s'
461
label_age: Age
461 462

  
462 463
button_login: Login
463 464
button_submit: Submit
trunk/lang/es.yml
555 555
field_searchable: Searchable
556 556
label_display_per_page: 'Per page: %s'
557 557
setting_per_page_options: Objects per page options
558
label_age: Age
trunk/lang/fr.yml
458 458
label_registration_manual_activation: activation manuelle du compte
459 459
label_registration_automatic_activation: activation automatique du compte
460 460
label_display_per_page: 'Par page: %s'
461
label_age: Age
461 462

  
462 463
button_login: Connexion
463 464
button_submit: Soumettre
trunk/lang/he.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/it.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/ja.yml
553 553
field_searchable: Searchable
554 554
label_display_per_page: 'Per page: %s'
555 555
setting_per_page_options: Objects per page options
556
label_age: Age
trunk/lang/ko.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/nl.yml
553 553
field_searchable: Searchable
554 554
label_display_per_page: 'Per page: %s'
555 555
setting_per_page_options: Objects per page options
556
label_age: Age
trunk/lang/pl.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/pt-br.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/pt.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/ro.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/ru.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/sr.yml
553 553
field_searchable: Searchable
554 554
label_display_per_page: 'Per page: %s'
555 555
setting_per_page_options: Objects per page options
556
label_age: Age
trunk/lang/sv.yml
553 553
field_searchable: Searchable
554 554
label_display_per_page: 'Per page: %s'
555 555
setting_per_page_options: Objects per page options
556
label_age: Age
trunk/lang/zh-tw.yml
552 552
field_searchable: Searchable
553 553
label_display_per_page: 'Per page: %s'
554 554
setting_per_page_options: Objects per page options
555
label_age: Age
trunk/lang/zh.yml
555 555
field_searchable: Searchable
556 556
label_display_per_page: 'Per page: %s'
557 557
setting_per_page_options: Objects per page options
558
label_age: Age
trunk/public/stylesheets/application.css
77 77
tr.issue td.subject { text-align: left; }
78 78
tr.issue td.done_ratio table.progress { margin-left:auto; margin-right: auto;}
79 79

  
80
tr.entry { border: 1px solid #f8f8f8; }
81
tr.entry td { white-space: nowrap; }
82
tr.entry td.filename { width: 30%; }
83
tr.entry td.size { text-align: right; font-size: 90%; }
84
tr.entry td.revision, tr.entry td.author { text-align: center; }
85
tr.entry td.age { text-align: right; }
86

  
87
tr.changeset td.author { text-align: center; width: 15%; }
88
tr.changeset td.committed_on { text-align: center; width: 15%; }
89

  
80 90
tr.message { height: 2.6em; }
81 91
tr.message td.last_message { font-size: 80%; }
82 92
tr.message.locked td.subject a { background-image: url(../images/locked.png); }

Also available in: Unified diff