hub.html.erb 2.67 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 id="left-tab" class="live content-tab show">

    <h1 class="live">
      <span class="on-air"><%= _("Live") %></span>
    </h1>

    <h1 class="mediation">
      <span class="title"><%= _("Mediation") %></span>
    </h1>

    <div class="envelope">
      <ul id="live-posts"></ul>
  	</div>

    <span><%= check_box_tag 'auto_scrolling', 'yes', true %><%= _("Auto scrolling") %></span>

    <% if logged_in? %>
    <div id="input-panel">
      <div class="form-message">

        <%= 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 => "5", :placeholder => _("Type your message here") %>
          <%= submit_button('add', _('Post'), :onclick => 'new_message(this); return false;') %>
        <% end %>

      </div>
    </div>
    <% end %>

  </div>

  <div id="right-tab" class="mediation content-tab hide">

    <h1 class="live">
      <span class="on-air"><%= _("Live") %></span>
    </h1>

    <h1 class="mediation">
      <span class="title"><%= _("Mediation") %></span>
    </h1>

    <div class="envelope">
      <ul id="mediation-posts"></ul>
    </div>

    <% if logged_in? && mediator?(@page) %>
    <div class="form-mediation">

      <%= 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 %>

    </div>

    <%= render :partial => "community_hub_plugin_public/settings" %>

    <% end %>

  </div>

</div>

<script type="text/javascript">
  DEFAULT_PIN_QUESTION = '<%= _("Are you sure that you want to pin this message?") %>';
  DEFAULT_PROMOTE_QUESTION = '<%= _("Are you sure that you want to promote this user?") %>';
</script>

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