summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin/mail_options.rhtml23
-rw-r--r--app/views/boards/show.rhtml4
-rw-r--r--app/views/common/feed.atom.rxml26
-rw-r--r--app/views/issues/show.rhtml25
-rw-r--r--app/views/layouts/base.rhtml77
-rw-r--r--app/views/messages/show.rhtml2
-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
-rw-r--r--app/views/queries/_form.rhtml2
-rw-r--r--app/views/queries/index.rhtml6
-rw-r--r--app/views/reports/issue_report.rhtml2
-rw-r--r--app/views/repositories/revisions.rhtml1
-rw-r--r--app/views/repositories/show.rhtml7
-rw-r--r--app/views/roles/_form.rhtml25
-rw-r--r--app/views/roles/list.rhtml6
-rw-r--r--app/views/roles/report.rhtml37
-rw-r--r--app/views/wiki/show.rhtml4
22 files changed, 130 insertions, 171 deletions
diff --git a/app/views/admin/mail_options.rhtml b/app/views/admin/mail_options.rhtml
index c70965776..cab94294f 100644
--- a/app/views/admin/mail_options.rhtml
+++ b/app/views/admin/mail_options.rhtml
@@ -1,26 +1,3 @@
<h2><%=l(:field_mail_notification)%></h2>
-<% form_tag({:action => 'mail_options'}, :id => 'mail_options_form') do %>
-
-<div class="box">
-<p><%=l(:text_select_mail_notifications)%></p>
-
-<% actions = @actions.group_by {|p| p.group_id } %>
-<% actions.keys.sort.each do |group_id| %>
-<fieldset style="margin-top: 6px;"><legend><strong><%= l(Permission::GROUPS[group_id]) %></strong></legend>
-<% actions[group_id].each do |p| %>
- <div style="width:170px;float:left;"><%= check_box_tag "action_ids[]", p.id, p.mail_enabled? %>
- <%= l(p.description.to_sym) %>
- </div>
-<% end %>
-<div class="clear"></div>
-</fieldset>
-<% end %>
-<br />
-<%= check_all_links('mail_options_form') %>
-</div>
-
-<p><%= submit_tag l(:button_save) %></p>
-<% end %>
-
<%= link_to l(:label_send_test_email), :action => 'test_email' %>
diff --git a/app/views/boards/show.rhtml b/app/views/boards/show.rhtml
index cb38cdb53..c31ec67e9 100644
--- a/app/views/boards/show.rhtml
+++ b/app/views/boards/show.rhtml
@@ -1,6 +1,6 @@
<div class="contextual">
-<%= link_to l(:label_message_new), {:controller => 'messages', :action => 'new', :board_id => @board}, :class => "icon icon-add" %>
-<%= watcher_tag(@board, @logged_in_user) %>
+<%= link_to_if_authorized l(:label_message_new), {:controller => 'messages', :action => 'new', :board_id => @board}, :class => "icon icon-add" %>
+<%= watcher_tag(@board, User.current) %>
</div>
<h2><%=h @board.name %></h2>
diff --git a/app/views/common/feed.atom.rxml b/app/views/common/feed.atom.rxml
new file mode 100644
index 000000000..fa00d754a
--- /dev/null
+++ b/app/views/common/feed.atom.rxml
@@ -0,0 +1,26 @@
+xml.instruct!
+xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
+ xml.title @title
+ xml.link "rel" => "self", "href" => url_for(params.merge({:format => nil, :only_path => false}))
+ xml.link "rel" => "alternate", "href" => url_for(:controller => 'welcome', :only_path => false)
+ xml.id url_for(:controller => 'welcome', :only_path => false)
+ xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
+ xml.author { xml.name "#{Setting.app_title}" }
+ xml.generator(:uri => Redmine::Info.url, :version => Redmine::VERSION) { xml.text! "#{Redmine::Info.name} #{Redmine::VERSION}" }
+ @items.each do |item|
+ xml.entry do
+ xml.title truncate(item.event_title, 100)
+ xml.link "rel" => "alternate", "href" => url_for(item.event_url(:only_path => false))
+ xml.id url_for(item.event_url(:only_path => false))
+ xml.updated item.event_datetime.xmlschema
+ author = item.event_author
+ xml.author do
+ xml.name(author.is_a?(User) ? author.name : author)
+ xml.email(author.mail) if author.is_a?(User)
+ end if author
+ xml.content "type" => "html" do
+ xml.text! textilizable(item.event_description)
+ end
+ end
+ end
+end
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml
index 078ecd1f5..70b19d1fc 100644
--- a/app/views/issues/show.rhtml
+++ b/app/views/issues/show.rhtml
@@ -58,7 +58,7 @@ end %>
<div class="contextual">
<%= link_to_if_authorized l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue}, :class => 'icon icon-edit' %>
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
-<%= watcher_tag(@issue, @logged_in_user) %>
+<%= watcher_tag(@issue, User.current) %>
<%= link_to_if_authorized l(:button_move), {:controller => 'projects', :action => 'move_issues', :id => @project, "issue_ids[]" => @issue.id }, :class => 'icon icon-move' %>
<%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
</div>
@@ -81,6 +81,13 @@ end %>
</div>
<% end %>
+<% if @issue.attachments.any? %>
+<div class="box">
+<h3><%=l(:label_attachment_plural)%></h3>
+<%= link_to_attachments @issue.attachments, :delete_url => (authorize_for('issues', 'destroy_attachment') ? {:controller => 'issues', :action => 'destroy_attachment', :id => @issue} : nil) %>
+</div>
+<% end %>
+
<% if @journals.any? %>
<div id="history" class="box">
<h3><%=l(:label_history)%></h3>
@@ -88,26 +95,14 @@ end %>
</div>
<% end %>
-<div class="box">
-<h3><%=l(:label_attachment_plural)%></h3>
-<%= link_to_attachments @issue.attachments, :delete_url => (authorize_for('issues', 'destroy_attachment') ? {:controller => 'issues', :action => 'destroy_attachment', :id => @issue} : nil) %>
-
-<% if authorize_for('issues', 'add_attachment') %>
-<p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p>
-<% form_tag({ :controller => 'issues', :action => 'add_attachment', :id => @issue }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %>
- <%= render :partial => 'attachments/form' %>
-<%= submit_tag l(:button_add) %>
-<% end %>
-<% end %>
-</div>
-
<% if authorize_for('issues', 'add_note') %>
<div class="box">
<h3><%= l(:label_add_note) %></h3>
- <% form_tag({:controller => 'issues', :action => 'add_note', :id => @issue}, :class => "tabular" ) do %>
+ <% form_tag({:controller => 'issues', :action => 'add_note', :id => @issue}, :class => "tabular", :multipart => true) do %>
<p><label for="notes"><%=l(:field_notes)%></label>
<%= text_area_tag 'notes', '', :cols => 60, :rows => 10, :class => 'wiki-edit' %></p>
<%= wikitoolbar_for 'notes' %>
+ <%= render :partial => 'attachments/form' %>
<%= submit_tag l(:button_add) %>
<% end %>
</div>
diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml
index 38a2dbeb6..9c81a313b 100644
--- a/app/views/layouts/base.rhtml
+++ b/app/views/layouts/base.rhtml
@@ -27,7 +27,7 @@
<h2><%= Setting.app_subtitle %></h2>
</div>
<div style="float: right; padding-right: 1em; padding-top: 0.2em;">
- <% if loggedin? %><small><%=l(:label_logged_as)%> <strong><%= @logged_in_user.login %></strong> -</small><% end %>
+ <% if User.current.logged? %><small><%=l(:label_logged_as)%> <strong><%= User.current.login %></strong> -</small><% end %>
<small><%= toggle_link l(:label_search), 'quick-search-form', :focus => 'quick-search-input' %></small>
<% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get, :id => 'quick-search-form', :style => "display:none;" ) do %>
<%= text_field_tag 'q', @question, :size => 15, :class => 'small', :id => 'quick-search-input' %>
@@ -40,27 +40,23 @@
<li><%= link_to l(:label_home), { :controller => 'welcome' }, :class => "icon icon-home" %></li>
<li><%= link_to l(:label_my_page), { :controller => 'my', :action => 'page'}, :class => "icon icon-mypage" %></li>
- <% if loggedin? and @logged_in_user.memberships.any? %>
+ <% if User.current.memberships.any? %>
<li class="submenu"><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects", :onmouseover => "buttonMouseover(event, 'menuAllProjects');" %></li>
<% else %>
<li><%= link_to l(:label_project_plural), { :controller => 'projects' }, :class => "icon icon-projects" %></li>
<% end %>
-
- <% unless @project.nil? || @project.id.nil? %>
- <li class="submenu"><%= link_to @project.name, { :controller => 'projects', :action => 'show', :id => @project }, :class => "icon icon-projects", :onmouseover => "buttonMouseover(event, 'menuProject');" %></li>
- <% end %>
- <% if loggedin? %>
+ <% if User.current.logged? %>
<li><%= link_to l(:label_my_account), { :controller => 'my', :action => 'account' }, :class => "icon icon-user" %></li>
<% end %>
- <% if admin_loggedin? %>
+ <% if User.current.admin? %>
<li class="submenu"><%= link_to l(:label_administration), { :controller => 'admin' }, :class => "icon icon-admin", :onmouseover => "buttonMouseover(event, 'menuAdmin');" %></li>
<% end %>
<li class="right"><%= link_to l(:label_help), { :controller => 'help', :ctrl => params[:controller], :page => params[:action] }, :onclick => "window.open(this.href); return false;", :class => "icon icon-help" %></li>
- <% if loggedin? %>
+ <% if User.current.logged? %>
<li class="right"><%= link_to l(:label_logout), { :controller => 'account', :action => 'logout' }, :class => "icon icon-user" %></li>
<% else %>
<li class="right"><%= link_to l(:label_login), { :controller => 'account', :action => 'login' }, :class => "icon icon-user" %></li>
@@ -68,71 +64,28 @@
</ul>
</div>
- <% if admin_loggedin? %>
+ <% if User.current.admin? %>
<%= render :partial => 'admin/menu' %>
<% end %>
-
- <% unless @project.nil? || @project.id.nil? %>
- <div id="menuProject" class="menu" onmouseover="menuMouseover(event)">
- <%= link_to l(:label_calendar), {:controller => 'projects', :action => 'calendar', :id => @project }, :class => "menuItem" %>
- <%= link_to l(:label_gantt), {:controller => 'projects', :action => 'gantt', :id => @project }, :class => "menuItem" %>
- <%= link_to l(:label_issue_plural), {:controller => 'projects', :action => 'list_issues', :id => @project }, :class => "menuItem" %>
- <% if @project && authorize_for('projects', 'add_issue') %>
- <a class="menuItem" href="#" onmouseover="menuItemMouseover(event,'menuNewIssue');" onclick="this.blur(); return false;"><span class="menuItemText"><%= l(:label_issue_new) %></span><span class="menuItemArrow">&#9654;</span></a>
- <% end %>
- <%= link_to l(:label_report_plural), {:controller => 'reports', :action => 'issue_report', :id => @project }, :class => "menuItem" %>
- <%= link_to l(:label_activity), {:controller => 'projects', :action => 'activity', :id => @project }, :class => "menuItem" %>
- <%= link_to l(:label_news_plural), {:controller => 'projects', :action => 'list_news', :id => @project }, :class => "menuItem" %>
- <%= link_to l(:label_change_log), {:controller => 'projects', :action => 'changelog', :id => @project }, :class => "menuItem" %>
- <%= link_to l(:label_roadmap), {:controller => 'projects', :action => 'roadmap', :id => @project }, :class => "menuItem" %>
- <%= link_to l(:label_document_plural), {:controller => 'projects', :action => 'list_documents', :id => @project }, :class => "menuItem" %>
- <%= link_to l(:label_wiki), {:controller => 'wiki', :id => @project, :page => nil }, :class => "menuItem" if @project.wiki and !@project.wiki.new_record? %>
- <%= link_to l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project, :id => nil }, :class => "menuItem" unless @project.boards.empty? %>
- <%= link_to l(:label_attachment_plural), {:controller => 'projects', :action => 'list_files', :id => @project }, :class => "menuItem" %>
- <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project }, :class => "menuItem" %>
- <%= link_to l(:label_repository), {:controller => 'repositories', :action => 'show', :id => @project}, :class => "menuItem" if @project.repository and !@project.repository.new_record? %>
- <%= link_to_if_authorized l(:label_settings), {:controller => 'projects', :action => 'settings', :id => @project }, :class => "menuItem" %>
- </div>
- <% end %>
-
- <% if @project && authorize_for('projects', 'add_issue') %>
- <div id="menuNewIssue" class="menu" onmouseover="menuMouseover(event)">
- <% Tracker.find(:all, :order => 'position').each do |tracker| %>
- <%= link_to tracker.name, {:controller => 'projects', :action => 'add_issue', :id => @project, :tracker_id => tracker}, :class => "menuItem" %>
- <% end %>
- </div>
- <% end %>
- <% if loggedin? and @logged_in_user.memberships.any? %>
+ <% if User.current.memberships.any? %>
<div id="menuAllProjects" class="menu" onmouseover="menuMouseover(event)">
<%= link_to l(:label_project_all), {:controller => 'projects' }, :class => "menuItem" %>
- <% @logged_in_user.memberships.find(:all, :limit => 20).each do |membership| %>
+ <% User.current.memberships.find(:all, :limit => 20).each do |membership| %>
<%= link_to membership.project.name, {:controller => 'projects',:action => 'show', :id => membership.project }, :class => "menuItem" %>
<% end %>
</div>
<% end %>
- <div id="subcontent">
-
- <% unless @project.nil? || @project.id.nil? %>
+ <div id="subcontent">
+ <% if @project && !@project.new_record? %>
<h2><%= @project.name %></h2>
<ul class="menublock">
- <li><%= link_to l(:label_overview), :controller => 'projects', :action => 'show', :id => @project %></li>
- <li><%= link_to l(:label_calendar), :controller => 'projects', :action => 'calendar', :id => @project %></li>
- <li><%= link_to l(:label_gantt), :controller => 'projects', :action => 'gantt', :id => @project %></li>
- <li><%= link_to l(:label_issue_plural), :controller => 'projects', :action => 'list_issues', :id => @project %></li>
- <li><%= link_to l(:label_report_plural), :controller => 'reports', :action => 'issue_report', :id => @project %></li>
- <li><%= link_to l(:label_activity), :controller => 'projects', :action => 'activity', :id => @project %></li>
- <li><%= link_to l(:label_news_plural), :controller => 'projects', :action => 'list_news', :id => @project %></li>
- <li><%= link_to l(:label_change_log), :controller => 'projects', :action => 'changelog', :id => @project %></li>
- <li><%= link_to l(:label_roadmap), :controller => 'projects', :action => 'roadmap', :id => @project %></li>
- <li><%= link_to l(:label_document_plural), :controller => 'projects', :action => 'list_documents', :id => @project %></li>
- <%= content_tag("li", link_to(l(:label_wiki), :controller => 'wiki', :id => @project, :page => nil)) if @project.wiki and !@project.wiki.new_record? %>
- <%= content_tag("li", link_to(l(:label_board_plural), :controller => 'boards', :action => 'index', :project_id => @project, :id => nil)) unless @project.boards.empty? %>
- <li><%= link_to l(:label_attachment_plural), :controller => 'projects', :action => 'list_files', :id => @project %></li>
- <li><%= link_to l(:label_search), :controller => 'search', :action => 'index', :id => @project %></li>
- <%= content_tag("li", link_to(l(:label_repository), :controller => 'repositories', :action => 'show', :id => @project)) if @project.repository and !@project.repository.new_record? %>
- <li><%= link_to_if_authorized l(:label_settings), :controller => 'projects', :action => 'settings', :id => @project %></li>
+ <% Redmine::MenuManager.allowed_items(:project_menu, current_role).each do |item| %>
+ <% unless item.condition && !item.condition.call(@project) %>
+ <li><%= link_to l(item.name), {item.param => @project}.merge(item.url) %></li>
+ <% end %>
+ <% end %>
</ul>
<% end %>
</div>
diff --git a/app/views/messages/show.rhtml b/app/views/messages/show.rhtml
index c18eb524e..3e546ceea 100644
--- a/app/views/messages/show.rhtml
+++ b/app/views/messages/show.rhtml
@@ -13,7 +13,7 @@
<div class="wiki"><p><%= textilizable message.content %></p></div>
<% end %>
-<% if @logged_in_user %>
+<% if authorize_for('messages', 'reply') %>
<p><%= toggle_link l(:button_reply), "reply", :focus => "reply_content" %></p>
<div id="reply" style="display:none;">
<%= error_messages_for 'message' %>
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 %>
diff --git a/app/views/queries/_form.rhtml b/app/views/queries/_form.rhtml
index 9482bd33a..d641fa0b5 100644
--- a/app/views/queries/_form.rhtml
+++ b/app/views/queries/_form.rhtml
@@ -5,7 +5,7 @@
<p><label for="query_name"><%=l(:field_name)%></label>
<%= text_field 'query', 'name', :size => 80 %></p>
-<% if authorize_for('projects', 'add_query') %>
+<% if current_role.allowed_to?(:manage_pulic_queries) %>
<p><label for="query_is_public"><%=l(:field_is_public)%></label>
<%= check_box 'query', 'is_public' %></p>
<% end %>
diff --git a/app/views/queries/index.rhtml b/app/views/queries/index.rhtml
index 69cfb8f98..71aa37497 100644
--- a/app/views/queries/index.rhtml
+++ b/app/views/queries/index.rhtml
@@ -1,7 +1,5 @@
<div class="contextual">
-<% if loggedin? %>
-<%= link_to l(:label_query_new), {:controller => 'queries', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %>
-<% end %>
+<%= link_to_if_authorized l(:label_query_new), {:controller => 'queries', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %>
</div>
<h2><%= l(:label_query_plural) %></h2>
@@ -17,7 +15,7 @@
</td>
<td align="right">
<small>
- <% if query.editable_by?(@logged_in_user) %>
+ <% if query.editable_by?(User.current) %>
<%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => query}, :class => 'icon icon-edit' %>
<%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
</small>
diff --git a/app/views/reports/issue_report.rhtml b/app/views/reports/issue_report.rhtml
index bf40e79ae..1d865acbc 100644
--- a/app/views/reports/issue_report.rhtml
+++ b/app/views/reports/issue_report.rhtml
@@ -1,4 +1,4 @@
-<% if @total_hours %>
+<% if @total_hours && authorize_for('timelog', 'reports') %>
<div style="float:right;text-align:right;">
<strong><%= l(:label_spent_time) %></strong>: <span class="icon icon-time"><%= lwr(:label_f_hour, @total_hours) %></span><br />
<%= link_to(l(:label_details), {:controller => 'timelog', :action => 'details', :project_id => @project}) %> |
diff --git a/app/views/repositories/revisions.rhtml b/app/views/repositories/revisions.rhtml
index 0c2655d5f..882d5ea4f 100644
--- a/app/views/repositories/revisions.rhtml
+++ b/app/views/repositories/revisions.rhtml
@@ -14,4 +14,5 @@
<% content_for :header_tags do %>
<%= stylesheet_link_tag "scm" %>
+<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<% end %>
diff --git a/app/views/repositories/show.rhtml b/app/views/repositories/show.rhtml
index fcf954473..c9f44d575 100644
--- a/app/views/repositories/show.rhtml
+++ b/app/views/repositories/show.rhtml
@@ -4,15 +4,18 @@
<h2><%= l(:label_repository) %> (<%= @repository.scm_name %>)</h2>
-<% unless @entries.nil? %>
+<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<h3><%= l(:label_browse) %></h3>
<%= render :partial => 'dir_list' %>
<% end %>
-<% unless @changesets.empty? %>
+<% if !@changesets.empty? && authorize_for('repositories', 'revisions') %>
<h3><%= l(:label_latest_revision_plural) %></h3>
<%= render :partial => 'revisions', :locals => {:project => @project, :path => '', :revisions => @changesets, :entry => nil }%>
<p><%= link_to l(:label_view_revisions), :action => 'revisions', :id => @project %></p>
+<% content_for :header_tags do %>
+ <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :action => 'revisions', :id => @project, :page => nil, :key => User.current.rss_key})) %>
+<% end %>
<% end %>
<% content_for :header_tags do %>
diff --git a/app/views/roles/_form.rhtml b/app/views/roles/_form.rhtml
index d69fff132..62e25e337 100644
--- a/app/views/roles/_form.rhtml
+++ b/app/views/roles/_form.rhtml
@@ -1,23 +1,20 @@
<%= error_messages_for 'role' %>
+
<div class="box">
-<!--[form:role]-->
-<p><%= f.text_field :name, :required => true %></p>
+<p><%= f.text_field :name, :required => true, :disabled => @role.builtin? %></p>
+</div>
<p><%= f.check_box :assignable %></p>
<div class="clear"></div>
-<h3><%=l(:label_permissions)%></h3>
-<% permissions = @permissions.group_by {|p| p.group_id } %>
-<% permissions.keys.sort.each do |group_id| %>
-<fieldset style="margin-top: 6px;"><legend><strong><%= l(Permission::GROUPS[group_id]) %></strong></legend>
-<% permissions[group_id].each do |p| %>
- <div style="width:170px;float:left;"><%= check_box_tag "permission_ids[]", p.id, (@role.permissions.include? p) %>
- <%= l(p.description.to_sym) %>
- </div>
+<fieldset class="box"><legend><%=l(:label_permissions)%></legend>
+<% @permissions.each do |permission| %>
+ <div style="width:220px;float:left;">
+ <%= check_box_tag 'role[permissions][]', permission.name, (@role.permissions.include? permission.name) %>
+ <%= permission.name.to_s.humanize %>
+ </div>
<% end %>
+<%= hidden_field_tag 'role[permissions][]', '' %>
<div class="clear"></div>
-</fieldset>
-<% end %>
<br />
<%= check_all_links 'role_form' %>
-<!--[eoform:role]-->
-</div>
+</fieldset>
diff --git a/app/views/roles/list.rhtml b/app/views/roles/list.rhtml
index e3e576ed1..14ae260aa 100644
--- a/app/views/roles/list.rhtml
+++ b/app/views/roles/list.rhtml
@@ -13,15 +13,17 @@
<tbody>
<% for role in @roles %>
<tr class="<%= cycle("odd", "even") %>">
- <td><%= link_to role.name, :action => 'edit', :id => role %></td>
+ <td><%= content_tag(role.builtin? ? 'em' : 'span', link_to(role.name, :action => 'edit', :id => role)) %></td>
<td align="center" style="width:15%;">
+ <% unless role.builtin? %>
<%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:action => 'move', :id => role, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %>
<%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:action => 'move', :id => role, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> -
<%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:action => 'move', :id => role, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %>
<%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:action => 'move', :id => role, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %>
+ <% end %>
</td>
<td align="center" style="width:10%;">
- <%= button_to l(:button_delete), { :action => 'destroy', :id => role }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
+ <%= button_to(l(:button_delete), { :action => 'destroy', :id => role }, :confirm => l(:text_are_you_sure), :class => "button-small") unless role.builtin? %>
</tr>
<% end %>
</tbody>
diff --git a/app/views/roles/report.rhtml b/app/views/roles/report.rhtml
index 61e1e18e4..676e25f39 100644
--- a/app/views/roles/report.rhtml
+++ b/app/views/roles/report.rhtml
@@ -1,32 +1,31 @@
<h2><%=l(:label_permissions_report)%></h2>
<%= start_form_tag({:action => 'report'}, :id => 'permissions_form') %>
-
+<%= hidden_field_tag 'permissions[0]', '' %>
<table class="list">
-<thead><tr>
- <th><%=l(:label_permissions)%></th>
- <th colspan="<%= @roles.length %>"><%= l(:label_role_plural) %></th>
-</tr>
-</thead>
-<tbody>
-<% permissions = @permissions.group_by {|p| p.group_id } %>
-<% permissions.keys.sort.each do |group_id| %>
+<thead>
<tr>
- <th><%= l(Permission::GROUPS[group_id]) %></th>
- <% @roles.each do |role| %><th align="center"><small><%= role.name %></small></th><% end %>
- </tr>
- <% permissions[group_id].each do |p| %>
- <tr class="<%= cycle("odd", "even") %>">
- <td><%= l(p.description.to_sym) %></td>
+ <th><%=l(:label_permissions)%></th>
<% @roles.each do |role| %>
- <td align="center"><%= check_box_tag "permission_ids[#{role.id}][]", p.id, (role.permissions.include? p) %></td>
+ <th><%= content_tag(role.builtin? ? 'em' : 'span', h(role.name)) %></th>
<% end %>
</tr>
+</thead>
+<tbody>
+<% @permissions.each do |permission| %>
+ <tr class="<%= cycle('odd', 'even') %>">
+ <td><%= permission.name.to_s.humanize %></td>
+ <% @roles.each do |role| %>
+ <td align="center">
+ <% if role.setable_permissions.include? permission %>
+ <%= check_box_tag "permissions[#{role.id}][]", permission.name, (role.permissions.include? permission.name) %>
<% end %>
-<% reset_cycle
-end %>
+ </td>
+ <% end %>
+ </tr>
+<% end %>
</tbody>
</table>
<p><%= check_all_links 'permissions_form' %></p>
<p><%= submit_tag l(:button_save) %></p>
-<%= end_form_tag %> \ No newline at end of file
+<%= end_form_tag %>
diff --git a/app/views/wiki/show.rhtml b/app/views/wiki/show.rhtml
index c7a2985be..06eca76ee 100644
--- a/app/views/wiki/show.rhtml
+++ b/app/views/wiki/show.rhtml
@@ -1,7 +1,7 @@
<div class="contextual">
-<%= link_to(l(:button_edit), {:action => 'edit', :page => @page.title}, :class => 'icon icon-edit') if @content.version == @page.content.version %>
+<%= link_to_if_authorized(l(:button_edit), {:action => 'edit', :page => @page.title}, :class => 'icon icon-edit') if @content.version == @page.content.version %>
<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :page => @page.title}, :method => :post, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %>
-<%= link_to(l(:button_rollback), {:action => 'edit', :page => @page.title, :version => @content.version }, :class => 'icon icon-cancel') if @content.version < @page.content.version %>
+<%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :page => @page.title, :version => @content.version }, :class => 'icon icon-cancel') if @content.version < @page.content.version %>
<%= link_to(l(:label_history), {:action => 'history', :page => @page.title}, :class => 'icon icon-history') %>
<%= link_to(l(:label_page_index), {:action => 'special', :page => 'Page_index'}, :class => 'icon icon-index') %>
</div>