hub.rhtml 2.26 KB
<% extend CommunityHubPlugin::HubHelper %>

<div id="<%=@page.id%>" class="hub">

  <div class="title"><%= @page.title %> HUB</div>

  <div class="description"><%= @page.body %></div>

  <br />

  <div class="live">
    <h1>
      <span class="title"><%= @page.title %></span><span class="on-air"><%= _("Live") %></span>
    </h1>
    <ul id="live-posts">
    </ul>
    <span><%= check_box_tag 'auto_scrolling', 'yes', true %><%= _("Auto scrolling") %></span>
  </div>

  <div class="mediation">
    <h1>
      <span class="title"><%= _("Mediation") %><span class="expand">&#9660;</span></span>
    </h1>
    <ul id="mediation-posts">
    </ul>
  </div>


  <% if logged_in? %>

  <div class="form">

    <% if !mediator?(@page) %>

      <% form_for :message, 
                  :method => 'post',
                  :url => {
                    :controller => 'community_hub_plugin_public', 
                    :action => 'new_message',
                    :article_id => @page.id
                  } do |f| %>
        <span><%= _("Streaming") %></span>
        <br />
        <%= f.text_area :body, :style => "width: 99%;", :cols => "38", :rows => "10", :placeholder => _("Type your message here") %>
        <%= submit_button('add', _('Post'), :onclick => 'new_message(this); return false;') %>
      <% end %>

    <% else %>

      <%= render :file => 'shared/tiny_mce' %>

      <% form_for :article, 
                  :method => 'post',
                  :url => {
                    :controller => 'community_hub_plugin_public', 
                    :action => 'new_mediation', 
                    :profile_id => profile.id 
                  } do |f| %>
        <%= f.hidden_field :parent_id, :value => @page.id %>
        <%= f.text_area :body, :style => "width: 100%;", :class => "mceEditor" %>
        <%= submit_button('add', _('Post'), :onclick => 'new_mediation(this); return false;') %>
      <% end %>

    <% end %>

  </div>

  <% end %>

  <% if mediator?(@page) %>
    <%= render :partial => "community_hub_plugin_public/settings" %>
  <% else %>
    <%= render :partial => "community_hub_plugin_public/banner" %>
    <%= render :partial => "community_hub_plugin_public/embed" %>
  <% end %>

</div>

<%= javascript_include_tag '/plugins/community_hub/javascripts/community_hub.js' %>