parent
							
								
									cfa5532598
								
							
						
					
					
						commit
						e8de48dd24
					
				@ -0,0 +1,123 @@
 | 
				
			||||
class RelativeMemosController < ApplicationController
 | 
				
			||||
  
 | 
				
			||||
  helper :sort
 | 
				
			||||
  include SortHelper
 | 
				
			||||
  # GET /open_source_projects
 | 
				
			||||
  # GET /open_source_projects.json
 | 
				
			||||
  def index
 | 
				
			||||
    # per_page_option = 10
 | 
				
			||||
# 
 | 
				
			||||
    # @open_source_projects = OpenSourceProject.all
 | 
				
			||||
# 
 | 
				
			||||
    # @os_project_count = @open_source_projects.count
 | 
				
			||||
    # @os_project_pages = Paginator.new @os_project_count, per_page_option, params['page']
 | 
				
			||||
# 
 | 
				
			||||
    # @open_source_projects = OpenSourceProject.all
 | 
				
			||||
# 
 | 
				
			||||
    # respond_to do |format|
 | 
				
			||||
      # format.html # index.html.erb
 | 
				
			||||
      # format.json { render json: @open_source_projects }
 | 
				
			||||
    # end
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  # GET /open_source_projects/1
 | 
				
			||||
  # GET /open_source_projects/1.json
 | 
				
			||||
  def show
 | 
				
			||||
    # @open_source_project = OpenSourceProject.find(params[:id])
 | 
				
			||||
#     
 | 
				
			||||
    # sort_init 'updated_at', 'desc'
 | 
				
			||||
    # sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
 | 
				
			||||
                # 'replies' => "#{RelativeMemo.table_name}.replies_count",
 | 
				
			||||
                # 'updated_at' => "COALESCE (last_replies_relative_memos.created_at, #{RelativeMemo.table_name}.created_at)"
 | 
				
			||||
