fix 新聞與公告QA

1.優先處理-快速編輯中的檔案上傳無法新增,但可刪除
	2.優先處理-編輯中的檔案列表,無法刪除
	3.優先處理-刪除時應彈出警告視窗,請user確認一次,再將檔案刪除
This commit is contained in:
Matthew K. Fu JuYuan 2012-06-27 14:21:06 +08:00
parent 4c4929c20a
commit 55449efb35
4 changed files with 15 additions and 4 deletions

View File

@ -9,8 +9,10 @@ $('.bulletin_files_block a.delete').live('click', function(){
});
$(document).on('click', '.action a.remove_existing_record', function(){
$(this).next('.should_destroy').attr('value', 1);
$("tr #" + $(this).prev().attr('value')).hide();
if(confirm("<%= I18n.t('announcement.sure?')%>")){
$(this).next('.should_destroy').attr('value', 1);
$("tr#" + $(this).prev().attr('value')).hide();
}
});
$(document).on('click', '.quick_edit_cancel', function(){

View File

@ -10,8 +10,10 @@ $('.news_bulletin_files_block a.delete').live('click', function(){
});
$(document).on('click', '.action a.remove_existing_record', function(){
$(this).next('.should_destroy').attr('value', 1);
$("tr#" + $(this).prev().attr('value')).hide();
if(confirm("<%= I18n.t('news.sure?')%>")){
$(this).next('.should_destroy').attr('value', 1);
$("tr#" + $(this).prev().attr('value')).hide();
}
});
$(document).on('click', '.quick_edit_cancel', function(){

View File

@ -63,6 +63,7 @@
<a class="delete"><i class="icon-remove"></i></a>
<% else %>
<%= f.hidden_field :id %>
<%= hidden_field_tag :tr, (dom_id form_bulletin_file) %>
<a class="remove_existing_record"><i class="icon-remove"></i></a>
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
<% end %>

View File

@ -18,6 +18,12 @@
</div>
</div>
<div id="news_bulletin_file_qe">
<div id="modal-file" class="modal fade">
<%= render :partial => "bulletin_file_qe" %>
</div>
</div>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "bulletin_form" %>
<%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>