Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
j_platform / app / views / layouts / social_post / _form.html.erb
Size: Mime:
<%# Please note: this only works really well on http://j-mkt-portal.dev/me and http://j-mkt-portal.dev/tickets/#%>
<%# On other pages, the CSS seems to be kind of broken #%>
<% i18n_scope_social_post = "social_post" %>
<% j_post_path = post.present? ? j_platform.project_post_path(current_project, post) : j_platform.project_posts_path(current_project) %>
<% j_buffer_path = j_platform.buffer_accounts_buffer_message_path %>
<% scheduled = post.present? && !!post.scheduled_time %>
<% scheduled_with_privacy = scheduled && !post.privacy_settings.blank? %>

<% selected_account = Hash.new(false) %>
<% (post.social_accounts.each {|sa| selected_account[sa.id] = true }) if post.present? %>


<%= simple_form_for :j_post, html: {id: "j_post"} do |f| %>
  <div class="form-content">
    <section class="j-post-main-body">
      <section class="j-post-account-selection">
        <label class="no-margin"><%= t('publish_to', scope: i18n_scope_social_post) %></label>
        <select data-placeholder="<%= t('select_account', scope: i18n_scope_social_post) %>" multiple class="social-post-account-select">
          <option value="select-all" data-class="AllAccounts" class="select-all"><%= t("common.select_all") %></option>
          <% project.post_social_accounts.each do |sa| %>
            <option value="<%= sa.id %>" data-class="<%= sa_css_class(sa) %>" class="<%= sa_css_class(sa) %>" <%= 'selected="selected"' if selected_account[sa.id] %>>
              <%= sa.to_s %>
            </option>
          <% end %>
        </select>
      </section>

      <label><%= t('post', scope: i18n_scope_social_post) %></label>
      <%= f.input :message, as: :text, required: true, label:false, placeholder: t("compose_message", scope: i18n_scope_social_post), input_html: {class: 'j-post-message-textarea counter-textarea', rows: 5, value: post.present? ? post.message_preview : "" } %>

      <section class="j-post-privacy-pane" style="<%= 'display: block;' if scheduled_with_privacy %>">
        <label class="no-margin"><i class="icon-lock svg-fill"></i><%= t('privacy_options', scope: i18n_scope_social_post) %></label>
        <div class="options">
          <% if scheduled_with_privacy %>
            <% post.privacy_settings.each do |sa, privacy| %>
              <div class="privacyOptionSelect linkedin">
                <div class="account-name">
                  <i></i><span class="name"><%= sa.name %></span>
                </div>
                <select data-account-id="<%= sa.id %>" class="privacy-list-select">
                  <option value='anyone' <%= "selected='selected'" if privacy["code"] == "anyone" %>>Public (Default)</option>
                  <option value='connections-only' <%= "selected='selected'" if privacy["code"] == "connections-only" %>>Connections</option>
                </select>
              </div>
            <% end %>
          <% end %>
        </div>
      </section>

      <%# Grab a schedule helper. This is in date_time_helper.rb %>
      <% schedule = get_schedule_opts(post) %>

      <%# The post scheduling section %>
      <section class="j-post-schedule-pane" style="<%= 'display: block;' if scheduled %>" data-current_utc="<%= schedule['current_utc_unix'] %>">
        <label class="no-margin label-schedule-post">
          <i class="icon-clock"></i><%= t('schedule_for', scope: i18n_scope_social_post) %>
        </label>
        <div class="time-inputs">
          <%# Calendar (Date picker) %>
          <%= f.input :date, required: false, label: false, input_html: { class: "j-post-schedule-date-select date-picker", "data-startdate" => schedule['start_formatted'], value: schedule['selected_formatted'] } %>

          <%# Hour (Time Picker) %>
          <%= f.input :time, required: false, label: false, input_html: { class: "j-post-schedule-time-select time-select", value: schedule['next_window'], "data-mintime" => schedule['next_window'] } %>
        </div>

        <%# Output our modified timezone selector (with options) %>
        <%= f.input :time_zone, collection: get_timezone_list(schedule['time_zone']), required: false, label: false, label_method: :first, value_method: :second, input_html: { class: "j-post-time-zone no-chosen" }%>

        <div class="footer">
          <%#= f.input :email_notification, as: :boolean, wrapper: :bootstrap_boolean, label: (t 'social_post.email_confirmation') %>
          <%= link_to t("show_scheduled_posts", scope: i18n_scope_social_post), "#", class: "btn-show-scheduled-posts", data: {index_path: j_platform.scheduled_items_groups_path} %>
        </div>
      </section>
    </section>

    <section class="j-post-scheduled-posts">
      <section class="schedule-container" data-target="<%= j_platform.scheduled_items_groups_path %>">
      </section>
    </section>
  </div>

  <section class="custom-modal-footer">
    <div class="uploaders">
      <%= render partial: "j_platform/tickets/uploader" %>
      <div class="btn-toggle-privacy-pane <%= 'selected' if scheduled_with_privacy %> tool-tip" data-placement="top" data-original-title="<%= t('social_post.privacy') %>"><i class="svg-fill"></i><span class="label-jpost-options-pane-toggle"><%= scheduled_with_privacy ? "On" : "Off" %></span></div>
      <div class="btn-toggle-schedule-pane <%= 'selected' if scheduled %> tool-tip" data-placement="top" data-original-title="<%= t('schedule.schedule') %>"><i class="svg-fill"></i><span class="label-jpost-options-pane-toggle"><%= scheduled ? "On" : "Off" %></span></div>
      <div class="max-file-size"><%= t('common.max_file_size', file_size: MAX_UPLOAD_FILE_SIZE/1024) %></div>
    </div>
    <span class="counter"></span>
    <div class="form-actions">
      <%= link_to t('common.cancel'), "#", class: "j-post-cancel-button" %>
      <%= link_to t('common.buffer'), "#", class: "j_buffer_submit buffer-button", data: {j_buffer_path: j_buffer_path, spinner: "true", nonvalidating: "true" } %>
      <%= f.submit t('post_now', scope: i18n_scope_social_post), onclick: "return false;", class: "j_post_submit", data: {j_post_path: j_post_path, spinner: "true", nonvalidating: "true" } %>
    </div>
  </section>
<% end %>

<section id="j-post-retry" data-new-post-header="<%= t("social_post.title") %>" data-retry-post-header="<%= t("social_post.retry_title") %>" >

  <div class="form-content">
    <section class="j-post-main-body">
      <div class="alert alert-warning">
        <i class="svg-fill"></i>
        <div>
          <strong><%= t('social_post.retry_alert_message') %></strong>
          <br/>
          <%= t('social_post.retry_alert_message_description') %>
        </div>
      </div>
      <header><%= t('publish_to', scope: i18n_scope_social_post)%></header>
      <ul id="social-account-list">

      </ul>
    </section>
  </div>
  <section class="custom-modal-footer">
    <div class="form-actions">
      <%= link_to t('common.retry_all'), "#", class: " j_post_retry_all", data: { spinner: "true", nonvalidating: "true", "new-post-header" => t("social_post.title"), "retry-post-header" => t("social_post.retry_title") } %>
      <%= link_to t('common.done'), "#", class: "j-post-cancel-button btn-modal-close", style: "display: inline-block" %>
    </div>
  </section>

</section>