<% if courses.present? %>
- <% courses.each do |course| %>
+ <% courses.each_with_index do |course, index| %>
- <%= render 'admins/courses/shared/td', course: course %>
+ <%= render partial: 'admins/courses/shared/td', locals: {course: course, no: index} %>
<% end %>
<% else %>
diff --git a/app/views/admins/courses/shared/_td.html.erb b/app/views/admins/courses/shared/_td.html.erb
index 1d2da2a33..51cc4b199 100644
--- a/app/views/admins/courses/shared/_td.html.erb
+++ b/app/views/admins/courses/shared/_td.html.erb
@@ -1,3 +1,4 @@
+<%= list_index_no((params[:page] || 1).to_i, no) %> |
<%= course.id %> |
<%= link_to(course.name, "/courses/#{course.id}", target: '_blank') %>
diff --git a/app/views/admins/courses/update.js.erb b/app/views/admins/courses/update.js.erb
index 1278a2e1f..983ac22f0 100644
--- a/app/views/admins/courses/update.js.erb
+++ b/app/views/admins/courses/update.js.erb
@@ -1 +1,3 @@
-$("#course-item-<%= @course.id %>").html("<%= j render partial: "admins/courses/shared/td",locals: {course: @course} %>")
\ No newline at end of file
+var index = $("#course-item-<%= @course.id %>").children(":first").html();
+$("#course-item-<%= @course.id %>").html("<%= j render partial: "admins/courses/shared/td",locals: {course: @course, no: 1} %>");
+$("#course-item-<%= @course.id %>").children(":first").html(index);
\ No newline at end of file
diff --git a/app/views/admins/customers/shared/_list.html.erb b/app/views/admins/customers/shared/_list.html.erb
index 0ba5638cb..6f84db4e5 100644
--- a/app/views/admins/customers/shared/_list.html.erb
+++ b/app/views/admins/customers/shared/_list.html.erb
@@ -1,15 +1,17 @@
- 客户名称 |
+ 序号 |
+ 客户名称 |
<%= sort_tag('添加时间', name: 'created_at', path: admins_partner_customers_path(current_partner)) %> |
操作 |
<% if customers.present? %>
- <% customers.each do |customer| %>
+ <% customers.each_with_index do |customer, index| %>
+ <%= list_index_no((params[:page] || 1).to_i, index) %> |
<%= customer.school&.name %> |
<%= customer.created_at&.strftime('%Y-%m-%d %H:%M') %> |
diff --git a/app/views/admins/department_applies/shared/_list.html.erb b/app/views/admins/department_applies/shared/_list.html.erb
index 0a1d803be..87d5ab66f 100644
--- a/app/views/admins/department_applies/shared/_list.html.erb
+++ b/app/views/admins/department_applies/shared/_list.html.erb
@@ -1,18 +1,20 @@
+ 序号 |
ID |
部门名称 |
单位名称 |
- 创建者 |
+ 创建者 |
<%= sort_tag('创建于', name: 'created_at', path: admins_department_applies_path) %> |
操作 |
<% if applies.present? %>
- <% applies.each do |apply| %>
+ <% applies.each_with_index do |apply, index| %>
+ <%= list_index_no((params[:page] || 1).to_i, index) %> |
<%= apply.id %> |
<%= apply.name %> |
<%= apply.school.try(:name) %> |
diff --git a/app/views/admins/department_members/create.js.erb b/app/views/admins/department_members/create.js.erb
index 4355c7432..6bf0a6ac3 100644
--- a/app/views/admins/department_members/create.js.erb
+++ b/app/views/admins/department_members/create.js.erb
@@ -1,4 +1,6 @@
$('.modal.admin-add-department-member-modal').modal('hide');
$.notify({ message: '操作成功' });
-$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: { department: current_department }) %>")
\ No newline at end of file
+var index = $(".department-item-<%= current_department.id %>").children(":first").html();
+$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: { department: current_department, index: 1 }) %>");
+$(".department-item-<%= current_department.id %>").children(":first").html(index);
\ No newline at end of file
diff --git a/app/views/admins/departments/shared/_department_item.html.erb b/app/views/admins/departments/shared/_department_item.html.erb
index 64b4ee70b..62f3a81ac 100644
--- a/app/views/admins/departments/shared/_department_item.html.erb
+++ b/app/views/admins/departments/shared/_department_item.html.erb
@@ -1,3 +1,4 @@
+<%= list_index_no((params[:page] || 1).to_i, index) %> |
<% not_list = defined?(:users_count) %>
<%= overflow_hidden_span department.name, width: 150 %> |
diff --git a/app/views/admins/departments/shared/_list.html.erb b/app/views/admins/departments/shared/_list.html.erb
index 6af63d6f4..09ba2a65f 100644
--- a/app/views/admins/departments/shared/_list.html.erb
+++ b/app/views/admins/departments/shared/_list.html.erb
@@ -1,10 +1,11 @@
+ 序号 |
部门名称 |
单位名称 |
用户数 |
- 已职业认证 |
+ 已职业认证 |
部门管理员 |
统计链接 |
云主机数 |
@@ -14,9 +15,9 @@
<% if departments.present? %>
- <% departments.each do |department| %>
+ <% departments.each_with_index do |department, index| %>
- <%= render 'admins/departments/shared/department_item', department: department %>
+ <%= render partial: 'admins/departments/shared/department_item', locals: {department: department, index: index} %>
<% end %>
<% else %>
diff --git a/app/views/admins/departments/update.js.erb b/app/views/admins/departments/update.js.erb
index 359bac59c..d20ca9524 100644
--- a/app/views/admins/departments/update.js.erb
+++ b/app/views/admins/departments/update.js.erb
@@ -1,4 +1,6 @@
$('.modal.admin-edit-department-modal').modal('hide');
$.notify({ message: '操作成功' });
-$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: { department: current_department }) %>")
\ No newline at end of file
+var index = $(".department-item-<%= current_department.id %>").children(":first").html();
+$('.department-list-table .department-item-<%= current_department.id %>').html("<%= j(render partial: 'admins/departments/shared/department_item', locals: {department: current_department, index: 1}) %>");
+$(".department-item-<%= current_department.id %>").children(":first").html(index);
\ No newline at end of file
diff --git a/app/views/admins/identity_authentications/shared/_list.html.erb b/app/views/admins/identity_authentications/shared/_list.html.erb
index 607feb93a..6e12d1c54 100644
--- a/app/views/admins/identity_authentications/shared/_list.html.erb
+++ b/app/views/admins/identity_authentications/shared/_list.html.erb
@@ -3,6 +3,7 @@
+ 序号 |
<% unless is_processed %>
<%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box',
@@ -13,7 +14,7 @@
| 姓名 |
身份证号 |
学校/单位 |
- 职称 |
+ 职称 |
<% unless is_processed %>
照片
@@ -33,9 +34,10 @@
|
<% if applies.present? %>
- <% applies.each do |apply| %>
+ <% applies.each_with_index do |apply, index| %>
<% user = apply.user %>
+ <%= list_index_no((params[:page] || 1).to_i, index) %> |
<% unless is_processed %>
<%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %> |
<% end %>
diff --git a/app/views/admins/laboratories/shared/_laboratory_item.html.erb b/app/views/admins/laboratories/shared/_laboratory_item.html.erb
index 81a45ca71..765616926 100644
--- a/app/views/admins/laboratories/shared/_laboratory_item.html.erb
+++ b/app/views/admins/laboratories/shared/_laboratory_item.html.erb
@@ -1,4 +1,5 @@
<% school = laboratory.school %>
+<%= list_index_no((params[:page] || 1).to_i, index) %> |
<%= school&.name || 'EduCoder主站' %> |
<% if laboratory.identifier %>
diff --git a/app/views/admins/laboratories/shared/_list.html.erb b/app/views/admins/laboratories/shared/_list.html.erb
index 2520b3276..a731be44a 100644
--- a/app/views/admins/laboratories/shared/_list.html.erb
+++ b/app/views/admins/laboratories/shared/_list.html.erb
@@ -1,6 +1,7 @@
+ 序号 |
单位名称 |
域名 |
统计链接 |
@@ -9,14 +10,14 @@
同步课堂 |
同步实践课程 |
同步实训 |
- 操作 |
+ 操作 |
<% if laboratories.present? %>
- <% laboratories.each do |laboratory| %>
+ <% laboratories.each_with_index do |laboratory, index| %>
- <%= render 'admins/laboratories/shared/laboratory_item', laboratory: laboratory %>
+ <%= render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: laboratory, index: index} %>
<% end %>
<% else %>
diff --git a/app/views/admins/laboratories/update.js.erb b/app/views/admins/laboratories/update.js.erb
index 1b9f307a6..149539ad6 100644
--- a/app/views/admins/laboratories/update.js.erb
+++ b/app/views/admins/laboratories/update.js.erb
@@ -1 +1,3 @@
-$(".laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: "admins/laboratories/shared/laboratory_item",locals: {laboratory: @laboratory} %>")
\ No newline at end of file
+var index = $(".laboratory-item-<%= @laboratory.id %>").children(":first").html();
+$(".laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: "admins/laboratories/shared/laboratory_item",locals: {laboratory: @laboratory, index: 1} %>");
+$(".laboratory-item-<%= @laboratory.id %>").children(":first").html(index);
\ No newline at end of file
diff --git a/app/views/admins/laboratories/update_sync_course.js.erb b/app/views/admins/laboratories/update_sync_course.js.erb
index 5ae68f673..663f56ee1 100644
--- a/app/views/admins/laboratories/update_sync_course.js.erb
+++ b/app/views/admins/laboratories/update_sync_course.js.erb
@@ -1 +1,3 @@
-$("#laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: @laboratory} %>")
\ No newline at end of file
+var index = $(".laboratory-item-<%= @laboratory.id %>").children(":first").html();
+$("#laboratory-item-<%= @laboratory.id %>").html("<%= j render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: @laboratory, index: 1} %>");
+$(".laboratory-item-<%= @laboratory.id %>").children(":first").html(index);
\ No newline at end of file
diff --git a/app/views/admins/laboratory_shixuns/shared/_list.html.erb b/app/views/admins/laboratory_shixuns/shared/_list.html.erb
index e1244c472..462486f4b 100644
--- a/app/views/admins/laboratory_shixuns/shared/_list.html.erb
+++ b/app/views/admins/laboratory_shixuns/shared/_list.html.erb
@@ -1,21 +1,22 @@
- 实训名称 |
+ 序号 |
+ 实训名称 |
技术平台 |
技术体系 |
封面 |
创建者 |
- 状态 |
+ 状态 |
执行时间 |
操作 |
<% if laboratory_shixuns.present? %>
- <% laboratory_shixuns.each do |laboratory_shixun| %>
+ <% laboratory_shixuns.each_with_index do |laboratory_shixun, index| %>
- <%= render partial: 'admins/laboratory_shixuns/shared/td', locals: { laboratory_shixun: laboratory_shixun } %>
+ <%= render partial: 'admins/laboratory_shixuns/shared/td', locals: { laboratory_shixun: laboratory_shixun, index: index } %>
<% end %>
<% else %>
diff --git a/app/views/admins/laboratory_shixuns/shared/_td.html.erb b/app/views/admins/laboratory_shixuns/shared/_td.html.erb
index dbdf0df75..d987b53b4 100644
--- a/app/views/admins/laboratory_shixuns/shared/_td.html.erb
+++ b/app/views/admins/laboratory_shixuns/shared/_td.html.erb
@@ -1,5 +1,6 @@
<%- shixun = laboratory_shixun.shixun -%>
+<%= list_index_no((params[:page] || 1).to_i, index) %> |
<%= link_to "/shixuns/#{shixun.identifier}", target: '_blank' do %>
<%= shixun.name %>
diff --git a/app/views/admins/laboratory_subjects/shared/_list.html.erb b/app/views/admins/laboratory_subjects/shared/_list.html.erb
index 55f67dea8..c40d02260 100644
--- a/app/views/admins/laboratory_subjects/shared/_list.html.erb
+++ b/app/views/admins/laboratory_subjects/shared/_list.html.erb
@@ -1,7 +1,8 @@
- 课程名称 |
+ 序号 |
+ 课程名称 |
技术体系 |
等级体系 |
封面 |
@@ -13,10 +14,11 @@
<% if laboratory_subjects.present? %>
- <% laboratory_subjects.each do |laboratory_subject| %>
+ <% laboratory_subjects.each_with_index do |laboratory_subject, index| %>
<%- subject = laboratory_subject.subject -%>
+ <%= list_index_no((params[:page] || 1).to_i, index) %> |
<%= link_to(subject.name, "/paths/#{subject.id}", target: '_blank') %>
首页
diff --git a/app/views/admins/laboratory_users/create.js.erb b/app/views/admins/laboratory_users/create.js.erb
index f43fd7887..604e62943 100644
--- a/app/views/admins/laboratory_users/create.js.erb
+++ b/app/views/admins/laboratory_users/create.js.erb
@@ -1,4 +1,6 @@
$('.modal.admin-add-laboratory-user-modal').modal('hide');
$.notify({ message: '操作成功' });
-$('.laboratory-list-table .laboratory-item-<%= current_laboratory.id %>').html("<%= j(render partial: 'admins/laboratories/shared/laboratory_item', locals: { laboratory: current_laboratory }) %>")
\ No newline at end of file
+var index = $(".laboratory-item-<%= current_laboratory.id %>").children(":first").html();
+$('.laboratory-list-table .laboratory-item-<%= current_laboratory.id %>').html("<%= j(render partial: 'admins/laboratories/shared/laboratory_item', locals: {laboratory: current_laboratory, index: 1}) %>");
+$(".laboratory-item-<%= current_laboratory.id %>").children(":first").html(index);
\ No newline at end of file
diff --git a/app/views/admins/library_applies/shared/_list.html.erb b/app/views/admins/library_applies/shared/_list.html.erb
index 783d0db30..fde3d1d1a 100644
--- a/app/views/admins/library_applies/shared/_list.html.erb
+++ b/app/views/admins/library_applies/shared/_list.html.erb
@@ -3,11 +3,12 @@
+ 序号 |
头像 |
姓名 |
教学案例 |
案例描述 |
- 时间 |
+ 时间 |
<% if is_processed %>
拒绝原因 |
状态 |
@@ -18,10 +19,11 @@
<% if applies.present? %>
- <% applies.each do |apply| %>
+ <% applies.each_with_index do |apply, index| %>
<% user = apply.library.user %>
<% library = apply.library %>
+ <%= list_index_no((params[:page] || 1).to_i, index) %> |
<%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
diff --git a/app/views/admins/partners/shared/_list.html.erb b/app/views/admins/partners/shared/_list.html.erb
index 0bebc2a4b..71153c175 100644
--- a/app/views/admins/partners/shared/_list.html.erb
+++ b/app/views/admins/partners/shared/_list.html.erb
@@ -1,15 +1,17 @@
- 名称 |
+ 序号 |
+ 名称 |
<%= sort_tag('添加时间', name: 'created_at', path: admins_partners_path) %> |
操作 |
<% if partners.present? %>
- <% partners.each do |partner| %>
+ <% partners.each_with_index do |partner, index| %>
+ <%= list_index_no((params[:page] || 1).to_i, index) %> |
<%= link_to partner.school&.name || partner.name, customers_partner_path(partner), target: '_blank' %>
|
diff --git a/app/views/admins/professional_authentications/shared/_list.html.erb b/app/views/admins/professional_authentications/shared/_list.html.erb
index 6ec6355ba..7ffa5837e 100644
--- a/app/views/admins/professional_authentications/shared/_list.html.erb
+++ b/app/views/admins/professional_authentications/shared/_list.html.erb
@@ -3,6 +3,7 @@
+ 序号 |
<% unless is_processed %>
<%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box',
@@ -12,7 +13,7 @@
| 头像 |
姓名 |
学校/单位 |
- 职称 |
+ 职称 |
<% unless is_processed %>
照片
@@ -31,9 +32,10 @@
|
<% if applies.present? %>
- <% applies.each do |apply| %>
+ <% applies.each_with_index do |apply, index| %>
<% user = apply.user %>
+ <%= list_index_no((params[:page] || 1).to_i, index) %> |
<% unless is_processed %>
<%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %> |
<% end %>
diff --git a/app/views/admins/project_package_applies/shared/_list.html.erb b/app/views/admins/project_package_applies/shared/_list.html.erb
index d94c96184..bec0912ca 100644
--- a/app/views/admins/project_package_applies/shared/_list.html.erb
+++ b/app/views/admins/project_package_applies/shared/_list.html.erb
@@ -3,11 +3,12 @@
+ 序号 |
头像 |
姓名 |
众包需求 |
需求描述 |
- 时间 |
+ 时间 |
<% if is_processed %>
拒绝原因 |
状态 |
@@ -18,10 +19,11 @@
<% if applies.present? %>
- <% applies.each do |apply| %>
+ <% applies.each_with_index do |apply, index| %>
<% package = apply.project_package %>
<% user = package.creator %>
+ <%= list_index_no((params[:page] || 1).to_i, index) %> |
<%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
diff --git a/app/views/admins/projects/shared/_list.html.erb b/app/views/admins/projects/shared/_list.html.erb
index 8a84a72d0..e2a6307ad 100644
--- a/app/views/admins/projects/shared/_list.html.erb
+++ b/app/views/admins/projects/shared/_list.html.erb
@@ -1,6 +1,7 @@
+ 序号 |
ID |
项目名称 |
公开 |
@@ -11,14 +12,15 @@
里程碑 |
成员 |
管理员 |
- <%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %> |
+ <%= sort_tag('创建时间', name: 'created_at', path: admins_projects_path) %> |
操作 |
<% if projects.present? %>
- <% projects.each do |project| %>
+ <% projects.each_with_index do |project, index| %>
+ <%= list_index_no((params[:page] || 1).to_i, index) %> |
<%= project.id %> |
<%= link_to(project.name, "/projects/#{project.id}", target: '_blank') %>
diff --git a/app/views/admins/schools/index.html.erb b/app/views/admins/schools/index.html.erb
index 9c41067ee..56cbadd9d 100644
--- a/app/views/admins/schools/index.html.erb
+++ b/app/views/admins/schools/index.html.erb
@@ -4,7 +4,7 @@
| | | | | | | |