mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
add: glcc news management and api data
This commit is contained in:
4
app/views/topics/_glcc_news.json.jbuilder
Normal file
4
app/views/topics/_glcc_news.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.(glcc_news, :id, :title, :url, :uuid)
|
||||
request_memo = Forum::Memos::GetService.call(glcc_news&.uuid)
|
||||
json.visits request_memo.nil? ? 0 : request_memo["memo"]["viewed_count"]
|
||||
json.created_time request_memo.nil? ? format_time(Time.now) : request_memo["memo"]["published_time"]
|
||||
@@ -17,6 +17,8 @@ json.topics do
|
||||
json.partial! "excellent_project", locals: {excellent_project: topic}
|
||||
when "Topic::ExperienceForum"
|
||||
json.partial! "experience_forum", locals: {experience_forum: topic}
|
||||
when "Topic::GlccNews"
|
||||
json.partial! "glcc_news", locals: {glcc_news: topic}
|
||||
when "Topic::PinnedForum"
|
||||
json.partial! "pinned_forum", locals: {pinned_forum: topic}
|
||||
else
|
||||
@@ -39,6 +41,8 @@ json.topics do
|
||||
json.partial! "excellent_project", locals: {excellent_project: topic}
|
||||
when "Topic::ExperienceForum"
|
||||
json.partial! "experience_forum", locals: {experience_forum: topic}
|
||||
when "Topic::GlccNews"
|
||||
json.partial! "glcc_news", locals: {glcc_news: topic}
|
||||
when "Topic::PinnedForum"
|
||||
json.partial! "pinned_forum", locals: {pinned_forum: topic}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user