<% define_admin_breadcrumbs do %> <% add_admin_breadcrumb('竞赛列表', admins_competitions_path) %> <% end %>
<% imageExists = File.exist?(disk_filename("Competition", "banner")) %> <% imageUrl = imageExists ? '/' + banner_img("Competition") + "?#{Time.now.to_i}" : '' %> 竞赛主页banner <%= image_tag(imageUrl, width: 150, height: 50, class: "preview-image competition-image-banner mr-1", data: { toggle: 'tooltip', title: '点击预览' }) %> <%= javascript_void_link imageExists ? '重新上传' : '上传图片', class: 'action upload-competition-image-action', data: { source_id: "banner", source_type: 'Competition', toggle: 'modal', target: '.admin-upload-file-modal' } %>
<%= javascript_void_link '新增', class: 'btn btn-primary', data: { toggle: 'modal', target: '.admin-create-competition-modal' } %>
<%= render partial: 'admins/competitions/shared/list', locals: { competitions: @competitions } %>
<%= render 'admins/competitions/shared/create_competition_modal' %> <%= render partial: 'admins/shared/modal/upload_file_modal', locals: { title: '上传图片' } %> <%= render partial: 'admins/competitions/shared/import_competition_score_modal' %>