Revision 443:350acce374a2 app/views

View differences:

app/views/activities/_recent.rhtml
1
<% events = @events_by_day %>
2
<% max = 5 %>
3
<% if (events.nil?) 
4
     activity = Redmine::Activity::Fetcher.new(User.current, :project => @project)
5
     
6
     if @project
7
        # Don't show news (duplicated with News box) or wiki edits (too
8
	# tedious) in project front page
9
        activity.scope = [ "changesets", "files", "issues", "documents" ]
10
     end
11
     
12
     events = activity.events(Date.today - 28, Date.today + 1)
13
     
14
     if defined? user
15
       events = events.select { |e| user.member_of? e.project }
16
     end
17
     
18
     events = events.first(max)
19

  
20
   end
21
%>
22

  
23
<div id="activity">
24

  
25
<% if @project.nil? %>
26
   <%= content_tag('h3', l(:label_activity_my_recent)) %>
27
   <div class="activity box">
28
<% end %>
29

  
30
<% if events.empty? %>
31

  
32
   <% if @project.nil? %>
33
     <p><%= l(:label_activity_my_recent_none) %></p>
34
   <% end %>
35

  
36
<% else %>
37

  
38
   <% if !@project.nil? %>
39
     <div class="activity box">
40
     <%= content_tag('h3', l(:label_activity_recent)) %>
41
   <% end %>
42

  
43
   <dl>
44
   <% events.sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
45
     <dt class="<%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
46
	<%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
47
     <span class="time"><%= format_time(e.event_datetime) %></span>
48
     <%= content_tag('span', link_to_project(e.project), :class => 'project') if @project.nil? || @project != e.project %>
49
     <% if e.respond_to?(:event_author) %>
50
       <span class="author"><%= e.event_author %></span>
51
     <% end %>
52
     </dt>
53
     <dd><%= link_to format_activity_title(e.event_title), e.event_url %>
54
     <span class="description"><%= format_activity_description(e.event_description) %></span>
55
     </dd>
56
   <% end -%>
57
   </dl>
58

  
59
   </div>
60

  
61
<% end %>
62

  
63
<% if events.empty? and @project.nil? %></div><% end %>
64

  
65
</div>
app/views/attachments/toggle_active.rhtml
1
<%=
2
file = Attachment.find(params[:id])
3
active_id = "active-" + file.id.to_s
4
link_to_remote image_tag(file.active? ? 'fav.png' : 'fav_off.png'),
5
  :url => {:controller => 'attachments', :action => 'toggle_active', :project_id => @project.id, :id => file},
6
  :update => active_id
7
%>
app/views/files/index.html.erb
5 5
<h2><%=l(:label_attachment_plural)%></h2>
6 6

  
7 7
<% delete_allowed = User.current.allowed_to?(:manage_files, @project) %>
8
<% active_change_allowed = delete_allowed %>
8 9

  
9 10
<table class="list files">
10 11
  <thead><tr>
12
    <%= sort_header_tag('active', :caption => l(:field_active)) %>
11 13
    <%= sort_header_tag('filename', :caption => l(:field_filename)) %>
12 14
    <%= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc') %>
13 15
    <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc') %>
14
    <%= sort_header_tag('downloads', :caption => l(:label_downloads_abbr), :default_order => 'desc') %>
16
    <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc') %>
15 17
    <th>MD5</th>
16 18
    <th></th>
17 19
  </tr></thead>
18 20
  <tbody>
21
<% have_file = false %>
19 22
<% @containers.each do |container| %>	
20 23
  <% next if container.attachments.empty? -%>
21 24
	<% if container.is_a?(Version) -%>
22 25
  <tr>
23
  	<th colspan="6" align="left">
26
  	<th colspan="7" align="left">
24 27
  		<%= link_to(h(container), {:controller => 'versions', :action => 'show', :id => container}, :class => "icon icon-package") %>
25 28
		</th>
26 29
	</tr>
27 30
	<% end -%>
28 31
  <% container.attachments.each do |file| %>		
29
  <tr class="file <%= cycle("odd", "even") %>">
30
    <td class="filename"><%= link_to_attachment file, :download => true, :title => file.description %></td>
32
  <tr class="file <%= cycle("odd", "even") %> <%= "active" if file.active? %>">
33
    <td class="active">
34
      <% have_file = true %>
35
      <% if active_change_allowed
36
           active_id = "active-" + file.id.to_s -%>
37
        <div id="<%= active_id %>">
38
        <%= link_to_remote image_tag(file.active? ? 'fav.png' : 'fav_off.png'),
39
              :url => {:controller => 'attachments', :action => 'toggle_active', :project_id => @project.id, :id => file},
40
              :update => active_id
41
        %>
42
        </div>
43
      <% else -%>
44
        <%= image_tag('fav.png') if file.active? %>
45
      <% end -%>
46
    </td>
47
    <% if file.active? %>
48
      <td class="filename active"><%= link_to_attachment file, :download => true %><br><span class="description"><%= h(file.description) %></span></td>
49
    <% else %>
50
      <td class="filename"><%= link_to_attachment file, :download => true, :title => file.description %>
51
    <% end %>
52
    </td>
31 53
    <td class="created_on"><%= format_time(file.created_on) %></td>
32 54
    <td class="filesize"><%= number_to_human_size(file.filesize) %></td>
33 55
    <td class="downloads"><%= file.downloads %></td>
......
43 65
  </tbody>
44 66
</table>
45 67

  
68
<%= l(:text_files_active_change) if active_change_allowed and have_file %>
69

  
46 70
<% html_title(l(:label_attachment_plural)) -%>
app/views/layouts/base.rhtml
54 54
      <h3 id="project-ancestors-title"><%= page_header_title[1] %></h3>
55 55
    <% end %>  
56 56

  
57
    <h1  id="project-title"
57
    <h1 id="project-title"
58 58
      <% unless page_header_title[1].empty? %>
59 59
        style="margin-top: 0px; "
60 60
      <% end %>  
61
    ><%= page_header_title[0] %></h1>
61
    ><% if display_main_menu?(@project) %>
62
       <%= link_to_project(@project) %>
63
     <% else %> 
64
       <%= page_header_title[0] %>
65
     <% end %>
66
    </h1>
62 67
    
63 68
    <% if display_main_menu?(@project) %>
64 69
    <div id="main-menu">
......
85 90
	
86 91
<div id="footer">
87 92
  <div class="bgl"><div class="bgr">
88
    Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> &copy; 2006-2011 Jean-Philippe Lang
93
    <small>Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %><br>&copy; 2006-2011 Jean-Philippe Lang</small>
89 94
  </div></div>
90 95
</div>
91 96
</div>
app/views/mailer/added_to_project.text.html.rhtml
1
<p><%= l(:notice_added_to_project, :project_name => @project_name) %></p>
2
<p><%= l(:notice_project_homepage, :project_url => @project_url) %></p>
3

  
app/views/mailer/added_to_project.text.plain.rhtml
1
<%= l(:notice_added_to_project, :project_name => @project_name) %>
2
<%= l(:notice_project_homepage, :project_url => @project_url)  %>
app/views/my/blocks/_activitymyprojects.rhtml
1

  
2
<%= render :partial => 'activities/recent', :locals => { :user => User.current } %>
3

  
4

  
app/views/my/blocks/_tipoftheday.rhtml
1
    <h3><%=l(:label_tipoftheday)%></h3>
2
    <div class="tipoftheday box">
3
          <div class="tip"><%= textilizable Setting.tipoftheday_text %></div>
4
    </div>
app/views/news/_news.rhtml
1
<p><%= link_to_project(news.project) + ': ' unless @project %>
2
<%= link_to h(news.title), news_path(news) %>
3
<%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>
4
<br />
1
<div id="news">
2
<dt>
3
<span class="time"><%= format_time(news.created_on) %></span>
4
<% project ||= @project %>
5
<% if !project %>
6
<span class="project"><%= link_to_project(news.project) %></span>
7
<% end %>
8
<span class="headline"><%= link_to h(news.title), news_path(news) %></span>
9
<span class="comments"><%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %></span>
10
</dt><dd>
5 11
<% unless news.summary.blank? %><span class="summary"><%=h news.summary %></span><br /><% end %>
6
<span class="author"><%= authoring news.created_on, news.author %></span></p>
12
</dd>
13
</div>
app/views/projects/settings/_members.rhtml
2 2
<% roles = Role.find_all_givable
3 3
   members = @project.member_principals.find(:all, :include => [:roles, :principal]).sort %>
4 4

  
5

  
5 6
<div class="splitcontentleft">
6 7
<% if members.any? %>
7 8
<table class="list members">
......
73 74
		<% end %>
74 75
		</div>
75 76
		
76
    <p><%= l(:label_role_plural) %>:
77
    <p><%= l(:label_set_role_plural) %>:</p>
77 78
    <% roles.each do |role| %>
78
    	<label><%= check_box_tag 'member[role_ids][]', role.id %> <%=h role %></label>
79
   	<% end %></p>
79
    	<label><%= check_box_tag 'member[role_ids][]', role.id %> <%=h role %> </label><div style="margin-left: 2em; margin-bottom: 0.5em"><i><%=l( 'label_' + role.name.downcase + "_description").to_sym %></i></div>
80
   	<% end %>
80 81
   	
81 82
    <p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>
82 83
		</fieldset>
app/views/projects/settings/_overview.rhtml
1

  
2
<% form_for :project, @project,
3
            :url => { :action => 'overview', :id => @project },
4
            :html => {:id => 'overview-form'} do |f| %>
5

  
6
<div class="box tabular">
7

  
8
<p><%= l(:text_has_welcome_page_info, { :overview_link => link_to(l(:label_overview), { :controller => 'projects', :action => 'show' } ) } ) %></p>
9

  
10
<% if @project.module_enabled? :wiki %>
11

  
12
<p><%= link_to(l(:button_welcome_page_edit), {:controller => 'wiki', :action => 'edit', :project_id => @project, :id => Wiki.titleize("Overview")}, :class => 'icon icon-edit') %>
13

  
14
<% else %>
15

  
16
<p><%= l(:text_has_welcome_page_wiki_disabled, { :modules_link => link_to(l(:label_module_plural), { :controller => 'projects', :action => 'settings', :tab => 'modules' } ) } ) %></p>
17

  
18
<% end %>
19

  
20
<p><label for="has_welcome_page"><%= l(:label_has_welcome_page) %></label>
21
<%= check_box_tag 'has_welcome_page', 1, @project.has_welcome_page? -%>
22
<br/><em><%= l(:setting_has_welcome_page) %></em>
23

  
24
</p>
25

  
26
</div>
27

  
28
<%= submit_tag l(:button_save) %>
29

  
30
<% end %>
app/views/projects/settings/_repository.rhtml
1

  
2
<%= javascript_include_tag 'repository' %>
3

  
1 4
<% remote_form_for :repository, @repository,
2 5
                   :url => { :controller => 'repositories', :action => 'edit', :id => @project },
3 6
                   :builder => TabularFormBuilder,
......
6 9
<%= error_messages_for 'repository' %>
7 10

  
8 11
<div class="box tabular">
9
<% if !@repository || !@repository.url %>
10
<ul><li><%= l(:text_settings_repo_creation) %></li></ul>
11
<% end %>
12
<p><%= label_tag('repository_scm', l(:label_scm)) %><%= scm_select_tag(@repository) %></p>
13
<%= repository_field_tags(f, @repository) if @repository %>
12

  
13
<p>
14
<% if @repository %>
15
   <%= l(:text_settings_repo_explanation) %></ br>
16
   <% if @repository.is_external %>
17
     <p><%= l(:text_settings_repo_is_external) %></ br>
18
   <% else %>
19
     <p><%= l(:text_settings_repo_is_internal) %></ br>
20
   <% end %>
21
</p>
22

  
23

  
24

  
25

  
26

  
27
<p>
28
	<%= label_tag('repository_is_external', l(:label_is_external_repository)) %>
29
	<%= check_box :repository, :is_external, :onclick => "toggle_ext_url()" %> 
30
	<br/><em><%= l(:setting_external_repository) %></em>
31
</p>
32

  
33

  
34
<p>
35
	<%= label_tag('repository_external_url', l(:label_repository_external_url)) %>
36
	<%= text_field :repository, :external_url, :disabled => !(@repository and @repository.is_external) %> 
37
	<br/><em><%= l(:setting_external_repository_url) %></em>
38
</p>
39

  
40
<p><%= l(:text_settings_repo_need_help) %></p>
41

  
14 42
</div>
15 43

  
16 44
<div class="contextual">
......
22 50
                :id         => @project
23 51
                },
24 52
             :class => 'icon icon-user') %>
25
<%= link_to(l(:button_delete), {:controller => 'repositories', :action => 'destroy', :id => @project},
26
            :confirm => l(:text_are_you_sure),
27
            :method  => :post,
28
            :class   => 'icon icon-del') %>
29 53
<% end %>
30 54
</div>
31 55

  
32
<%= submit_tag((@repository.nil? || @repository.new_record?) ? l(:button_create) : l(:button_save), :disabled => @repository.nil?) %>
56
<%= submit_tag(l(:button_save), :onclick => remote_function(:url => { :controller => 'repositories', :action => 'edit', :id => @project }, :method => :get, :with => "Form.serialize(this.form)")) %>
57

  
58
<% else %>
59
   <%= l(:text_settings_repo_creation) %></ br>
33 60
<% end %>
61

  
62
<% end %>
app/views/projects/show.rhtml
4 4
	<% end %>
5 5
</div>
6 6

  
7
<% if @project.has_welcome_page %>
8
<% page = @project.wiki.find_page("Overview") %>
9
<% end %>
10

  
11
<% if page %>
12

  
13
<div class="contextual" style="clear: right">
14
<ul>
15
<% @users_by_role.keys.sort.each do |role| %>
16
<li><%=h role %>: <%= @users_by_role[role].sort.collect{|u| link_to_user u}.join(", ") %></li>
17
<% end %>
18
<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %>
19
<% if @subprojects.any? %>
20
	<li><%=l(:label_subproject_plural)%>:
21
	    <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li>
22
<% end %>
23
</ul>
24
</div>
25

  
26
<%= render(:partial => "wiki/content", :locals => {:content => page.content_for_version()}) %>
27

  
28
<% else %>
29

  
7 30
<h2><%=l(:label_overview)%></h2> 
8 31
	
9 32
<div class="splitcontentleft">
......
23 46
	<% end %>
24 47
	</ul>	
25 48

  
26
  <% if User.current.allowed_to?(:view_issues, @project) %>
49
  <% if User.current.allowed_to?(:view_issues, @project) and @open_issues_by_tracker.values.any? %>
50

  
27 51
  <div class="issues box">    
28 52
    <h3><%=l(:label_issue_tracking)%></h3>
29 53
    <ul>
......
46 70
			<% end %>
47 71
		</p>
48 72
  </div>
73

  
49 74
  <% end %>
75

  
50 76
  <%= call_hook(:view_projects_show_left, :project => @project) %>
51 77
</div>
52 78

  
......
60 86
    <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p>
61 87
  </div>  
62 88
  <% end %>
89

  
90
  <%= render :partial => 'activities/recent' %>
91

  
63 92
  <%= call_hook(:view_projects_show_right, :project => @project) %>
64 93
</div>
65 94

  
......
73 102
    <%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %>
74 103
<% end %>
75 104

  
105
<% end %>
106

  
76 107
<% content_for :header_tags do %>
77 108
<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %>
78 109
<% end %>
app/views/search/index.rhtml
19 19
</div>
20 20

  
21 21
<% if @results %>
22
    
23
    <h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
22 24
    <div id="search-results-counts">
23 25
    <%= render_results_by_type(@results_by_type) unless @scope.size == 1 %>
24 26
    </div>
25
    
26
    <h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
27 27
    <dl id="search-results">
28 28
      <% @results.each do |e| %>
29 29
        <dt class="<%= e.event_type %>"><%= content_tag('span', h(e.project), :class => 'project') unless @project == e.project %> <%= link_to highlight_tokens(truncate(e.event_title, :length => 255), @tokens), e.event_url %></dt>
app/views/users/edit.rhtml
9 9
<%= render_tabs user_settings_tabs %>
10 10

  
11 11
<% html_title(l(:label_user), @user.login, l(:label_administration)) -%>
12

  
app/views/welcome/index.rhtml
9 9
<div class="splitcontentleft">
10 10
  <%= textilizable Setting.welcome_text %>
11 11
  
12
  <% if @news.any? %>
13
  <div class="news box">
14
	<h3><%=l(:label_news_latest)%></h3>
15
		<%= render :partial => 'news/news', :collection => @news %>
16
		<%= link_to l(:label_news_view_all), :controller => 'news' %>
17
  </div>
18
  <% end %>
19 12
  <%= call_hook(:view_welcome_index_left, :projects => @projects) %>
20 13
</div>
21 14

  
22 15
<div class="splitcontentright">
23
  <% if not @tipsoftheday.empty? %>
24
    <div class="newsoftheday box">
25
          <h3><%=l(:label_tipoftheday)%></h3>
26
          <%= textilizable @tipsoftheday %>
27
    </div>
16
  <% if @site_news.any? %>
17
  <div class="news box">
18
	<h3><%=l(:label_news_site_latest)%></h3>
19
	<%= render :partial => 'news/news', :locals => { :project => @site_project }, :collection => @site_news %>
20
	
21
	<%= link_to l(:label_news_more), { :controller => 'projects', :action => @site_project.identifier, :id => 'news' } %>
22
  </div>
28 23
  <% end %>
29

  
30 24
    <% if @projects.any? %>
31 25
	<div class="projects box">
32 26
	<h3><%=l(:label_project_latest)%></h3>
33 27
		<ul>
34 28
		<% for project in @projects %>
35 29
		  <% @project = project %>
36
			<li>
37
			<%= link_to_project project %> (<%= format_time(project.created_on) %>)
38
			<%= textilizable project.short_description, :project => project %>
30
			<li class="latest">
31
			<span class="title"><%= link_to_project project %></span>
32
			<span class="time"><%= format_time(project.created_on)%></span>
33
			<%= render_project_short_description project %>
39 34
			</li>
40 35
		<% end %>
41 36
    <% @project = nil %>
42 37
		</ul>
38
	<%= link_to l(:label_projects_more), :controller => 'projects' %>
43 39
	</div>
44 40
	<% end %>
45 41
    <%= call_hook(:view_welcome_index_right, :projects => @projects) %>

Also available in: Unified diff