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 / j_platform / tickets / _view.html.erb
Size: Mime:
<% i18n_scope_ticket_view = 'tickets._ticket_view' %>
<% i18n_scope_ticket_message = 'tickets.messages' %>

<section id="ticket-view" class="<%= ticket.network %>">
  <%= render 'j_platform/tickets/internal_conversation', ticket: @ticket %>
  <% if ticket.social_message %>
    <aside id="customer-engagement" class="j_post">
      <header>
        <%= t('customer_engagement', scope: i18n_scope_ticket_view ) %>
      </header>
      <section class="external-conversation" data-j-message-id="<%= ticket.social_message.id %>">
        <article class="header" data-account="<%= ticket.social_message.author.nickname %>">
          <%= render 'j_platform/ticket/social_messages/social_message', social_message: ticket.social_message %>
        </article>
        <article class="feeds <%= ticket.network %>">
          <ul>
            <%= render partial: "j_platform/ticket/external_conversations/external_conversation", collection: ticket.external_conversation %>
          </ul>
        </article>
      </section>
      <article class="post">
        <% if ticket.is_resolved? %>
          <%= t(:ticket_has_been_resolved, scope: i18n_scope_ticket_view) %>
        <% elsif ticket.is_assigned_to(current_user) %>
          <% if ticket.social_accounts.length == 1 %>
            <%= image_tag ticket.social_accounts.first.avatar_url %>
          <% else %>
            <%= image_tag "#{JPlatform::Default.endpoint}/images/avatars/thumb/missing.png", class: 'post-social-account-avatar' %>
          <% end %>

          <%= simple_form_for post, url: project_posts_path(ticket.project_id), html: { id: 'ticket_draft_message_form' }, validate: true do |f| %>
            <% if ticket.social_accounts.length == 1 %>
              <% social_account = ticket.social_accounts.first %>
              <h1><%= social_account.name %><span><%= social_account.handle %></span></h1>
              <%= f.input :renders_ticket_path, as: :hidden, input_html: { value: true }  %>
              <div style="display:none;">
                <select name="project_post[social_account_id]" id="project_post_social_account_id" class="social-post-account-select">
                  <option value=<%= social_account.id %> data-class="<%= sa_css_class(social_account) %>"><%= social_account.to_s %></option>
                </select>
              </div>
            <% else %>
              <div class="control-group text optional ticket_default_social_account">
                <div class="controls">
                  <select name="project_post[social_account_id]" id="project_post_social_account_id" class="select optional social-post-account-select" data-validate="true" data-placeholder='<%= t('reply_from', scope: i18n_scope_ticket_view) %>' >
                    <option class="placeholder" value="0" data-url="<%= JPlatform::Default.endpoint %>/images/avatars/thumb/missing.png"></option>
                    <% ticket.social_accounts.each do  |social_account| %>
                      <option value=<%= social_account.id %> data-class="<%= sa_css_class(social_account) %>" data-url=<%= social_account.avatar_url %> ><%= social_account.to_s %></option>
                    <% end %>
                  </select>
                </div>
              </div>
            <% end %>

            <%= f.fields_for :options do |f| %>
              <%= f.input :in_reply_to_status_id, as: :hidden, input_html: { value: ticket.reply_to_status_id } %>
            <% end %>
            <%= f.input :message, as: :text, required: true, label: false, placeholder: t('common.compose_message'), input_html: {class: 'j-post-message-textarea counter-textarea', 'data-default-value' => ticket.try(:default_reply_text) }, validate: true %>
            <footer>
              <div class="uploaders">
                <%= render partial: "uploader" %>
              </div>
              <span class="counter" for="project_post_message"></span>
              <%= link_to t('common.save_draft'), "#", class: "cancel-button save-draft-message", data: { spinner: true, spinner_color: "#777", path: ticket_path(ticket.id), success: t('create_draft_success', scope: i18n_scope_ticket_message) } %>
              <%= f.submit t('common.post'), id: "submit_post", class: "j_post_submit", onclick: "return false;", data: { j_post_path: project_posts_path(ticket.project_id), spinner: true, nonvalidating: "true" } %>
            </footer>
          <% end %>

          <section class="draft-message">
            <% if social_account = ticket.default_social_account %>
              <%= image_tag social_account.avatar_url %>
            <% else %>
              <%= image_tag "#{JPlatform::Default.endpoint}/images/avatars/thumb/missing.png", class: 'post-social-account-avatar' %>
            <% end %>
            <div class="message-text"><%= ticket.draft_message %></div>
            <div class="action">
              <%= link_to '', "#", class: "edit-draft-message tool-tip svg-fill", title: t('edit_draft_message_btn', scope: i18n_scope_ticket_view ) %>
              <%= link_to '', "#", class: "delete-draft-message tool-tip svg-fill", title: t('delete_draft_message_btn', scope: i18n_scope_ticket_view ), data: { confirm: t('delete_draft_message', scope: i18n_scope_ticket_message), path: ticket_path(ticket.id), success: t('delete_draft_success', scope: i18n_scope_ticket_message ) } %></div>
          </section>
        <% elsif ticket.is_assigned? %>
          <%= t(:must_be_assigned_to_you_to_reply, scope: i18n_scope_ticket_view) %>
        <% else %>
          <%= t(:must_be_assigned_to_reply, scope: i18n_scope_ticket_view) %>
        <% end %>
      </article>
    </aside>
  <% end %>
</section>