diff --git a/app/assets/javascripts/bootstrap.js b/app/assets/javascripts/bootstrap.js
index b822d62b..116cfe61 100644
--- a/app/assets/javascripts/bootstrap.js
+++ b/app/assets/javascripts/bootstrap.js
@@ -68,8 +68,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */
-
-
+
!function( $ ){
"use strict"
@@ -130,6 +129,7 @@
var that = this
this.isShown = false
+ //alert(this.isShown+":"+this.$element.attr('class'))
$('body').removeClass('modal-open')
@@ -138,7 +138,7 @@
this.$element
.trigger('hide')
.removeClass('in')
-
+
$.support.transition && this.$element.hasClass('fade') ?
hideWithTransition.call(this) :
hideModal.call(this)
@@ -146,7 +146,6 @@
}
-
/* MODAL PRIVATE METHODS
* ===================== */
diff --git a/app/assets/javascripts/bulletin_form.js.erb b/app/assets/javascripts/bulletin_form.js.erb
index 894d82c1..24fee4d2 100644
--- a/app/assets/javascripts/bulletin_form.js.erb
+++ b/app/assets/javascripts/bulletin_form.js.erb
@@ -1,9 +1,9 @@
-$('.bulletin_links_block a.remove_existing_record').live('click', function(){
+$('.bulletin_links_block a.delete').live('click', function(){
//$(this).parents('.list_item').remove();
$(this).parents('tr.list_item').remove();
});
-$('.bulletin_files_block a.remove_existing_record').live('click', function(){
+$('.bulletin_files_block a.delete').live('click', function(){
//$(this).parents('.list_item').remove();
$(this).parents('tr.list_item').remove();
});
@@ -17,4 +17,6 @@ $('.action a.remove_existing_record').live('click', function(){
$('.quick_edit_cancel').live('click', function(){
tr = $(this).attr('rel');
$('#' + tr).hide();
+ $("tr#bulletin_file_" + $(this).prev().attr('value')).hide();
+ $("tr#bulletin_link_" + $(this).prev().attr('value')).hide();
});
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
index 92bf922f..f55ad6e3 100644
--- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_categorys_controller.rb
@@ -94,7 +94,7 @@ class Panel::Announcement::BackEnd::BulletinCategorysController < ApplicationCon
respond_to do |format|
if @bulletin_category.update_attributes(params[:bulletin_category])
# format.html { redirect_to(panel_announcement_back_end_bulletin_category_url(@bulletin_category), :notice => t('bulletin_category.update_bulletin_category_success')) }
- format.html { redirect_to(panel_announcement_back_end_bulletin_categorys_url, :notice => t('bulletin_category.update_bulletin_category_success')) }
+ # format.html { redirect_to(panel_announcement_back_end_bulletin_categorys_url, :notice => t('bulletin_category.update_bulletin_category_success')) }
# format.xml { head :ok }
format.js
else
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_files_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_files_controller.rb
new file mode 100644
index 00000000..223e2ba5
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_files_controller.rb
@@ -0,0 +1,48 @@
+class Panel::Announcement::BackEnd::BulletinFilesController < ApplicationController
+
+ layout 'new_admin'
+
+ def index
+ @bulletin_files = BulletinFile.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ # format.xml { render :xml => @bulletins }
+ format.js
+ end
+
+ end
+
+ # POST /bulletins
+ # POST /bulletins.xml
+ def create
+ @bulletin_file = BulletinFile.new(params[:bulletin_file])
+
+ respond_to do |format|
+ if @bulletin_file.save
+ format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js
+ else
+ format.html { render :action => "new" }
+ format.js { render action: "new" }
+ end
+ end
+ end
+
+ # PUT /bulletins/1
+ # PUT /bulletins/1.xml
+ def update
+ @bulletin_file = BulletinFile.find(params[:id])
+
+ respond_to do |format|
+ if @bulletin_file.update_attributes(params[:bulletin_file])
+ format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js
+ else
+ format.html { render :action => "edit" }
+ format.js { render :action => "edit" }
+ end
+ end
+ end
+
+end
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_links_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_links_controller.rb
new file mode 100644
index 00000000..59f164d9
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletin_links_controller.rb
@@ -0,0 +1,49 @@
+class Panel::Announcement::BackEnd::BulletinLinksController < ApplicationController
+
+ layout 'new_admin'
+
+ def index
+ @bulletin_links = BulletinLink.all
+
+ respond_to do |format|
+ format.html # index.html.erb
+ # format.xml { render :xml => @bulletins }
+ format.js
+ end
+
+ end
+
+ # POST /bulletins
+ # POST /bulletins.xml
+ def create
+ @bulletin_link = BulletinLink.new(params[:bulletin_link])
+ # @bulletin_link.bulletin_id = params[:bulletin_link][:bulletin_id]
+
+ respond_to do |format|
+ if @bulletin_link.save
+ format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js
+ else
+ format.html { render :action => "new" }
+ format.js { render action: "new" }
+ end
+ end
+ end
+
+ # PUT /bulletins/1
+ # PUT /bulletins/1.xml
+ def update
+ @bulletin_link = BulletinLink.find(params[:id])
+
+ respond_to do |format|
+ if @bulletin_link.update_attributes(params[:bulletin_link])
+ format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js
+ else
+ format.html { render :action => "edit" }
+ format.js { render :action => "edit" }
+ end
+ end
+ end
+
+end
diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb
index c81ed4d1..31f446a0 100644
--- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb
+++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb
@@ -14,9 +14,15 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# @bulletins = Bulletin.search(params[:search], params[:category_id])
# @bulletins = Bulletin.all.order_by([params[:sort], params[:direction]])
- @bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.all
+ @bulletins = params[:sort] ? get_sorted_bulletins : Bulletin.limit(1).desc("postdate")
@bulletin_categories = BulletinCategory.all
-
+
+ @bulletin_link = BulletinLink.new
+ @link_url = panel_announcement_back_end_bulletins_path
+
+ @bulletin_file = BulletinFile.new
+ @file_url = panel_announcement_back_end_bulletins_path
+
respond_to do |format|
format.html # index.html.erb
format.js
@@ -78,30 +84,58 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# POST /bulletins
# POST /bulletins.xml
def create
- @bulletin = Bulletin.new(params[:bulletin])
- @bulletin.create_user_id = current_user.id
- @bulletin.update_user_id = current_user.id
+ if params[:bulletin_link]
+
+ @bulletin_link = BulletinLink.new(params[:bulletin_link])
- respond_to do |format|
- if @bulletin.save
- # format.html { redirect_to(panel_announcement_back_end_bulletin_url(@bulletin), :notice => t('announcement.create_bulletin_success')) }
- format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('announcement.create_bulletin_success')) }
- format.xml { render :xml => @bulletin, :status => :created, :location => @bulletin }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity }
- end
- end
+ respond_to do |format|
+ if @bulletin_link.save
+ format.js { render 'create_bulletin_link' }
+ end
+ end
+
+ elsif params[:bulletin_file]
+
+ @bulletin_file = BulletinFile.new(params[:bulletin_file])
+
+ respond_to do |format|
+ if @bulletin_file.save
+ format.js { render 'create_bulletin_file' }
+ end
+ end
+
+ else
+
+ @bulletin = Bulletin.new(params[:bulletin])
+
+ @bulletin.create_user_id = current_user.id
+ @bulletin.update_user_id = current_user.id
+
+ respond_to do |format|
+ if @bulletin.save
+ # format.html { redirect_to(panel_announcement_back_end_bulletin_url(@bulletin), :notice => t('announcement.create_bulletin_success')) }
+ format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('announcement.create_bulletin_success')) }
+ format.xml { render :xml => @bulletin, :status => :created, :location => @bulletin }
+ format.js
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity }
+ end
+ end
+
+ end
+
end
def link_quick_add
# debugger
-
- @bulletin = Bulletin.find(params[:bulletin_id])
-
+
+ @bulletin_link = BulletinLink.new
@link_url = panel_announcement_back_end_bulletins_path
+ @bulletin_link.bulletin_id = params[:bulletin_id]
+
respond_to do |format|
format.js
end
@@ -110,10 +144,39 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
def link_quick_edit
# debugger
+ @bulletin_link = BulletinLink.find(params[:bulletin_id])
- @bulletin = Bulletin.find(params[:bulletin_id])
+ @link_url = panel_announcement_back_end_bulletin_path(@bulletin_link)
- @link_url = panel_announcement_back_end_bulletin_path(@bulletin)
+ # @bulletin = Bulletin.find(params[:bulletin_id])
+
+ # @link_url = panel_announcement_back_end_bulletin_path(@bulletin)
+
+ respond_to do |format|
+ format.js
+ end
+
+ end
+
+ def file_quick_add
+ # debugger
+
+ @bulletin_file = BulletinFile.new
+ @file_url = panel_announcement_back_end_bulletins_path
+
+ @bulletin_file.bulletin_id = params[:bulletin_id]
+
+ respond_to do |format|
+ format.js
+ end
+
+ end
+
+ def file_quick_edit
+ # debugger
+ @bulletin_file = BulletinFile.find(params[:bulletin_id])
+
+ @file_url = panel_announcement_back_end_bulletin_path(@bulletin_file)
respond_to do |format|
format.js
@@ -124,28 +187,61 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController
# PUT /bulletins/1
# PUT /bulletins/1.xml
def update
- @bulletin = Bulletin.find(params[:id])
- @bulletin.update_user_id = current_user.id
+ if params[:bulletin_link]
- # @bulletin.image.clear if params[:bulletin][:image_del] == '1'
- # if params[:bulletin][:image_del] == '1'
- # @bulletin.remove_image!
- # @bulletin.image_del = nil
- # params[:bulletin][:image_del] = nil
- # end
+ @bulletin_link = BulletinLink.find(params[:id])
+
+ @link_url = panel_announcement_back_end_bulletin_path(@bulletin_link)
- respond_to do |format|
- if @bulletin.update_attributes(params[:bulletin]) && @bulletin.save
- # format.html { redirect_to(panel_announcement_back_end_bulletin_url(@bulletin), :notice => t('bulletin.update_bulletin_success')) }
- format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('bulletin.update_bulletin_success')) }
- format.js { render 'toggle_enable' }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity }
- end
+ respond_to do |format|
+ if @bulletin_link.update_attributes(params[:bulletin_link])
+ # format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js { render 'update_bulletin_link' }
+ end
+ end
+
+ elsif params[:bulletin_file]
+
+ @bulletin_file = BulletinFile.find(params[:id])
+
+ @file_url = panel_announcement_back_end_bulletin_path(@bulletin_file)
+
+ respond_to do |format|
+ if @bulletin_file.update_attributes(params[:bulletin_file])
+ # format.html { redirect_to(panel_announcement_back_end_bulletins_url) }
+ format.js { render 'update_bulletin_file' }
+ end
+ end
+
+ else
+
+ @bulletin = Bulletin.find(params[:id])
+
+ @bulletin.update_user_id = current_user.id
+
+ # @bulletin.image.clear if params[:bulletin][:image_del] == '1'
+ # if params[:bulletin][:image_del] == '1'
+ # @bulletin.remove_image!
+ # @bulletin.image_del = nil
+ # params[:bulletin][:image_del] = nil
+ # end
+
+ respond_to do |format|
+ if @bulletin.update_attributes(params[:bulletin]) && @bulletin.save
+ # format.html { redirect_to(panel_announcement_back_end_bulletin_url(@bulletin), :notice => t('bulletin.update_bulletin_success')) }
+ format.html { redirect_to(panel_announcement_back_end_bulletins_url, :notice => t('bulletin.update_bulletin_success')) }
+ format.js { render 'toggle_enable' }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @bulletin.errors, :status => :unprocessable_entity }
+ end
+ end
+
end
+
+
end
# DELETE /bulletins/1
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_form.html.erb
index 1ce7f629..df0dc38c 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_form.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_form.html.erb
@@ -23,14 +23,14 @@
- <%= f.label :display %>
- <%= f.radio_button :display, "List" %>List
- <%= f.radio_button :display, "Picture" %>Picture
- 顯示方式是設定在前台頁面時,資訊所呈現的樣式
+ <%#= f.label :display %>
+ <%#= f.radio_button :display, "List" List%>
+ <%#= f.radio_button :display, "Picture" Picture%>
+ <%# 顯示方式是設定在前台頁面時,資訊所呈現的樣式 %>
- <%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
+ <%= f.submit t('submit'), :class=>'btn btn-primary' %>
<% end %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_quick_edit.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_quick_edit.html.erb
deleted file mode 100644
index 14a72951..00000000
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletin_categorys/_quick_edit.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- <%= t(:quick_edit) %>
- <%= form_for bulletin_category, :url => panel_announcement_back_end_bulletin_category_path(bulletin_category), :html => {:class => 'form-horizontal'} do |f| %>
- <%= render :partial => "quick_edit_qe", :locals => { :f => f, :bulletin_category => bulletin_category } %>
-
- <%= f.submit t(:submit), :class => 'btn btn-primary' %>
- <%= f.submit t(:cancel), :class => 'btn', :type => 'reset' %>
-
- <% end %>
-
-
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_file_qe.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_file_qe.html.erb
new file mode 100644
index 00000000..4e47024c
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_file_qe.html.erb
@@ -0,0 +1,51 @@
+<% # encoding: utf-8 %>
+
+ <%= form_for(@bulletin_file, :remote => true, :url => @file_url) do |f| %>
+
+
+
+
+
+ <%= f.file_field :file %>
+
+
+
+ <%= f.fields_for :filetitle, (@bulletin_file.new_record? ? @bulletin_file.build_filetitle : @bulletin_file.filetitle ) do |f| %>
+ <% @site_valid_locales.each do |locale| %>
+
+
Name <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
+
+ <%= f.text_field locale, :id => "file-#{locale}", :class => "input-xlarge" %>
+
+
+ <% end %>
+ <% end %>
+
+ <%= f.fields_for :description, (@bulletin_file.new_record? ? @bulletin_file.build_description : @bulletin_file.description ) do |f| %>
+ <% @site_valid_locales.each do |locale| %>
+
+
Description <%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
+
+ <%= f.text_field locale, :id => "file-#{locale}", :class => "input-xlarge" %>
+
+
+ <% end %>
+ <% end %>
+
+
+
+
+
+
+ <% end %>
+
+
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link2.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link2.html.erb
deleted file mode 100644
index a3bc5243..00000000
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link2.html.erb
+++ /dev/null
@@ -1,17 +0,0 @@
-
- ">
- <%= link_to bulletin_link2.i18n_variable.zh_tw, bulletin_link2.url, :target => '_blank' %>
- <%= link_to bulletin_link2.i18n_variable.en, bulletin_link2.url, :target => '_blank' %>
-
-
-
- <%= f.hidden_field :id %>
-
- <%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb
index 7208f73c..b9006352 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link_qe.html.erb
@@ -1,39 +1,41 @@
<% # encoding: utf-8 %>
- <%= form_for(@bulletin.bulletin_links, :remote => true, :url => @link_url) do |f| %>
+ <%= form_for(@bulletin_link, :remote => true, :url => @link_url) do |f| %>
-
+
URL
<%= f.text_field :url %>
- Please correct the error
- <% @site_valid_locales.each do |locale| %>
-
-
<%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
-
-
-
Please correct the error
+ <%= f.fields_for :i18n_variable, (@bulletin_link.new_record? ? @bulletin_link.build_i18n_variable : @bulletin_link.i18n_variable) do |f| %>
+ <% @site_valid_locales.each do |locale| %>
+
+ <%= label_tag "link-#{locale}", "Name-#{I18nVariable.from_locale(locale)}", :class => 'control-label' %>
+
+ <%#= f.text_field locale, :class => 'input-xxlarge' %>
+ <%= f.text_field locale %>
+
-
+ <% end %>
<% end %>
-
<% end %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
index 97f822d0..dd3dea91 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb
@@ -12,14 +12,6 @@
<%= label :is_checked_false, t('announcement.bulletin.fact_check_not_pass_reason') %>
<%= f.text_field :not_checked_reason %>
-
- <%= f.label :image, t('announcement.image') %>
- <%= f.file_field :image %>
- <% if @bulletin.image.file %>
- <%= check_box_tag 'bulletin[image_del]' %>
- <%= t('announcement.刪除已上傳檔案') %>
- <% end %>
-
@@ -200,7 +192,7 @@
<% @bulletin.bulletin_links.each_with_index do |bulletin_link, i| %>
<%#= fields_for "bulletin[bulletin_links][]", bulletin_link do |f| %>
<%= f.fields_for :bulletin_links, bulletin_link do |f| %>
- <%= render :partial => 'bulletin_link', :object => bulletin_link, :locals => {:f => f, :i => i} %>
+ <%= render :partial => 'form_bulletin_link', :object => bulletin_link, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
@@ -246,7 +238,7 @@
<% @bulletin.bulletin_files.each_with_index do |bulletin_file, i| %>
<%#= fields_for "bulletin[bulletin_files][]", bulletin_file do |f| %>
<%= f.fields_for :bulletin_files, bulletin_file do |f| %>
- <%= render :partial => 'bulletin_file', :object => bulletin_file, :locals => {:f => f, :i => i} %>
+ <%= render :partial => 'form_bulletin_file', :object => bulletin_file, :locals => {:f => f, :i => i} %>
<% end %>
<% end %>
@@ -263,7 +255,8 @@
- <%= f.submit 'Submit/送出', :class=>'btn btn-primary' %>
+ <%= f.submit t('submit'), :class=>'btn btn-primary' %>
+ <%= link_to t('cancel'), get_go_back, :class=>"btn" %>
@@ -277,13 +270,13 @@
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_bulletin_links", "g");
$(this).prev().attr('value', parseInt(new_id) + 1);
- $(this).parents('table').append(("<%= escape_javascript(add_attribute 'bulletin_link', f, :bulletin_links) %>").replace(old_id, new_id));
+ $(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_bulletin_link', f, :bulletin_links) %>").replace(old_id, new_id));
});
$('#add_bulletin_file a.add').live('click', function(){
var new_id = $(this).prev().attr('value');
var old_id = new RegExp("new_bulletin_files", "g");
$(this).prev().attr('value', parseInt(new_id) + 1);
- $(this).parents('table').append(("<%= escape_javascript(add_attribute 'bulletin_file', f, :bulletin_files) %>").replace(old_id, new_id));
+ $(this).parents('table').append(("<%= escape_javascript(add_attribute 'form_bulletin_file', f, :bulletin_files) %>").replace(old_id, new_id));
});
<% end %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_file.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb
similarity index 66%
rename from vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_file.html.erb
rename to vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb
index ef2d4bc7..65ac2fb8 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_file.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb
@@ -1,5 +1,5 @@
- " class='list_item'>
+ " class='list_item'>
- <%= f.fields_for :filetitle, (bulletin_file.new_record? ? bulletin_file.build_filetitle : bulletin_file.filetitle ) do |f| %>
+ <%= f.fields_for :filetitle, (form_bulletin_file.new_record? ? form_bulletin_file.build_filetitle : form_bulletin_file.filetitle ) do |f| %>
<% @site_valid_locales.each do |locale| %>
<%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
@@ -20,7 +20,7 @@
<% end %>
- <%= f.fields_for :description, (bulletin_file.new_record? ? bulletin_file.build_description : bulletin_file.description ) do |f| %>
+ <%= f.fields_for :description, (form_bulletin_file.new_record? ? form_bulletin_file.build_description : form_bulletin_file.description ) do |f| %>
<% @site_valid_locales.each do |locale| %>
<%= I18nVariable.first(:conditions => {:key => locale})[I18n.locale] %>
@@ -33,11 +33,11 @@
- <% if bulletin_file.new_record? %>
-
+ <% if form_bulletin_file.new_record? %>
+
<% else %>
<%= f.hidden_field :id %>
-
+
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
<% end %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_link.html.erb
similarity index 59%
rename from vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link.html.erb
rename to vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_link.html.erb
index c8503083..560e561d 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_bulletin_link.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_link.html.erb
@@ -1,5 +1,5 @@
- " class='list_item'>
+ " class='list_item'>
@@ -9,7 +9,7 @@
- <%= f.fields_for :i18n_variable, (bulletin_link.new_record? ? bulletin_link.build_i18n_variable : bulletin_link.i18n_variable) do |f| %>
+ <%= f.fields_for :i18n_variable, (form_bulletin_link.new_record? ? form_bulletin_link.build_i18n_variable : form_bulletin_link.i18n_variable) do |f| %>
<% @site_valid_locales.each do |locale| %>
- <% if bulletin_link.new_record? %>
-
+ <% if form_bulletin_link.new_record? %>
+
<% else %>
<%= f.hidden_field :id %>
-
+
<%= f.hidden_field :should_destroy, :value => nil, :class => 'should_destroy' %>
<% end %>
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_list_bulletin_file.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_list_bulletin_file.html.erb
new file mode 100644
index 00000000..c884d0ad
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_list_bulletin_file.html.erb
@@ -0,0 +1,21 @@
+
+
+ <%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.filetitle.zh_tw, list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description.zh_tw} ) : list_bulletin_file.filetitle.zh_tw %>
+ <%= list_bulletin_file.file.file ? ( link_to list_bulletin_file.filetitle.en, list_bulletin_file.file.url, {:target => '_blank', :title => list_bulletin_file.description.en} ) : list_bulletin_file.filetitle.en %>
+
+
+
+ <%= fields_for "bulletin[bulletin_files_attributes][]", list_bulletin_file, :index => list_bulletin_file_counter do |f| %>
+ <%= f.hidden_field :id %>
+
+ <%= f.hidden_field :should_destroy, :value => nil , :class => 'should_destroy' %>
+ <% end %>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_list_bulletin_link.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_list_bulletin_link.html.erb
new file mode 100644
index 00000000..33cb9498
--- /dev/null
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_list_bulletin_link.html.erb
@@ -0,0 +1,19 @@
+
+
+ <%= link_to list_bulletin_link.i18n_variable.zh_tw, list_bulletin_link.url, :target => '_blank' %>
+ <%= link_to list_bulletin_link.i18n_variable.en, list_bulletin_link.url, :target => '_blank' %>
+
+
+
+ <%= fields_for "bulletin[bulletin_links_attributes][]", list_bulletin_link, :index => list_bulletin_link_counter do |f| %>
+ <%= f.hidden_field :id %>
+
+ <%= f.hidden_field :should_destroy, :value => nil , :class => 'should_destroy' %>
+ <% end %>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_files.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_files.html.erb
index e1999aef..8360ad42 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_files.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_files.html.erb
@@ -11,52 +11,16 @@
-
- ADD/新增
+
+ <%= t('add')%>
-
-
- …
- …
-
-
+
+ <%= render :partial => 'list_bulletin_file', :collection => bulletin.bulletin_files %>
-
-
-
-
-
- Browse
-
-
-
-
-
-
Chinese
-
-
- Please correct the error
-
-
-
-
English
-
-
- Please correct the error
-
-
-
-
-
+
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_links.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_links.html.erb
index 7981c2bd..5fea2ded 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_links.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_quick_edit_links.html.erb
@@ -1,7 +1,7 @@