# 
 | 
				
			||||
    # @memo = RelativeMemo.new(:open_source_project => @open_source_project)
 | 
				
			||||
    # @topic_count = @open_source_project.topics.count
 | 
				
			||||
    # @topic_pages = Paginator.new @topic_count, per_page_option, params['page']
 | 
				
			||||
    # @memos = @open_source_project.topics.
 | 
				
			||||
                    # reorder("#{RelativeMemo.table_name}.sticky DESC").
 | 
				
			||||
                    # includes(:last_reply).
 | 
				
			||||
                    # limit(@topic_pages.per_page).
 | 
				
			||||
                    # offset(@topic_pages.offset).
 | 
				
			||||
                    # order(sort_clause).      
 | 
				
			||||
                    # all
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
    # @offset, @limit = api_offset_and_limit({:limit => 10})
 | 
				
			||||
    # @forum = Forum.find(params[:id])
 | 
				
			||||
    # @memos_all = @forum.topics
 | 
				
			||||
    # @topic_count = @memos_all.count
 | 
				
			||||
    # @topic_pages = Paginator.new @topic_count, @limit, params['page']
 | 
				
			||||
    
 | 
				
			||||
    # @offset ||= @topic_pages.offset
 | 
				
			||||
    # @memos = @memos_all.offset(@offset).limit(@limit).all
 | 
				
			||||
 | 
				
			||||
    # respond_to do |format|
 | 
				
			||||
      # format.html {
 | 
				
			||||
        # render :layout => "base_opensource_p"
 | 
				
			||||
      # }
 | 
				
			||||
      # format.json { render json: @open_source_project }
 | 
				
			||||
    # end
 | 
				
			||||
  end
 | 
				
			||||
  
 | 
				
			||||
 | 
				
			||||
  # GET /open_source_projects/new
 | 
				
			||||
  # GET /open_source_projects/new.json
 | 
				
			||||
  def new
 | 
				
			||||
    @open_source_project = OpenSourceProject.new
 | 
				
			||||
 | 
				
			||||
    respond_to do |format|
 | 
				
			||||
      format.html # new.html.erb
 | 
				
			||||
      format.json { render json: @open_source_project }
 | 
				
			||||
    end
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  # GET /open_source_projects/1/edit
 | 
				
			||||
  def edit
 | 
				
			||||
    @open_source_project = OpenSourceProject.find(params[:id])
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  # POST /open_source_projects
 | 
				
			||||
  # POST /open_source_projects.json
 | 
				
			||||
  def create
 | 
				
			||||
    @open_source_project = OpenSourceProject.new(params[:open_source_project])
 | 
				
			||||
 | 
				
			||||
    respond_to do |format|
 | 
				
			||||
      if @open_source_project.save
 | 
				
			||||
        format.html { redirect_to @open_source_project, notice: 'Open source project was successfully created.'}
 | 
				
			||||
        format.json { render json: @open_source_project, status: :created, location: @open_source_project }
 | 
				
			||||
      else
 | 
				
			||||
        format.html { render action: "new" }
 | 
				
			||||
        format.json { render json: @open_source_project.errors, status: :unprocessable_entity }
 | 
				
			||||
      end
 | 
				
			||||
    end
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  # PUT /open_source_projects/1
 | 
				
			||||
  # PUT /open_source_projects/1.json
 | 
				
			||||
  def update
 | 
				
			||||
    @open_source_project = OpenSourceProject.find(params[:id])
 | 
				
			||||
 | 
				
			||||
    respond_to do |format|
 | 
				
			||||
      if @open_source_project.update_attributes(params[:open_source_project])
 | 
				
			||||
        format.html { redirect_to @open_source_project, notice: 'Open source project was successfully updated.' }
 | 
				
			||||
        format.json { head :no_content }
 | 
				
			||||
      else
 | 
				
			||||
        format.html { render action: "edit" }
 | 
				
			||||
        format.json { render json: @open_source_project.errors, status: :unprocessable_entity }
 | 
				
			||||
      end
 | 
				
			||||
    end
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  # DELETE /open_source_projects/1
 | 
				
			||||
  # DELETE /open_source_projects/1.json
 | 
				
			||||
  def destroy
 | 
				
			||||
    @open_source_project = OpenSourceProject.find(params[:id])
 | 
				
			||||
    @open_source_project.destroy
 | 
				
			||||
 | 
				
			||||
    respond_to do |format|
 | 
				
			||||
      format.html { redirect_to open_source_projects_url }
 | 
				
			||||
      format.json { head :no_content }
 | 
				
			||||
    end
 | 
				
			||||
  end
 | 
				
			||||
end
 | 
				
			||||
@ -1,10 +1,25 @@
 | 
				
			||||
class OpenSourceProject < ActiveRecord::Base
 | 
				
			||||
  attr_accessible :String
 | 
				
			||||
  
 | 
				
			||||
  include Redmine::SafeAttributes
 | 
				
			||||
  has_many :topics, :class_name => 'RelativeMemo', :foreign_key => 'osp_id', :conditions => "#{RelativeMemo.table_name}.parent_id IS NULL", :order => "#{RelativeMemo.table_name}.created_at DESC", :dependent => :destroy
 | 
				
			||||
  has_many :relative_memos, :dependent => :destroy
 | 
				
			||||
  has_many :tags, :through => :project_tags, :class_name => 'Tag'
 | 
				
			||||
  has_many :project_tags, :class_name => 'ProjectTags'
 | 
				
			||||
  acts_as_taggable 
 | 
				
			||||
  def short_description(length = 255)
 | 
				
			||||
    description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
 | 
				
			||||
  end
 | 
				
			||||
  
 | 
				
			||||
  def reset_counters!
 | 
				
			||||
    self.class.reset_counters!(id)
 | 
				
			||||
  end
 | 
				
			||||
  
 | 
				
			||||
  def self.reset_counters!(id)
 | 
				
			||||
    osp_id = id.to_i
 | 
				
			||||
    update_all("topic_count = (SELECT COUNT(*) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id} AND parent_id IS NULL)," +
 | 
				
			||||
     " memo_count = (SELECT COUNT(*) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id} AND parent_id IS NOT NULL)," +
 | 
				
			||||
     " last_memo_id = (SELECT MAX(id) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id})",
 | 
				
			||||
     ["id = ?", osp_id])
 | 
				
			||||
  end 
 | 
				
			||||
