forked from Gitlink/forgeplus
修改前端问题及同步gitea的url到forge
This commit is contained in:
parent
036718356d
commit
b8946d980a
|
@ -35,12 +35,14 @@ module TagChosenHelper
|
|||
project_members = project.members_user_infos
|
||||
project_members_info = [] #指派给
|
||||
project_members.each do |member|
|
||||
user = member.user
|
||||
real_name = user.try(:show_real_name)
|
||||
user_id = user.id
|
||||
is_chosen = ((user.id.to_s == issue_info[0].to_s) ? "1" : "0")
|
||||
member_info = {id: user_id, name: real_name,avatar_url: url_to_avatar(user),is_chosen: is_chosen}
|
||||
project_members_info.push(member_info)
|
||||
user = member&.user
|
||||
if user
|
||||
real_name = user.try(:show_real_name)
|
||||
user_id = user.id
|
||||
is_chosen = ((user.id.to_s == issue_info[0].to_s) ? "1" : "0")
|
||||
member_info = {id: user_id, name: real_name,avatar_url: url_to_avatar(user),is_chosen: is_chosen}
|
||||
project_members_info.push(member_info)
|
||||
end
|
||||
end
|
||||
|
||||
tracker_info = Tracker&.pluck(:id, :name, :position)
|
||||
|
|
|
@ -4,9 +4,9 @@ json.project_id @project.id
|
|||
json.issues_count @project.issues_count
|
||||
json.pull_requests_count @project.pull_requests_count
|
||||
json.project_identifier @project.identifier
|
||||
json.praises_count @project.praises_count
|
||||
json.forked_count @project.forked_count
|
||||
json.watchers_count @project.watchers_count
|
||||
json.praises_count @project.praises_count.to_i
|
||||
json.forked_count @project.forked_count.to_i
|
||||
json.watchers_count @project.watchers_count.to_i
|
||||
json.branches_count @branches_count
|
||||
json.commits_count @commits_count
|
||||
json.permission render_edit_project_permission(current_user, @project) if current_user
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
# 执行示例 bundle exec rake sync_forge_gitea:created_repo
|
||||
# 线上环境执行示例 RAILS_ENV=production bundle exec rake sync_forge_gitea:created_repo
|
||||
|
||||
namespace :sync_forge_gitea do
|
||||
desc "if gitea .git file not present ,and create new .git file"
|
||||
|
||||
task created_repo: :environment do
|
||||
puts "__________begin_to_create_repository_git___________"
|
||||
all_repositories = Repository.select(:id,:identifier, :user_id,:hidden,:project_id,:url).includes(project: :owner)
|
||||
all_repositories.find_each do |r|
|
||||
project = r.project
|
||||
user = project.owner
|
||||
unless r.url.to_s.include?("http://gitea.trustie.net")
|
||||
if user && user.try(:gitea_token).present?
|
||||
repo_status = Gitea::Repository::GetService.new(user, r.identifier).call
|
||||
if repo_status.present?
|
||||
r.update_attribute(:url, repo_status["clone_url"])
|
||||
project.update_attributes(gpid: repo_status["id"],identifier: r.identifier)
|
||||
else
|
||||
ActiveRecord::Base.transaction do
|
||||
repository_params= {
|
||||
name: r.identifier,
|
||||
auto_init: true,
|
||||
private: r.hidden,
|
||||
}
|
||||
begin
|
||||
gitea_repository = Gitea::Repository::CreateService.new(user.gitea_token, repository_params).call
|
||||
r.update_attribute(:url, gitea_repository["clone_url"])
|
||||
project.update_attributes(gpid: repo_status["id"],identifier: r.identifier)
|
||||
puts "__________after_create_gitea_repository_____#{gitea_repository}______"
|
||||
rescue => e
|
||||
puts "_________create_gitea_git________file______error: #{e}"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
puts "__________end_to_create_repository_git___________"
|
||||
end
|
||||
|
||||
end
|
|
@ -21,7 +21,7 @@
|
|||
"./static/js/115.16bc2b0d.chunk.js": "./static/js/115.16bc2b0d.chunk.js",
|
||||
"./static/js/116.acb34db4.chunk.js": "./static/js/116.acb34db4.chunk.js",
|
||||
"./static/js/117.c12032ae.chunk.js": "./static/js/117.c12032ae.chunk.js",
|
||||
"./static/js/118.42e9cacb.chunk.js": "./static/js/118.42e9cacb.chunk.js",
|
||||
"./static/js/118.93fadc11.chunk.js": "./static/js/118.93fadc11.chunk.js",
|
||||
"./static/js/119.09fe7ab0.chunk.js": "./static/js/119.09fe7ab0.chunk.js",
|
||||
"./static/js/12.c388554b.chunk.js": "./static/js/12.c388554b.chunk.js",
|
||||
"./static/js/120.712692c0.chunk.js": "./static/js/120.712692c0.chunk.js",
|
||||
|
@ -103,7 +103,7 @@
|
|||
"./static/js/19.e9122038.chunk.js": "./static/js/19.e9122038.chunk.js",
|
||||
"./static/js/190.a972b289.chunk.js": "./static/js/190.a972b289.chunk.js",
|
||||
"./static/js/191.91c8d4dd.chunk.js": "./static/js/191.91c8d4dd.chunk.js",
|
||||
"./static/js/192.0fb23f65.chunk.js": "./static/js/192.0fb23f65.chunk.js",
|
||||
"./static/js/192.a9a5fe27.chunk.js": "./static/js/192.a9a5fe27.chunk.js",
|
||||
"./static/js/193.2db797e4.chunk.js": "./static/js/193.2db797e4.chunk.js",
|
||||
"./static/js/194.570ec7dc.chunk.js": "./static/js/194.570ec7dc.chunk.js",
|
||||
"./static/js/195.8bafb8cc.chunk.js": "./static/js/195.8bafb8cc.chunk.js",
|
||||
|
@ -112,7 +112,7 @@
|
|||
"./static/js/198.59eec2cd.chunk.js": "./static/js/198.59eec2cd.chunk.js",
|
||||
"./static/js/199.f7a6cf5d.chunk.js": "./static/js/199.f7a6cf5d.chunk.js",
|
||||
"./static/js/2.2225a575.chunk.js": "./static/js/2.2225a575.chunk.js",
|
||||
"./static/js/20.a502089c.chunk.js": "./static/js/20.a502089c.chunk.js",
|
||||
"./static/js/20.ea1b83ca.chunk.js": "./static/js/20.ea1b83ca.chunk.js",
|
||||
"./static/js/200.64c98b62.chunk.js": "./static/js/200.64c98b62.chunk.js",
|
||||
"./static/js/201.4dcc10b4.chunk.js": "./static/js/201.4dcc10b4.chunk.js",
|
||||
"./static/js/202.4e8c6091.chunk.js": "./static/js/202.4e8c6091.chunk.js",
|
||||
|
@ -123,7 +123,7 @@
|
|||
"./static/js/207.147ba6db.chunk.js": "./static/js/207.147ba6db.chunk.js",
|
||||
"./static/js/208.25081b68.chunk.js": "./static/js/208.25081b68.chunk.js",
|
||||
"./static/js/209.784c19f9.chunk.js": "./static/js/209.784c19f9.chunk.js",
|
||||
"./static/js/21.d6024c00.chunk.js": "./static/js/21.d6024c00.chunk.js",
|
||||
"./static/js/21.66ea1441.chunk.js": "./static/js/21.66ea1441.chunk.js",
|
||||
"./static/js/210.ebc5386b.chunk.js": "./static/js/210.ebc5386b.chunk.js",
|
||||
"./static/js/211.ca304f55.chunk.js": "./static/js/211.ca304f55.chunk.js",
|
||||
"./static/js/212.b5fc6346.chunk.js": "./static/js/212.b5fc6346.chunk.js",
|
||||
|
@ -145,7 +145,7 @@
|
|||
"./static/js/227.fded1c54.chunk.js": "./static/js/227.fded1c54.chunk.js",
|
||||
"./static/js/228.081121a3.chunk.js": "./static/js/228.081121a3.chunk.js",
|
||||
"./static/js/229.fbecdb8f.chunk.js": "./static/js/229.fbecdb8f.chunk.js",
|
||||
"./static/js/23.6c790311.chunk.js": "./static/js/23.6c790311.chunk.js",
|
||||
"./static/js/23.f3d3a190.chunk.js": "./static/js/23.f3d3a190.chunk.js",
|
||||
"./static/js/230.54214923.chunk.js": "./static/js/230.54214923.chunk.js",
|
||||
"./static/js/231.78c978ac.chunk.js": "./static/js/231.78c978ac.chunk.js",
|
||||
"./static/js/232.65715f0f.chunk.js": "./static/js/232.65715f0f.chunk.js",
|
||||
|
@ -200,7 +200,7 @@
|
|||
"./static/js/277.8ad1fd18.chunk.js": "./static/js/277.8ad1fd18.chunk.js",
|
||||
"./static/js/278.82ce41b4.chunk.js": "./static/js/278.82ce41b4.chunk.js",
|
||||
"./static/js/279.92f86639.chunk.js": "./static/js/279.92f86639.chunk.js",
|
||||
"./static/js/28.34dfbdd6.chunk.js": "./static/js/28.34dfbdd6.chunk.js",
|
||||
"./static/js/28.3836fc1f.chunk.js": "./static/js/28.3836fc1f.chunk.js",
|
||||
"./static/js/280.d787fd18.chunk.js": "./static/js/280.d787fd18.chunk.js",
|
||||
"./static/js/281.8bdfd9de.chunk.js": "./static/js/281.8bdfd9de.chunk.js",
|
||||
"./static/js/282.2f9ff948.chunk.js": "./static/js/282.2f9ff948.chunk.js",
|
||||
|
@ -284,7 +284,7 @@
|
|||
"./static/js/98.a08b024b.chunk.js": "./static/js/98.a08b024b.chunk.js",
|
||||
"./static/js/99.07307f5a.chunk.js": "./static/js/99.07307f5a.chunk.js",
|
||||
"main.css": "./static/css/main.fd229636.css",
|
||||
"main.js": "./static/js/main.5a200b9c.js",
|
||||
"main.js": "./static/js/main.f54f2fb3.js",
|
||||
"static/media/KaTeX_AMS-Regular.ttf": "static/media/KaTeX_AMS-Regular.aaf4eee9.ttf",
|
||||
"static/media/KaTeX_AMS-Regular.woff": "static/media/KaTeX_AMS-Regular.7f06b4e3.woff",
|
||||
"static/media/KaTeX_AMS-Regular.woff2": "static/media/KaTeX_AMS-Regular.e78e28b4.woff2",
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
_host = 'https://ali-cdn.educoder.net/react/build/'
|
||||
}
|
||||
document.write('<script type="text/javascript" src="' + _host + 'js/js_min_all.js"><\/script>');
|
||||
document.write('<script type="text/javascript" src="' + _host + 'static/js/main.5a200b9c.js"><\/script>');
|
||||
document.write('<script type="text/javascript" src="' + _host + 'static/js/main.f54f2fb3.js"><\/script>');
|
||||
})()
|
||||
</script>
|
||||
<script>!function(){var t=location.href;"3007"===window.location.port?-1!=t.indexOf("/tasks/")?(document.write('<script type="text/javascript" src="https://newweb.educoder.net/assets/kindeditor/kindeditor.js"><\/script>'),document.write('<script type="text/javascript" src="/react/build/js/create_kindeditor.js?v=1.1.1"><\/script>'),document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>')):-1!=t.indexOf("/paths/")&&document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>'):-1!=t.indexOf("/tasks/")?(document.write('<script type="text/javascript" src="/assets/kindeditor/kindeditor.js"><\/script>'),document.write('<script type="text/javascript" src="/react/build/js/create_kindeditor.js?v=1.1.1"><\/script>'),document.write('<script type="text/javascript" src="/javascripts/educoder/edu_application.js"><\/script>')):-1!=t.indexOf("/paths/")&&document.write('<script type="text/javascript" src="/javascripts/educoder/edu_application.js"><\/script>')}()</script><script type="text/javascript" src="https://cdn.bootcss.com/quill/1.3.7/quill.core.min.js"></script></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue