app/Resources/views/admin/cloud-file/table-tr.html.twig line 1

Open in your IDE?
  1.  {% import _self as forms %}
  2.   <tr>
  3.     <td>
  4.         <div class="materials-table-img">
  5.           <input class="batch-item" value="{{ cloudFile.globalId }}" type="checkbox" data-role="batch-item" data-file-id="{{ cloudFile.id }}" data-link-count="{{ cloudFile.usedCount }}" data-file-name="{{ cloudFile.filename }}" style="display:none;" />
  6.           <div class="mask">
  7.             {% if (cloudFile.type in ['video','document','ppt'] and cloudFile.audioConvertStatus == 'success') or cloudFile.type in ['audio','flash','image'] %}
  8.               <a class="btn btn-info btn-xs" href="#modal" data-toggle="modal" data-url="{{ path('admin_cloud_file_preview', {globalId: cloudFile.globalId}) }}">{{ 'cloud_file.preview'|trans }}</a>
  9.             {% endif %}
  10.             {% if cloudFile.audioConvertStatus == 'error' %}
  11.               {% if setting("developer.debug")|default(0) %}
  12.               <a class="js-reconvert-btn btn btn-warning btn-xs" data-url='{{ path('admin_cloud_file_reconvert', {globalId:cloudFile.globalId}) }}' data-loading-text="{{ 'cloud_file.re_transcoding.submiting'|trans }}">{{ 'cloud_file.re_transcoding_btn'|trans }}</a>
  13.               {% endif %}
  14.             {% endif %}
  15.             {% if (cloudFile.type == 'video' and cloudFile.audioConvertStatus == 'success') %}
  16.               <div class="time">
  17.                 {{ cloudFile.length|default(0)|activity_length_format }}
  18.               </div>
  19.             {% endif %}
  20.           </div>
  21.           <img src="{{ asset(cloudFile.thumbnail|default('assets/img/default/cloud_' ~ cloudFile.type ~ '.png')) }}">
  22.         </div>
  23.         <div class="materials-table-title">
  24.           <a class="heading"  href="#modal" data-toggle="modal" data-url="{{ path('admin_cloud_file_preview', {globalId: cloudFile.globalId})}}"  data-placement="top" title="{{ cloudFile.filename }}">{{ cloudFile.filename }}</a>
  25.           <span class="subtitle">
  26.             {% if createdUser %}
  27.                 {{ createdUser.nickname }} {{ 'cloud_file.upload'|trans }}
  28.             {% endif %}
  29.           </span>
  30.           {% if cloudFile.type in ['video', 'ppt', 'document'] %}
  31.             {% if cloudFile.audioConvertStatus == 'waiting' %}
  32.               <span class="label label-info">{{ dict_text('processStatus', cloudFile.audioConvertStatus) }}</span>
  33.             {% elseif cloudFile.audioConvertStatus == 'doing' %}
  34.               <span class="label label-info">{{ dict_text('processStatus', cloudFile.audioConvertStatus) }}</span>
  35.             {% elseif cloudFile.audioConvertStatus == 'error' %}
  36.               <span class="label label-danger">{{ dict_text('processStatus', cloudFile.audioConvertStatus) }}</span>
  37.             {% endif %}
  38.           {% endif %}
  39.           {% if  cloudFile.usedCount|default(0) == 0 %}
  40.           <span class="label label-default">{{ 'cloud_file.no_use_tips'|trans }}</span>
  41.           {% endif %}
  42.         </div>
  43.     </td>
  44.     <td class="text-center">
  45.       <div class="mbs">{{ dict_text('fileType', cloudFile.type) }}</div>
  46.       {% if cloudFile.mcStatus|default('no') == 'yes' %}
  47.         <div class="label label-info mtm">{{ 'cloud_file.mc_yes_status_tips'|trans }}</div>
  48.       {% endif %}
  49.     </td>
  50.     <td class="text-center">
  51.       {{ cloudFile.fileSize|file_size }}
  52.     </td>
  53.     <td class="text-center">
  54.       <span style="display:block">{{ cloudFile.createdTime|date('Y-m-d H:i:s') }}</span>
  55.     </td>
  56.     {% if pageType  == 'attachment' %}
  57.       <td class="text-center">
  58.         <span style="display:block">{{ forms.showType(cloudFile.useType) }}</span>
  59.       </td>
  60.     {% endif %}
  61.     <td class="es-materillib-table text-center">
  62.       <div class="btn-group ">
  63.         {% if pageType  == 'attachment' %}
  64.           <a class="btn btn-default btn-sm" href="{{ path('admin_cloud_file_download', {globalId:cloudFile.globalId}) }}"  target="__blank"><span class="glyphicon glyphicon-download-alt"></span> {{ 'cloud_file.download_btn'|trans }}</a>
  65.         {% else %}
  66.           <a class="btn btn-default btn-sm js-detail-btn " data-url="{{ path('admin_cloud_file_detail', {globalId:cloudFile.globalId}) }}">{{ 'cloud_file.edit_btn'|trans }}</a>
  67.         {% endif %}
  68.         <a href="#" type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
  69.           <span class="caret"></span>
  70.         </a>
  71.         <ul class="dropdown-menu pull-right">
  72.           <li>
  73.             {% if pageType  == 'file' %}
  74.               <a href="{{ path('admin_cloud_file_download', {globalId:cloudFile.globalId}) }}" target="__blank"><span class="glyphicon glyphicon-download-alt"></span>{{ 'cloud_file.download_btn'|trans }}</a>
  75.             {% endif %}
  76.           </li>
  77.           <li>
  78.             <a class="js-delete-btn" href="javascript:" data-url="{{ path('admin_cloud_file_delete_modal_show') }}" data-id="{{ cloudFile.globalId }}"><span class="glyphicon glyphicon-trash"></span> {{ 'cloud_file.delete_btn'|trans }}</a>
  79.           </li>
  80.         </ul>
  81.       </div>
  82.     </td>
  83.   </tr>
  84. {% macro showType( useType) %}
  85.     {% if useType == "article" %}
  86.       {{ 'cloud_attachment.type.article'|trans }}
  87.     {% elseif useType in ['course.thread','course.thread.post'] %}
  88.       {{ 'cloud_attachment.type.course_discussion_area'|trans }}
  89.     {% elseif  useType in ['classroom.thread','classroom.thread.post'] %}
  90.       {{ 'cloud_attachment.type.classroom_thread'|trans }}
  91.     {% elseif useType in ['group.thread', 'group.thread.post'] %}
  92.       {{ 'cloud_attachment.type.group'|trans }}
  93.     {% elseif useType in ['question.stem', 'question.analysis'] %}
  94.       {{ 'cloud_attachment.type.test_question'|trans }}
  95.     {% else %}
  96.       --
  97.     {% endif %}
  98. {% endmacro %}