Fixed channel open projects count
This commit is contained in:
parent
a9c4b29935
commit
0d854b026a
@ -16,7 +16,7 @@ class Channel < Sequel::Model
|
||||
end
|
||||
|
||||
def openProjects()
|
||||
return 0
|
||||
return self.videos_dataset.exclude(status: 'published').exclude(archived: true).all()
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -20,7 +20,7 @@
|
||||
<p><span><%= channel.directory_path %></span></p>
|
||||
</div>
|
||||
<div class="channel-open">
|
||||
<p>Open projects: <span><%= channel.openProjects() %></span></p>
|
||||
<p>Open projects: <span><%= channel.openProjects().length %></span></p>
|
||||
</div>
|
||||
<div class="channel-videos">
|
||||
<p>Total videos: <span><%= channel.videos.length %></span></p>
|
||||
|
@ -42,7 +42,7 @@
|
||||
<% channels.each do |c| %>
|
||||
<tr>
|
||||
<td><a href="/channel/<%= c.id %>"><%= c.name %></a></td>
|
||||
<td><%= nullable(c.openProjects) %></td>
|
||||
<td><%= nullable(c.openProjects().length) %></td>
|
||||
<td><%= nullable(c.videos.length) %></td>
|
||||
<td><%= date_format(c.updated_at) %></td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user