FIX conflict
This commit is contained in:
commit
3ae06fc9d4
|
@ -14,8 +14,9 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
def entries
|
def entries
|
||||||
@project.increment!(:visits)
|
@project.increment!(:visits)
|
||||||
|
|
||||||
@ref = params[:branch] || "master"
|
@ref = params[:branch] || "master"
|
||||||
@entries = Gitea::Repository::Entries::ListService.new(@project.owner, @project.identifier, ref:@ref).call
|
@entries = Gitea::Repository::Entries::ListService.new(@project.owner, @project.identifier, ref: @ref).call
|
||||||
@entries = @entries.sort_by{ |hash| hash['type'] }
|
@entries = @entries.sort_by{ |hash| hash['type'] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -38,14 +38,15 @@ class Attachment < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def title
|
def title
|
||||||
title = filename
|
filename
|
||||||
if container && container.is_a?(StudentWork) && author_id != User.current.id
|
# title = filename
|
||||||
course = container&.homework_common&.course
|
# if container && container.is_a?(StudentWork) && author_id != User.current.id
|
||||||
unless User.current.teacher_of_course?(course)
|
# course = container&.homework_common&.course
|
||||||
title = "#{Time.now.strftime('%Y%m%d%H%M%S')}_#{DCODES.sample(8).join}" + File.extname(filename)
|
# unless User.current.teacher_of_course?(course)
|
||||||
end
|
# title = "#{Time.now.strftime('%Y%m%d%H%M%S')}_#{DCODES.sample(8).join}" + File.extname(filename)
|
||||||
end
|
# end
|
||||||
title
|
# end
|
||||||
|
# title
|
||||||
end
|
end
|
||||||
|
|
||||||
def downloads_count
|
def downloads_count
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
json.id journal.id
|
||||||
|
json.user_name journal.user.try(:show_real_name)
|
||||||
|
json.user_login journal.user.try(:login)
|
||||||
|
json.user_picture url_to_avatar(journal.user)
|
||||||
|
json.is_journal_detail journal.is_journal_detail? #判断是否修改了参数而添加的回复内容
|
||||||
|
json.content journal.try(:notes)
|
||||||
|
json.children_journals children_content(journal.id)
|
||||||
|
json.journal_details journal.journal_content
|
||||||
|
json.format_time format_time(journal.created_on)
|
||||||
|
json.created_at time_from_now(journal.created_on)
|
||||||
|
|
||||||
|
json.attachments do
|
||||||
|
json.array! journal.attachments do |attachment|
|
||||||
|
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,2 @@
|
||||||
|
json.extract! @journal, :id,:notes
|
||||||
|
json.issue_id @journal.journalized_id
|
|
@ -0,0 +1,8 @@
|
||||||
|
json.partial! "commons/success"
|
||||||
|
json.limit @limit
|
||||||
|
json.journals_count @journals_size
|
||||||
|
json.issue_journals do
|
||||||
|
json.array! @journals do |journal|
|
||||||
|
json.partial! "journals/journal_item", journal: journal
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue