added member feature
This commit is contained in:
parent
e348e3e18f
commit
1c325aa2bc
|
@ -11,8 +11,18 @@ class VideoProsController < ApplicationController
|
||||||
return if snapshot_url.nil?
|
return if snapshot_url.nil?
|
||||||
video_image.view_count += 1
|
video_image.view_count += 1
|
||||||
video_image.inc_count
|
video_image.inc_count
|
||||||
|
members = MemberProfile.find(video_image.other_member_profiles)
|
||||||
|
profiles = []
|
||||||
|
members.each do |member|
|
||||||
|
profiles << {
|
||||||
|
"picture" => member.get_avatar,
|
||||||
|
"name" => member.name,
|
||||||
|
"autobiography" => member.autobiography
|
||||||
|
}
|
||||||
|
end
|
||||||
{
|
{
|
||||||
"video_image" => video_image,
|
"video_image" => video_image,
|
||||||
|
"profiles" => profiles,
|
||||||
"url" => "/#{I18n.locale.to_s}" + OrbitHelper.page.url
|
"url" => "/#{I18n.locale.to_s}" + OrbitHelper.page.url
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,6 +35,7 @@ class VideoImage
|
||||||
field :view_count, type: Integer, default: 0
|
field :view_count, type: Integer, default: 0
|
||||||
field :scale, type: Float
|
field :scale, type: Float
|
||||||
field :details, type: String, localize: true
|
field :details, type: String, localize: true
|
||||||
|
field :other_member_profiles, type: Array, default: []
|
||||||
|
|
||||||
has_and_belongs_to_many :video_tags, inverse_of: :video_images
|
has_and_belongs_to_many :video_tags, inverse_of: :video_images
|
||||||
# LINK_OPEN_TYPES = ["local", "new_window"]
|
# LINK_OPEN_TYPES = ["local", "new_window"]
|
||||||
|
|
|
@ -325,6 +325,12 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group big-group">
|
||||||
|
<label class="control-label muted"><%= t("video_pro.members") %></label>
|
||||||
|
<div class="controls">
|
||||||
|
<%= render partial: 'admin/member_selects/email_selection_box', locals: {field: 'video_image[other_member_profiles][]', email_members: MemberProfile.find(@video_image.other_member_profiles), select_name: "author_members", index: 'author_members', extra_class: 'custom-class'} %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,13 @@
|
||||||
video_tags = video_image.tags
|
video_tags = video_image.tags
|
||||||
video_tags = (video_tags.count > 0 ? video_tags.collect{|tag| {"video_tag" => tag.name}} : [{"video_tag" => video_category}])
|
video_tags = (video_tags.count > 0 ? video_tags.collect{|tag| {"video_tag" => tag.name}} : [{"video_tag" => video_category}])
|
||||||
%>
|
%>
|
||||||
|
<div class="profiles">
|
||||||
|
<% data["profiles"].each do |profile| %>
|
||||||
|
<img src="<%= profile["picture"] %>">
|
||||||
|
<span><%= profile["name"] %></span>
|
||||||
|
<div><%= profile["autobiography"].html_safe %></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
<div class="video_detail">
|
<div class="video_detail">
|
||||||
<h3><%= video_title %></h3>
|
<h3><%= video_title %></h3>
|
||||||
<ul class="hashtags">
|
<ul class="hashtags">
|
||||||
|
|
|
@ -72,4 +72,5 @@ en:
|
||||||
details: Details
|
details: Details
|
||||||
hashtags: Hashtags
|
hashtags: Hashtags
|
||||||
select_or_add: Select or add tags
|
select_or_add: Select or add tags
|
||||||
|
members: Members
|
||||||
video: Video
|
video: Video
|
|
@ -69,4 +69,5 @@ zh_tw:
|
||||||
details: 詳細內容
|
details: 詳細內容
|
||||||
hashtags: Hashtags
|
hashtags: Hashtags
|
||||||
select_or_add: Select or add tags
|
select_or_add: Select or add tags
|
||||||
|
members: Members
|
||||||
video: 影片
|
video: 影片
|
Loading…
Reference in New Issue