end
 | 
				
			||||
 | 
				
			||||
@ -1,3 +1,152 @@
 | 
				
			||||
class RelativeMemo < ActiveRecord::Base
 | 
				
			||||
  # attr_accessible :title, :body
 | 
				
			||||
  include Redmine::SafeAttributes
 | 
				
			||||
  belongs_to :open_source_project, :class_name => "OpenSourceProject", :foreign_key => 'osp_id'
 | 
				
			||||
  belongs_to :author, :class_name => "User", :foreign_key => 'author_id'
 | 
				
			||||
  
 | 
				
			||||
  has_many :tags, :through => :project_tags, :class_name => 'Tag'
 | 
				
			||||
  has_many :project_tags, :class_name => 'ProjectTags'
 | 
				
			||||
  acts_as_taggable 
 | 
				
			||||
 | 
				
			||||
  validates_presence_of :osp_id, :subject
 | 
				
			||||
  #validates :content, presence: true
 | 
				
			||||
  # validates_length_of :subject, maximum: 50
 | 
				
			||||
  #validates_length_of :content, maximum: 3072
 | 
				
			||||
  validate :cannot_reply_to_locked_topic, :on => :create
 | 
				
			||||
 | 
				
			||||
  acts_as_tree :counter_cache => :replies_count, :order => "#{RelativeMemo.table_name}.created_at ASC"
 | 
				
			||||
  acts_as_attachable
 | 
				
			||||
  belongs_to :last_reply, :class_name => 'RelativeMemo', :foreign_key => 'last_reply_id'
 | 
				
			||||
  # acts_as_searchable :column => ['subject', 'content'],
 | 
				
			||||
  #           #:include => { :forum => :p}
 | 
				
			||||
  #           #:project_key => "#{Forum.table_name}.project_id"
 | 
				
			||||
  #           :date_column => "#{table_name}.created_at"
 | 
				
			||||
  
 | 
				
			||||
  # acts_as_event :title => Proc.new {|o| "#{o.forum.name}: #{o.subject}"},
 | 
				
			||||
          # :datetime => :updated_at,
 | 
				
			||||
          # # :datetime => :created_at,
 | 
				
			||||
          # :description => :content,
 | 
				
			||||
          # :author => :author,
 | 
				
			||||
          # :type => Proc.new {|o| o.parent_id.nil? ? 'Memo' : 'Reply'},
 | 
				
			||||
          # :url => Proc.new {|o| {:controller => 'memos', :action => 'show', :forum_id => o.forum_id}.merge(o.parent_id.nil? ? {:id => o.id} : {:id => o.parent_id, :r => o.id, :anchor => "reply-#{o.id}"})}
 | 
				
			||||
  # acts_as_activity_provider :author_key => :author_id,
 | 
				
			||||
                # :func => 'memos',
 | 
				
			||||
                # :timestamp => 'created_at'
 | 
				
			||||
                
 | 
				
			||||
                # :find_options => {:type => 'memos'}
 | 
				
			||||
  # acts_as_watchable
 | 
				
			||||
 | 
				
			||||
  safe_attributes "author_id",
 | 
				
			||||
          "subject",
 | 
				
			||||
          "content",
 | 
				
			||||
          "osp_id",
 | 
				
			||||
          "last_memo_id",
 | 
				
			||||
          "lock",
 | 
				
			||||
          "sticky",
 | 
				
			||||
          "parent_id",
 | 
				
			||||
          "replies_count",
 | 
				
			||||
          "is_quote"
 | 
				
			||||
 | 
				
			||||
  after_create :add_author_as_watcher, :reset_counters!
 | 
				
			||||
  # after_update :update_memos_forum
 | 
				
			||||
  after_destroy :reset_counters!
 | 
				
			||||
  # after_create :send_notification
 | 
				
			||||
  # after_save :plusParentAndForum
 | 
				
			||||
  # after_destroy :minusParentAndForum
 | 
				
			||||
 | 
				
			||||
  # scope :visible, lambda { |*args|
 | 
				
			||||
  #   includes(:forum => ).where()
 | 
				
			||||
  # }
 | 
				
			||||
 | 
				
			||||
  def cannot_reply_to_locked_topic
 | 
				
			||||
    errors.add :base, l(:label_memo_locked) if root.locked? && self != root
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  # def update_memos_forum
 | 
				
			||||
  #   if forum_id_changed?
 | 
				
			||||
  #     Message.update_all({:board_id => board_id}, ["id = ? OR parent_id = ?", root.id, root.id ])
 | 
				
			||||
  #     Forum.reset_counters!(forum_id_was)
 | 
				
			||||
  #     Forum.reset_counters!(forum_id)
 | 
				
			||||
  #   end
 | 
				
			||||
  # end
 | 
				
			||||
 | 
				
			||||
  def reset_counters!
 | 
				
			||||
    if parent && parent.id
 | 
				
			||||
      RelativeMemo.update_all({:last_reply_id => parent.children.maximum(:id)}, {:id => parent.id})
 | 
				
			||||
      parent.update_attribute(:updated_at, Time.now)
 | 
				
			||||
    end
 | 
				
			||||
    forum.reset_counters!
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  def sticky?
 | 
				
			||||
    sticky == 1
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  def replies
 | 
				
			||||
    RelativeMemo.where("parent_id = ?", id)
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  def locked?
 | 
				
			||||
    self.lock
 | 
				
			||||
  end
 | 
				
			||||
  
 | 
				
			||||
  def editable_by? user
 | 
				
			||||
    # user && user.logged? || (self.author == usr && usr.allowed_to?(:edit_own_messages, project))
 | 
				
			||||
    user.admin?
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  # def destroyable_by? user
 | 
				
			||||
    # (user && user.logged? && (Forum.find(self.forum_id).creator_id == user.id) ) || user.admin?
 | 
				
			||||
    # #self.author == user || user.admin?
 | 
				
			||||
  # end
 | 
				
			||||
 | 
				
			||||
  def deleted_attach_able_by? user
 | 
				
			||||
    (user && user.logged? && (self.author == user) ) || user.admin?
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  private
 | 
				
			||||
 | 
				
			||||
  def add_author_as_watcher
 | 
				
			||||
    Watcher.create(:watchable => self.root, :user => author)
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  def send_notification
 | 
				
			||||
    if Setting.notified_events.include?('message_posted')
 | 
				
			||||
      Mailer.message_posted(self).deliver
 | 
				
			||||
    end
 | 
				
			||||
  end
 | 
				
			||||
 | 
				
			||||
  # def plusParentAndForum
 | 
				
			||||
    # @forum = Forum.find(self.forum_id)
 | 
				
			||||
    # @forum.memo_count = @forum.memo_count.to_int + 1
 | 
				
			||||
    # @forum.last_memo_id = self.id
 | 
				
			||||
    # if self.parent_id
 | 
				
			||||
      # @parent_memo = Memo.find_by_id(self.parent_id)
 | 
				
			||||
      # @parent_memo.last_reply_id = self
 | 
				
			||||
      # @parent_memo.replies_count = @parent_memo.replies_count.to_int + 1
 | 
				
			||||
      # @parent_memo.save
 | 
				
			||||
    # else
 | 
				
			||||
      # @forum.topic_count = @forum.topic_count.to_int + 1
 | 
				
			||||
    # end
 | 
				
			||||
    # @forum.save
 | 
				
			||||
  # end
 | 
				
			||||
 | 
				
			||||
  # def minusParentAndForum
 | 
				
			||||
    # @forum = Forum.find(self.forum_id)
 | 
				
			||||
    # @forum.memo_count = @forum.memo_count.to_int - 1
 | 
				
			||||
    # @forum.memo_count = 0 if @forum.memo_count.to_int < 0
 | 
				
			||||
    # # @forum.last_memo_id = Memo.reorder('created_at ASC').find_all_by_forum_id(self.forum_id).last.id
 | 
				
			||||
    # if self.parent_id
 | 
				
			||||
      # @parent_memo = Memo.find_by_id(self.parent_id)
 | 
				
			||||
      # # @parent_memo.last_reply_id = Memo.reorder('created_at ASC').find_all_by_parent_id(self.parent_id).last.id
 | 
				
			||||
      # @parent_memo.replies_count = @parent_memo.replies_count.to_int - 1
 | 
				
			||||
      # @parent_memo.replies_count = 0 if @parent_memo.replies_count.to_int < 0
 | 
				
			||||
      # @parent_memo.save
 | 
				
			||||
    # else
 | 
				
			||||
      # @forum.topic_count = @forum.topic_count.to_int - 1
 | 
				
			||||
      # @forum.topic_count = 0 if @forum.topic_count.to_int < 0
 | 
				
			||||
    # end
 | 
				
			||||
    # @forum.save
 | 
				
			||||
  # end
 | 
				
			||||
end
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
@ -0,0 +1,57 @@
 | 
				
			||||
<!-- added by fq -->
 | 
				
			||||
<!--display the board-->
 | 
				
			||||
<div class="borad-topic-count">
 | 
				
			||||
	共有 <%= link_to memos.count %> 个贴子
 | 
				
			||||
</div>
 | 
				
			||||
<div style="padding-top: 10px">
 | 
				
			||||
	<% if memos.any? %>
 | 
				
			||||
	<% memos.each do |topic| %>
 | 
				
			||||
	<table class="content-text-list">
 | 
				
			||||
		<tr>
 | 
				
			||||
			<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) if topic.author%></td>
 | 
				
			||||
			<td>
 | 
				
			||||
			<table width="630px" border="0">
 | 
				
			||||
				<tr>
 | 
				
			||||
					<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), open_source_project_relative_memo_path(topic.open_source_project, topic) %></td>
 | 
				
			||||
					<td align="right" rowspan="3">
 | 
				
			||||
					<table class="borad-count">
 | 
				
			||||
						<tr>
 | 
				
			||||
							<td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), forum_memo_path(topic.open_source_project, topic) %></td>
 | 
				
			||||
						</tr>
 | 
				
			||||
						<tr>
 | 
				
			||||
							<td align="center">回答</td>
 | 
				
			||||
						</tr>
 | 
				
			||||
					</table></td>
 | 
				
			||||
				</tr>
 | 
				
			||||
				<tr>
 | 
				
			||||
					<td colspan="2" ><span class="font_description"> </span></td>
 | 
				
			||||
				</tr>
 | 
				
			||||
				<tr>
 | 
				
			||||
					<td align="left" colspan="2" ><span class="font_lighter"><%#= authoring topic.created_at, topic.author %>
 | 
				
			||||
						<br />
 | 
				
			||||
					</span></td>
 | 
				
			||||
				</tr>
 | 
				
			||||
				<tr>
 | 
				
			||||
					<td align="left" colspan="2" ><span class="font_lighter"><%= @open_source_project.url%> </span></td>
 | 
				
			||||
				</tr>
 | 
				
			||||
				<tr><td align="left" colspan="2">
 | 
				
			||||
				<%= image_tag( "/images/sidebar/tags.png") %>
 | 
				
			||||
				<%= render :partial => 'tags/tag_name', :locals => {:obj => topic,:object_flag => "9",:non_list_all => true }%>
 | 
				
			||||
	
 | 
				
			||||
					</td></tr>
 | 
				
			||||
				
 | 
				
			||||
			</table></td>
 | 
				
			||||
		</tr>
 | 
				
			||||
		
 | 
				
			||||
	</table>
 | 
				
			||||
	
 | 
				
			||||
	<% end %>
 | 
				
			||||
	<div class="pagination">
 | 
				
			||||
		<%#= pagination_links_full @topic_pages, @topic_count %>
 | 
				
			||||
	</div>
 | 
				
			||||
	<% else %>
 | 
				
			||||
	<p class="nodata">
 | 
				
			||||
		<%= l(:label_no_data) %>
 | 
				
			||||
	</p>
 | 
				
			||||
	<% end %>
 | 
				
			||||
</div>
 | 
				
			||||
@ -1,10 +1,54 @@
 | 
				
			||||
<p id="notice"><%= notice %></p>
 | 
				
			||||
<!-- added by fq -->
 | 
				
			||||
<div id="add-memo" class='lz' style="display: none; padding: 20px;">
 | 
				
			||||
	<h3><%=l(:label_memo_new)%></h3>
 | 
				
			||||
	<% if User.current.logged? %>
 | 
				
			||||
	<%= labelled_form_for(@memo, :url => forum_memos_path(@forum), :html => {:multipart => true} ) do |f|  %>
 | 
				
			||||
	<% if @memo.errors.any? %>
 | 
				
			||||
		<div id="error_explanation">
 | 
				
			||||
			<h2><%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:</h2>
 | 
				
			||||
 | 
				
			||||
<p>
 | 
				
			||||
  <b>String:</b>
 | 
				
			||||
  <%= @open_source_project.name %>
 | 
				
			||||
</p>
 | 
				
			||||
			<ul>
 | 
				
			||||
				<% @memo.errors.full_messages.each do |msg| %>
 | 
				
			||||
				<li><%= msg %></li>
 | 
				
			||||
				<% end %>
 | 
				
			||||
			</ul>
 | 
				
			||||
		</div>
 | 
				
			||||
	<% end %>
 | 
				
			||||
	<div class="actions" style="max-width:680px">
 | 
				
			||||
		<p><%= f.text_field :subject, :required => true%></p>
 | 
				
			||||
		<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor02' %></p>
 | 
				
			||||
		<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script>
 | 
				
			||||
		<br/>
 | 
				
			||||
		<p>             
 | 
				
			||||
			<%= l(:label_attachment_plural) %><br />
 | 
				
			||||
			<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
 | 
				
			||||
		</p>
 | 
				
			||||
		<%= f.submit :value => l(:label_memo_create) %>
 | 
				
			||||
		<%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>
 | 
				
			||||
	</div>
 | 
				
			||||
	<% end %>
 | 
				
			||||
