summaryrefslogtreecommitdiffstats
path: root/app/views/projects
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-29 16:52:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-29 16:52:35 +0000
commit603e11d7a5aa62f923e7b013cac6c66462131232 (patch)
treefbbb204d2b92b5a87b787d56fe3f9c62cc3f259b /app/views/projects
parent8da5bad29516be6cbe1bc52e78837ac1ec292026 (diff)
downloadredmine-603e11d7a5aa62f923e7b013cac6c66462131232.tar.gz
redmine-603e11d7a5aa62f923e7b013cac6c66462131232.zip
Merged 0.6 branch into trunk.
Permissions management was rewritten. Some permissions can now be specifically defined for non member and anonymous users. This migration: * is irreversible (please, don't forget to *backup* your database before upgrading) * resets role's permissions (go to "Admin -> Roles & Permissions" to set them after upgrading) git-svn-id: http://redmine.rubyforge.org/svn/trunk@674 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/_form.rhtml2
-rw-r--r--app/views/projects/_members.rhtml2
-rw-r--r--app/views/projects/activity.rhtml33
-rw-r--r--app/views/projects/list.rhtml4
-rw-r--r--app/views/projects/list_issues.rhtml6
-rw-r--r--app/views/projects/list_news.rhtml4
-rw-r--r--app/views/projects/show.rhtml3
7 files changed, 31 insertions, 23 deletions
diff --git a/app/views/projects/_form.rhtml b/app/views/projects/_form.rhtml
index 585217e16..55527e080 100644
--- a/app/views/projects/_form.rhtml
+++ b/app/views/projects/_form.rhtml
@@ -4,7 +4,7 @@
<!--[form:project]-->
<p><%= f.text_field :name, :required => true %><br /><em><%= l(:text_caracters_maximum, 30) %></em></p>
-<% if admin_loggedin? and !@root_projects.empty? %>
+<% if User.current.admin? and !@root_projects.empty? %>
<p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
<% end %>
diff --git a/app/views/projects/_members.rhtml b/app/views/projects/_members.rhtml
index 1924e430a..affaf7854 100644
--- a/app/views/projects/_members.rhtml
+++ b/app/views/projects/_members.rhtml
@@ -1,5 +1,5 @@
<%= error_messages_for 'member' %>
-<% roles = Role.find(:all, :order => 'position') %>
+<% roles = Role.find_all_givable %>
<% users = User.find_active(:all) - @project.users %>
<table class="list">
diff --git a/app/views/projects/activity.rhtml b/app/views/projects/activity.rhtml
index d510ce08b..fd731cd8f 100644
--- a/app/views/projects/activity.rhtml
+++ b/app/views/projects/activity.rhtml
@@ -5,14 +5,11 @@
<% form_tag do %>
<p><%= select_month(@month, :prefix => "month", :discard_type => true) %>
<%= select_year(@year, :prefix => "year", :discard_type => true) %></p>
-<p>
- <%= check_box_tag 'show_issues', 1, @show_issues %><%= hidden_field_tag 'show_issues', 0, :id => nil %> <%=l(:label_issue_plural)%><br />
- <% if @project.repository %><%= check_box_tag 'show_changesets', 1, @show_changesets %><%= hidden_field_tag 'show_changesets', 0, :id => nil %> <%=l(:label_revision_plural)%><br /><% end %>
- <%= check_box_tag 'show_news', 1, @show_news %><%= hidden_field_tag 'show_news', 0, :id => nil %> <%=l(:label_news_plural)%><br />
- <%= check_box_tag 'show_files', 1, @show_files %><%= hidden_field_tag 'show_files', 0, :id => nil %> <%=l(:label_attachment_plural)%><br />
- <%= check_box_tag 'show_documents', 1, @show_documents %><%= hidden_field_tag 'show_documents', 0, :id => nil %> <%=l(:label_document_plural)%><br />
- <% if @project.wiki %><%= check_box_tag 'show_wiki_edits', 1, @show_wiki_edits %><%= hidden_field_tag 'show_wiki_edits', 0, :id => nil %> <%=l(:label_wiki_edit_plural)%><% end %>
-</p>
+
+<p><% @event_types.each do |t| %>
+<%= check_box_tag "show_#{t}", 1, @scope.include?(t) %> <%= l("label_#{t.singularize}_plural")%><br />
+<% end %></p>
+
<p class="textcenter"><%= submit_tag l(:button_apply), :class => 'button-small' %></p>
<% end %>
</div>
@@ -20,33 +17,33 @@
<% @events_by_day.keys.sort {|x,y| y <=> x }.each do |day| %>
<h3><%= day_name(day.cwday) %> <%= day.day %></h3>
<ul>
- <% @events_by_day[day].sort {|x,y| y.created_on <=> x.created_on }.each do |e| %>
+ <% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| %>
<li><p>
<% if e.is_a? Issue %>
- <%= e.created_on.strftime("%H:%M") %> <%= link_to_issue e %>: <%=h e.subject %><br />
+ <%= e.event_datetime.strftime("%H:%M") %> <%= link_to_issue e %>: <%=h e.subject %><br />
<i><%= e.author.name %></i>
<% elsif e.is_a? Journal %>
<%= e.created_on.strftime("%H:%M") %> <%= link_to_issue e.journalized %>
(<%=h (status = IssueStatus.find_by_id(e.details.first.value)) ? status.name : '?' %>): <%=h e.journalized.subject %><br />
<em><%=h e.user.name %><%=h ": #{truncate(e.notes, 500)}" unless e.notes.blank? %></em>
<% elsif e.is_a? News %>
- <%= e.created_on.strftime("%H:%M") %> <%=l(:label_news)%>: <%= link_to h(e.title), :controller => 'news', :action => 'show', :id => e %><br />
+ <%= e.event_datetime.strftime("%H:%M") %> <%=l(:label_news)%>: <%= link_to h(e.title), :controller => 'news', :action => 'show', :id => e %><br />
<% unless e.summary.empty? %><%=h e.summary %><br /><% end %>
<i><%= e.author.name %></i>
<% elsif (e.is_a? Attachment) and (e.container.is_a? Version) %>
- <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%> (<%=h e.container.name %>): <%= link_to e.filename, :controller => 'projects', :action => 'list_files', :id => @project %><br />
+ <%= e.event_datetime.strftime("%H:%M") %> <%=l(:label_attachment)%> (<%=h e.container.name %>): <%= link_to e.filename, :controller => 'projects', :action => 'list_files', :id => @project %><br />
<i><%= e.author.name %></i>
<% elsif (e.is_a? Attachment) and (e.container.is_a? Document) %>
- <%= e.created_on.strftime("%H:%M") %> <%=l(:label_attachment)%>: <%= e.filename %> (<%= link_to h(e.container.title), :controller => 'documents', :action => 'show', :id => e.container %>)<br />
+ <%= e.event_datetime.strftime("%H:%M") %> <%=l(:label_attachment)%>: <%= e.filename %> (<%= link_to h(e.container.title), :controller => 'documents', :action => 'show', :id => e.container %>)<br />
<i><%= e.author.name %></i>
<% elsif e.is_a? Document %>
- <%= e.created_on.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to h(e.title), :controller => 'documents', :action => 'show', :id => e %><br />
+ <%= e.event_datetime.strftime("%H:%M") %> <%=l(:label_document)%>: <%= link_to h(e.title), :controller => 'documents', :action => 'show', :id => e %><br />
<% elsif e.is_a? WikiContent.versioned_class %>
- <%= e.created_on.strftime("%H:%M") %> <%=l(:label_wiki_edit)%>: <%= link_to h(WikiPage.pretty_title(e.title)), :controller => 'wiki', :page => e.title %>
+ <%= e.event_datetime.strftime("%H:%M") %> <%=l(:label_wiki_edit)%>: <%= link_to h(WikiPage.pretty_title(e.title)), :controller => 'wiki', :page => e.title %>
(<%= link_to '#' + e.version.to_s, :controller => 'wiki', :page => e.title, :version => e.version %><%= ', ' + link_to('diff', :controller => 'wiki', :action => 'diff', :page => e.title, :version => e.version) if e.version > 1 %>)<br />
<% unless e.comments.blank? %><em><%=h e.comments %></em><% end %>
<% elsif e.is_a? Changeset %>
- <%= e.created_on.strftime("%H:%M") %> <%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br />
+ <%= e.event_datetime.strftime("%H:%M") %> <%=l(:label_revision)%> <%= link_to h(e.revision), :controller => 'repositories', :action => 'revision', :id => @project, :rev => e.revision %><br />
<em><%=h e.committer.blank? ? "anonymous" : e.committer %><%= h(": #{truncate(e.comments, 500)}") unless e.comments.blank? %></em>
<% end %>
</p></li>
@@ -69,3 +66,7 @@
</div>
<br />
</div>
+
+<% content_for :header_tags do %>
+<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :year => nil, :month => nil, :key => User.current.rss_key})) %>
+<% end %>
diff --git a/app/views/projects/list.rhtml b/app/views/projects/list.rhtml
index 24448be48..1fc3aab56 100644
--- a/app/views/projects/list.rhtml
+++ b/app/views/projects/list.rhtml
@@ -10,7 +10,7 @@
<% for project in @projects %>
<tr class="<%= cycle("odd", "even") %>">
<td>
- <%= link_to project.name, {:action => 'show', :id => project}, :class => (@logged_in_user && @logged_in_user.role_for_project(project) ? "icon icon-fav" : "") %><br />
+ <%= link_to project.name, {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %><br />
<%= textilizable project.description, :project => project %>
</td>
<td><%= link_to(project.parent.name, :action => 'show', :id => project.parent) unless project.parent.nil? %></td>
@@ -20,7 +20,7 @@
</tbody>
</table>
-<% if @logged_in_user %>
+<% if User.current.logged? %>
<div class="contextual">
<span class="icon icon-fav"><%= l(:label_my_projects) %></span>
</div>
diff --git a/app/views/projects/list_issues.rhtml b/app/views/projects/list_issues.rhtml
index 1cacf0055..5ebc4107e 100644
--- a/app/views/projects/list_issues.rhtml
+++ b/app/views/projects/list_issues.rhtml
@@ -1,6 +1,7 @@
<% if @query.new_record? %>
<div class="contextual">
<%= link_to l(:label_query_plural), :controller => 'queries', :project_id => @project %>
+ <% if authorize_for('projects', 'add_issues') %>| <%= l(:label_issue_new) %>: <%= new_issue_selector %><% end %>
</div>
<h2><%=l(:label_issue_plural)%></h2>
@@ -19,7 +20,7 @@
:update => "content",
}, :class => 'icon icon-reload' %>
- <% if loggedin? %>
+ <% if current_role.allowed_to?(:save_queries) %>
<%= link_to_remote l(:button_save),
{ :url => { :controller => 'queries', :action => 'new', :project_id => @project },
:method => 'get',
@@ -33,6 +34,7 @@
<div class="contextual">
<%= link_to l(:label_query_plural), {:controller => 'queries', :project_id => @project} %> |
<%= link_to l(:label_issue_view_all), {:controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1} %>
+ <% if authorize_for('projects', 'add_issues') %>| <%= l(:label_issue_new) %>: <%= new_issue_selector %><% end %>
</div>
<h2><%= @query.name %></h2>
<% end %>
@@ -81,4 +83,4 @@
</p>
<% end %>
<% end %>
-<% end %> \ No newline at end of file
+<% end %>
diff --git a/app/views/projects/list_news.rhtml b/app/views/projects/list_news.rhtml
index 17a786260..4ab086d55 100644
--- a/app/views/projects/list_news.rhtml
+++ b/app/views/projects/list_news.rhtml
@@ -7,3 +7,7 @@
<% if @news.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
<%= render :partial => 'news/news', :collection => @news %>
<%= pagination_links_full @news_pages %>
+
+<% content_for :header_tags do %>
+ <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
+<% end %>
diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml
index 9419fb2a1..5f641f6a4 100644
--- a/app/views/projects/show.rhtml
+++ b/app/views/projects/show.rhtml
@@ -20,6 +20,7 @@
</ul>
<div class="box">
+ <div class="contextual"><% if authorize_for('projects', 'add_issues') %><%= l(:label_issue_new) %>: <%= new_issue_selector %><% end %></div>
<h3 class="icon22 icon22-tracker"><%=l(:label_issue_tracking)%></h3>
<ul>
<% for tracker in @trackers %>
@@ -49,7 +50,7 @@
</div>
<% end %>
- <% if @news.any? %>
+ <% if @news.any? && authorize_for('projects', 'list_news') %>
<div class="box">
<h3><%=l(:label_news_latest)%></h3>
<%= render :partial => 'news/news', :collection => @news %>