<% content_for :content_title, @blog.title %> <% content_for :content_subtitle, 'Permalink: '.html_safe + link_to(blog_show_url(@blog), blog_show_url(@blog), title: 'Permalink for this blog', target: '_blank') %> <% content_for :content_title_extra do %> <%= page_header_buttons do %> <%= present(@blog).label_published %> <%= link_to icon_label(:view, 'View'), blog_show_url(@blog), class: "btn btn-xs btn-default", title: 'View', target: '_blank' %> <%= link_to(icon_label(:edit, 'Edit'), [:edit, :admin, @blog], class: "btn btn-xs btn-default", title: 'Edit') %> <% if can?(:manage_content, :all) %>
<% end %> <% end %> <% end %>
<% toolbar = toolbar_btn(icons('icon-plus'), new_admin_cms_blog_cms_post_path(@blog), title: 'New Post', class: "btn btn-link btn-icon") %> <%= panel title: 'Posts', toolbar: toolbar, body: false do %> <% @blog.posts.each do |post| %> <% present post do |post_presenter| %> <% end %> <% end %>
Title <%= icons('icon-envelop') %> Status
<%= link_to(post.title, edit_admin_cms_blog_cms_post_path(@blog, post)) %> <% if post.notification_sent_on %> <%= icons('icon-envelop') %> <% end %> <%= post_presenter.label_published %>
<% end %>
<% if @blog.is_subscription_only? %> <%= subsection title: 'Visibility: Subscription'.html_safe do %>

Only paid subscribers can see the posts, and will receive notification emails.

<% end %> <% elsif @blog.is_private? %> <%= subsection title: 'Visibility: Private'.html_safe do %>

Only users who have been given access (manually or through an associated event) can see posts in this blog, and will receive notification emails.

<% end %> <% elsif @blog.is_public? %> <%= subsection title: 'Visibility: Public'.html_safe do %>

All posts are available publicly for anyone to see. Logged in users can 'Follow' the blog to receive notification emails.

<% end %> <% elsif @blog.is_protected? %> <%= subsection title: 'Visibility: Protected'.html_safe do %>

Only logged in users can see the posts. Logged in users can 'Follow' the blog to receive notification emails.

<% end %> <% end %> <%= subsection title: 'Attributes' do %> <% if @blog.is_private? %> <% else %> <% end %>
Members <%= @blog.member_count(:all) %>Followers <%= @blog.followers.count %>
Commenting? disabled="disabled" />
Social Buttons? disabled="disabled" />
<% end %>
<% if @blog.owner %>
<% toolbar = toolbar_btn(@blog.member_count(:automatic), '#', title: 'Number of users with automatic blog access', class: 'label label-success pull-right') %> <%= panel title: 'Users with Automatic Access', toolbar: toolbar do %>
Automatic Access Granted for Event

<%= @blog.owner.title %>

<% end %>
<% end %> <% if @blog.is_private? %>
<% toolbar = toolbar_btn(@blog.member_count(:manual), '#', title: 'Number of users with blog access', class: 'label label-success pull-right') %> <%= panel title: 'Users with Manual Access', toolbar: toolbar do %>
<% @blog.member_list(:manual).each do |user| %> <% end %>
Name Country
<%= link_to(icons("icon-minus"), dm_cms.blog_delete_member_admin_cms_blog_path(@blog, user_id: user.id), method: :delete, title: 'Remove Access') + "  ".html_safe + user.full_name %> <%= user.country.english_name %>
<%= subsection title: 'Add Individual Users' do %>
Name Country
<% end %>
<% end %>
<% end %> <% unless @blog.is_private? %>
<% toolbar = toolbar_btn(@blog.followers.count, '#', title: 'Number of users following this blog', class: 'label label-success pull-right') %> <%= panel title: 'Users Following this Blog', toolbar: toolbar, body: false do %> <% @blog.followers.each do |follower| %> <% end %>
Name Country
<%= follower.user.full_name %> <%= follower.user.try(:country).try(:english_name) %>
<% end %>
<% end %>