|
|
@ -23,13 +23,14 @@
|
|
|
|
<% if @objects_count > 0 %>
|
|
|
|
<% if @objects_count > 0 %>
|
|
|
|
<div class="educontent project-packages-list">
|
|
|
|
<div class="educontent project-packages-list">
|
|
|
|
<% @objects.each do |object| %>
|
|
|
|
<% @objects.each do |object| %>
|
|
|
|
<div class="project-package-item">
|
|
|
|
<% can_manage = @type == 'p_package' && (admin_or_business? || current_user.id == @user.id) %>
|
|
|
|
|
|
|
|
<div class="project-package-item <%= can_manage ? 'with-operator' : '' %> project-package-<%= object.id %>">
|
|
|
|
<div class="item-image">
|
|
|
|
<div class="item-image">
|
|
|
|
<%= image_tag("educoder/project_packages/#{object.category}.png") %>
|
|
|
|
<%= image_tag("educoder/project_packages/#{object.category}.png") %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="item-body">
|
|
|
|
<div class="item-body">
|
|
|
|
<div class="item-head">
|
|
|
|
<div class="item-head">
|
|
|
|
<div class="item-head-title">
|
|
|
|
<div class="item-head-title" data-tip-down="<%= object.title %>">
|
|
|
|
<%= link_to object.title, project_package_path(object) %>
|
|
|
|
<%= link_to object.title, project_package_path(object) %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="item-head-tags">
|
|
|
|
<div class="item-head-tags">
|
|
|
@ -40,14 +41,15 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="item-head-blank"></div>
|
|
|
|
<div class="item-head-blank"></div>
|
|
|
|
<div class="item-head-price">
|
|
|
|
<div class="item-head-price">
|
|
|
|
<span>¥</span><%= object.min_price %>
|
|
|
|
|
|
|
|
<% if object.max_price && object.max_price != object.min_price %>
|
|
|
|
<% if object.max_price && object.max_price != object.min_price %>
|
|
|
|
~<span>¥</span><%= object.max_price %>
|
|
|
|
<span>¥</span><%= object.min_price %>~<span>¥</span><%= object.max_price %>
|
|
|
|
|
|
|
|
<% else %>
|
|
|
|
|
|
|
|
<span>¥</span><%= object.min_price %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="item-category">
|
|
|
|
<div class="item-category">
|
|
|
|
<div class="item-category-item">人工智能</div>
|
|
|
|
<div class="item-category-item"><%= object.category_text %></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="item-other">
|
|
|
|
<div class="item-other">
|
|
|
|
<div class="item-group item-other-visit">
|
|
|
|
<div class="item-group item-other-visit">
|
|
|
@ -57,7 +59,13 @@
|
|
|
|
<div class="item-group item-other-deadline">
|
|
|
|
<div class="item-group item-other-deadline">
|
|
|
|
<% if object.published? %>
|
|
|
|
<% if object.published? %>
|
|
|
|
<span class="item-group-icon"><i class="fa fa-clock-o"></i></span>
|
|
|
|
<span class="item-group-icon"><i class="fa fa-clock-o"></i></span>
|
|
|
|
<span class="item-group-text">内竞标截止</span>
|
|
|
|
<span class="item-group-text">
|
|
|
|
|
|
|
|
<% if Time.now + 10.days > object.deadline_at %>
|
|
|
|
|
|
|
|
<%= time_from_future(object.deadline_at) %>内竞标截止
|
|
|
|
|
|
|
|
<% else %>
|
|
|
|
|
|
|
|
<%= object.deadline_at.strftime('%Y-%m-%d') %> 竞标截止
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="item-group item-other-bidding">
|
|
|
|
<div class="item-group item-other-bidding">
|
|
|
@ -74,9 +82,61 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% if can_manage && (object.editable? || object.deletable?) %>
|
|
|
|
|
|
|
|
<div class="item-operator">
|
|
|
|
|
|
|
|
<% if object.editable? %>
|
|
|
|
|
|
|
|
<a href="<%= edit_project_package_path(object) %>" title="编辑"><i class="fa fa-pencil"></i></a>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if object.deletable? %>
|
|
|
|
|
|
|
|
<a href="javascript:void(0);"
|
|
|
|
|
|
|
|
class="delete-project-package-btn"
|
|
|
|
|
|
|
|
data-id="<%= object.id %>"
|
|
|
|
|
|
|
|
title="删除"><i class="fa fa-trash-o"></i></a>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="educontent edu-txt-center mb80">
|
|
|
|
|
|
|
|
<div class="inline pages_user_show">
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<% else %>
|
|
|
|
<% else %>
|
|
|
|
<%= render :partial => "welcome/no_data" %>
|
|
|
|
<%= render :partial => "welcome/no_data" %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
|
|
|
|
$(".delete-project-package-btn").on("click", function(){
|
|
|
|
|
|
|
|
var id = $(this).data("id")
|
|
|
|
|
|
|
|
op_confirm_tip_1("是否确认删除?", "deleteProjectPackage(" + id + ");")
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function deleteProjectPackage(id) {
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
type: "DELETE",
|
|
|
|
|
|
|
|
url: "<%= project_packages_path %>/" + id,
|
|
|
|
|
|
|
|
success: function (data) {
|
|
|
|
|
|
|
|
$('.popupAll').remove();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(data && data.status == 0){
|
|
|
|
|
|
|
|
$('.project-packages-list .project-package-item.project-package-' + id).remove();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($('.project-packages-list .project-package-item').length == 0){
|
|
|
|
|
|
|
|
$.ajax({ dataType: 'script', url: "<%= user_path(@user, params.except(:controller, :action)) %>" });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
notice_box(data.message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|