<% end %>
 | 
				
			||||
</div>
 | 
				
			||||
<!--modified by huang-->
 | 
				
			||||
<% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %>
 | 
				
			||||
<span>
 | 
				
			||||
	<%= link_to l(:label_memo_new_from_forum), new_forum_memo_path(@forum), :class => 'icon icon-add',
 | 
				
			||||
            :onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
 | 
				
			||||
</span>
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
<%= link_to 'Edit', edit_open_source_project_path(@open_source_project) %> |
 | 
				
			||||
<%= link_to 'Back', open_source_projects_path %>
 | 
				
			||||
<div class="contextual-borad">
 | 
				
			||||
	<%#= link_to(
 | 
				
			||||
		image_tag('edit.png')+l(:label_forum_edit),
 | 
				
			||||
		{:action => 'edit', :id => @forum},
 | 
				
			||||
		:method => 'get',
 | 
				
			||||
		:title => l(:button_edit)
 | 
				
			||||
		) if @forum.editable_by?(User.current) %>
 | 
				
			||||
	<%#= link_to(
 | 
				
			||||
		image_tag('delete.png')+'删除讨论区',
 | 
				
			||||
		{:action => 'destroy', :id => @forum},
 | 
				
			||||
		:method => :delete,
 | 
				
			||||
		:data => {:confirm => l(:text_are_you_sure)},
 | 
				
			||||
		:title => l(:button_delete)
 | 
				
			||||
		) if @forum.destroyable_by?(User.current) %>
 | 
				
			||||
</div>
 | 
				
			||||
<%= render :partial => 'open_source_projects/show_topics', :locals => {:memos => @memos} %>
 | 
				
			||||
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue