diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-05-13 17:09:56 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-05-13 17:09:56 +0000 |
commit | b90e84b9fe252df464d084f0222c65367407a4ba (patch) | |
tree | 313fc54f0eb43ebb0d61f33b878c8b5e1af27052 /app/views | |
parent | 75582f80f85528865fa86d93ac57a44337742939 (diff) | |
download | redmine-b90e84b9fe252df464d084f0222c65367407a4ba.tar.gz redmine-b90e84b9fe252df464d084f0222c65367407a4ba.zip |
Per project forums added.
Permissions for forums management can be set in "Admin -> Roles & Permissions".
Forums can be created on the project settings screen ("Forums" tab).
Once a project has a forum, a "Forums" link appears in the project menu.
For now, posting messages in forums requires to be logged in. Files can be attached to messages.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@529 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/boards/_form.rhtml | 8 | ||||
-rw-r--r-- | app/views/boards/edit.rhtml | 6 | ||||
-rw-r--r-- | app/views/boards/index.rhtml | 30 | ||||
-rw-r--r-- | app/views/boards/new.rhtml | 6 | ||||
-rw-r--r-- | app/views/boards/show.rhtml | 36 | ||||
-rw-r--r-- | app/views/layouts/base.rhtml | 2 | ||||
-rw-r--r-- | app/views/messages/_form.rhtml | 17 | ||||
-rw-r--r-- | app/views/messages/new.rhtml | 6 | ||||
-rw-r--r-- | app/views/messages/show.rhtml | 29 | ||||
-rw-r--r-- | app/views/projects/_boards.rhtml | 24 | ||||
-rw-r--r-- | app/views/projects/settings.rhtml | 5 |
11 files changed, 169 insertions, 0 deletions
diff --git a/app/views/boards/_form.rhtml b/app/views/boards/_form.rhtml new file mode 100644 index 000000000..7ede589ab --- /dev/null +++ b/app/views/boards/_form.rhtml @@ -0,0 +1,8 @@ +<%= error_messages_for 'board' %> + +<!--[form:board]--> +<div class="box"> +<p><%= f.text_field :name, :required => true %></p> +<p><%= f.text_field :description, :required => true, :size => 80 %></p> +</div> +<!--[eoform:board]--> diff --git a/app/views/boards/edit.rhtml b/app/views/boards/edit.rhtml new file mode 100644 index 000000000..ba4c8b5ac --- /dev/null +++ b/app/views/boards/edit.rhtml @@ -0,0 +1,6 @@ +<h2><%= l(:label_board) %></h2> + +<% labelled_tabular_form_for :board, @board, :url => {:action => 'edit', :id => @board} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> + <%= submit_tag l(:button_save) %> +<% end %> diff --git a/app/views/boards/index.rhtml b/app/views/boards/index.rhtml new file mode 100644 index 000000000..3291d0194 --- /dev/null +++ b/app/views/boards/index.rhtml @@ -0,0 +1,30 @@ +<h2><%= l(:label_board_plural) %></h2> + +<table class="list"> + <thead><tr> + <th><%= l(:label_board) %></th> + <th><%= l(:label_topic_plural) %></th> + <th><%= l(:label_message_plural) %></th> + <th><%= l(:label_message_last) %></th> + </tr></thead> + <tbody> +<% for board in @boards %> + <tr class="<%= cycle 'odd', 'even' %>"> + <td> + <%= link_to h(board.name), {:action => 'show', :id => board}, :class => "icon22 icon22-comment" %><br /> + <%=h board.description %> + </td> + <td align="center"><%= board.topics_count %></td> + <td align="center"><%= board.messages_count %></td> + <td> + <small> + <% if board.last_message %> + <%= board.last_message.author.name %>, <%= format_time(board.last_message.created_on) %><br /> + <%= link_to_message board.last_message %> + <% end %> + </small> + </td> + </tr> +<% end %> + </tbody> +</table> diff --git a/app/views/boards/new.rhtml b/app/views/boards/new.rhtml new file mode 100644 index 000000000..b89121880 --- /dev/null +++ b/app/views/boards/new.rhtml @@ -0,0 +1,6 @@ +<h2><%= l(:label_board_new) %></h2> + +<% labelled_tabular_form_for :board, @board, :url => {:action => 'new'} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> + <%= submit_tag l(:button_create) %> +<% end %> diff --git a/app/views/boards/show.rhtml b/app/views/boards/show.rhtml new file mode 100644 index 000000000..13a056046 --- /dev/null +++ b/app/views/boards/show.rhtml @@ -0,0 +1,36 @@ +<div class="contextual"> +<%= link_to l(:label_message_new), {:controller => 'messages', :action => 'new', :board_id => @board}, :class => "icon icon-add" %> +</div> + +<h2><%=h @board.name %></h2> + +<table class="list"> + <thead><tr> + <th><%= l(:field_subject) %></th> + <th><%= l(:field_author) %></th> + <%= sort_header_tag("#{Message.table_name}.created_on", :caption => l(:field_created_on)) %> + <th><%= l(:label_reply_plural) %></th> + <%= sort_header_tag("#{Message.table_name}.updated_on", :caption => l(:label_message_last)) %> + </tr></thead> + <tbody> + <% @topics.each do |topic| %> + <tr class="<%= cycle 'odd', 'even' %>"> + <td><%= link_to h(topic.subject), :controller => 'messages', :action => 'show', :board_id => @board, :id => topic %></td> + <td align="center"><%= link_to_user topic.author %></td> + <td align="center"><%= format_time(topic.created_on) %></td> + <td align="center"><%= topic.replies_count %></td> + <td> + <small> + <% if topic.last_reply %> + <%= topic.last_reply.author.name %>, <%= format_time(topic.last_reply.created_on) %><br /> + <%= link_to_message topic.last_reply %> + <% end %> + </small> + </td> + </tr> + <% end %> + </tbody> +</table> + +<p><%= pagination_links_full @topic_pages %> +[ <%= @topic_pages.current.first_item %> - <%= @topic_pages.current.last_item %> / <%= @topic_count %> ]</p> diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index 5d23f6bbc..db9356f7f 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -79,6 +79,7 @@ <%= 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', :project_id => @project }, :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? %> @@ -103,6 +104,7 @@ <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', :project_id => @project)) 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? %> diff --git a/app/views/messages/_form.rhtml b/app/views/messages/_form.rhtml new file mode 100644 index 000000000..453bd8b2a --- /dev/null +++ b/app/views/messages/_form.rhtml @@ -0,0 +1,17 @@ +<%= error_messages_for 'message' %> + +<div class="box"> +<!--[form:message]--> +<p><label><%= l(:field_subject) %></label><br /> +<%= f.text_field :subject, :required => true, :size => 80 %></p> + +<p><%= f.text_area :content, :required => true, :cols => 80, :rows => 15 %></p> +<%= wikitoolbar_for 'message_content' %> +<!--[eoform:message]--> + +<span class="tabular"> +<p id="attachments_p"><label><%=l(:label_attachment)%> +<%= image_to_function "add.png", "addFileField();return false" %></label> +<%= file_field_tag 'attachments[]', :size => 30 %> <em>(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)</em></p> +</span> +</div> diff --git a/app/views/messages/new.rhtml b/app/views/messages/new.rhtml new file mode 100644 index 000000000..5c688f465 --- /dev/null +++ b/app/views/messages/new.rhtml @@ -0,0 +1,6 @@ +<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> » <%= l(:label_message_new) %></h2> + +<% form_for :message, @message, :url => {:action => 'new'}, :html => {:multipart => true} do |f| %> + <%= render :partial => 'form', :locals => {:f => f} %> + <%= submit_tag l(:button_create) %> +<% end %> diff --git a/app/views/messages/show.rhtml b/app/views/messages/show.rhtml new file mode 100644 index 000000000..8f3d83a7e --- /dev/null +++ b/app/views/messages/show.rhtml @@ -0,0 +1,29 @@ +<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> » <%=h @message.subject %></h2> + +<p><em><%= @message.author.name %>, <%= format_time(@message.created_on) %></em></p> +<div class="wiki"> +<%= textilizable(@message.content) %> +</div> +<div class="attachments"> +<% @message.attachments.each do |attachment| %> +<%= link_to attachment.filename, { :action => 'download', :id => @message, :attachment_id => attachment }, :class => 'icon icon-attachment' %> +(<%= number_to_human_size(attachment.filesize) %>)<br /> +<% end %> +</div> +<br /> +<h3 class="icon22 icon22-comment"><%= l(:label_reply_plural) %></h3> +<% @message.children.each do |message| %> + <a name="<%= "message-#{message.id}" %>"></a> + <h4><%=h message.subject %> - <%= message.author.name %>, <%= format_time(message.created_on) %></h4> + <div class="wiki"><p><%= textilizable message.content %></p></div> +<% end %> + +<p><%= toggle_link l(:button_reply), "reply", :focus => "reply_content" %></p> +<div id="reply" style="display:none;"> +<%= error_messages_for 'message' %> +<% form_for :reply, @reply, :url => {:action => 'reply', :id => @message} do |f| %> + <p><%= f.text_field :subject, :required => true, :size => 60 %></p> + <p><%= f.text_area :content, :required => true, :cols => 80, :rows => 10 %></p> + <p><%= submit_tag l(:button_submit) %></p> +<% end %> +</div> diff --git a/app/views/projects/_boards.rhtml b/app/views/projects/_boards.rhtml new file mode 100644 index 000000000..e3f4629c1 --- /dev/null +++ b/app/views/projects/_boards.rhtml @@ -0,0 +1,24 @@ +<table class="list"> + <thead><th><%= l(:label_board) %></th><th><%= l(:field_description) %></th><th style="width:15%"></th><th style="width:15%"></th><th style="width:15%"></th></thead> + <tbody> +<% @project.boards.each do |board| + next if board.new_record? %> + <tr class="<%= cycle 'odd', 'even' %>"> + <td><%=h board.name %></td> + <td><%=h board.description %></td> + <td align="center"> + <% if authorize_for("boards", "edit") %> + <%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %> + <%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> - + <%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %> + <%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %> + <% end %> + </td> + <td align="center"><small><%= link_to_if_authorized l(:button_edit), {:controller => 'boards', :action => 'edit', :project_id => @project, :id => board}, :class => 'icon icon-edit' %></small></td> + <td align="center"><small><%= link_to_if_authorized l(:button_delete), {:controller => 'boards', :action => 'destroy', :project_id => @project, :id => board}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %></small></td> + </tr> +<% end %> + </tbody> +</table> + +<p><%= link_to_if_authorized l(:label_board_new), {:controller => 'boards', :action => 'new', :project_id => @project} %></p> diff --git a/app/views/projects/settings.rhtml b/app/views/projects/settings.rhtml index 3405bfb64..81150dd54 100644 --- a/app/views/projects/settings.rhtml +++ b/app/views/projects/settings.rhtml @@ -6,6 +6,7 @@ <li><%= link_to l(:label_member_plural), {}, :id=> "tab-members", :onclick => "showTab('members'); this.blur(); return false;" %></li> <li><%= link_to l(:label_version_plural), {}, :id=> "tab-versions", :onclick => "showTab('versions'); this.blur(); return false;" %></li> <li><%= link_to l(:label_issue_category_plural), {}, :id=> "tab-categories", :onclick => "showTab('categories'); this.blur(); return false;" %></li> +<li><%= link_to l(:label_board_plural), {}, :id=> "tab-boards", :onclick => "showTab('boards'); this.blur(); return false;" %></li> </ul> </div> @@ -76,5 +77,9 @@ <% end %> </div> +<div id="tab-content-boards" class="tab-content" style="display:none;"> + <%= render :partial => 'boards' %> +</div> + <%= tab = params[:tab] ? h(params[:tab]) : 'info' javascript_tag "showTab('#{tab}');" %>
\ No newline at end of file |