diff --git a/app/assets/javascripts/lib/modal-preview.js b/app/assets/javascripts/lib/modal-preview.js index d3dd0c32..5a684fd5 100644 --- a/app/assets/javascripts/lib/modal-preview.js +++ b/app/assets/javascripts/lib/modal-preview.js @@ -1,13 +1,20 @@ $(function() { $(".post_preview").click(function(){ $("#main-wrap").after(""); + + var preview_url = $(this).attr('url'); - $.post($(this).attr('url'), $(".previewable").serialize() ,function(data){ - $('#show_preview .modal').modal(); + $("form.previewable").ajaxSubmit({ + beforeSubmit: function(a,f,o){ + o.dataType = 'script'; + o.url = preview_url; + o.type = 'post'; + },success: function(msg) { + $('#show_preview .modal').modal() $('#show_preview .modal').height(function() { return $(window).height() * 0.7; }); - },'script'); + }}); }); $(".preview_trigger").click(function(){ $("#main-wrap").after(""); @@ -38,10 +45,10 @@ $(function() { // o.url = url.nodeValue; // o.type = 'post'; // },success: function(msg) { - // $('#show_preview .modal').modal() - // $('#show_preview .modal').height(function() { - // return $(window).height() * 0.7; - // }); + // $('#show_preview .modal').modal() + // $('#show_preview .modal').height(function() { + // return $(window).height() * 0.7; + // }); // } // }); diff --git a/app/controllers/admin/sites_controller.rb b/app/controllers/admin/sites_controller.rb index e4119661..7b0362e0 100644 --- a/app/controllers/admin/sites_controller.rb +++ b/app/controllers/admin/sites_controller.rb @@ -72,7 +72,10 @@ class Admin::SitesController < OrbitBackendController end def system_info - + @disk_free = `df -h /`.gsub("\n","
").html_safe + @nginx_version = %x[/opt/nginx/sbin/nginx -v 2>&1].gsub("\n","
").html_safe + @mongo_version = `mongod --version`.split("\n")[0].html_safe + @linux_version = `lsb_release -d`.split(":")[1].html_safe end def search_engine diff --git a/app/helpers/orbit_backend_helper.rb b/app/helpers/orbit_backend_helper.rb index f9256fbb..702baf4b 100644 --- a/app/helpers/orbit_backend_helper.rb +++ b/app/helpers/orbit_backend_helper.rb @@ -433,6 +433,10 @@ module OrbitBackendHelper res << "
  • #{t(:search_engine)}
  • " when 'site_info' res << "
  • #{t(:site_info)}
  • " + when 'update_manager' + res << "
  • #{t(:update_manager)}
  • " + when 'system_info' + res << "
  • #{t("site.system_preference")}
  • " end when 'items' res << "
  • #{t(:structure)}
  • " diff --git a/app/views/admin/items/_site_bar.html.erb b/app/views/admin/items/_site_bar.html.erb index a83af59a..30b293f8 100644 --- a/app/views/admin/items/_site_bar.html.erb +++ b/app/views/admin/items/_site_bar.html.erb @@ -22,8 +22,8 @@
  • <%= link_to admin_site_update_manager_path(@site), :class => active_for_action('sites', 'update_manager') do %><%end%>
  • - +
  • "><%= link_to admin_site_system_info_path(@site), :class => active_for_action('sites', 'system_info') do %><%end%>
  • + diff --git a/app/views/admin/sites/_side_bar.html.erb b/app/views/admin/sites/_side_bar.html.erb index a83af59a..30b293f8 100644 --- a/app/views/admin/sites/_side_bar.html.erb +++ b/app/views/admin/sites/_side_bar.html.erb @@ -22,8 +22,8 @@
  • <%= link_to admin_site_update_manager_path(@site), :class => active_for_action('sites', 'update_manager') do %><%end%>
  • - +
  • "><%= link_to admin_site_system_info_path(@site), :class => active_for_action('sites', 'system_info') do %><%end%>
  • + diff --git a/app/views/admin/sites/show_system_preference.html.erb b/app/views/admin/sites/show_system_preference.html.erb deleted file mode 100644 index 6640a416..00000000 --- a/app/views/admin/sites/show_system_preference.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -

    <%= I18n.t("site.system_preference") %>

    - - -
    -
    -

    <%= I18n.t("site.system_preference_.summary.disk_space") %>:

    - <%= content_tag :p,@site.disk_space.gsub(/\n/,"
    ").html_safe if @site.disk_space %> -

    <%= I18n.t("site.system_preference_.summary.code_update_at") %>:

    - <% @site.system_package_info.each do |index,value| %> -

    <%= index.titleize %> <%= I18n.t("site.system_preference_.summary.version") %>:

    - <%= content_tag :p,value %> - <% end %> -

    <%= I18n.t("site.system_preference_.summary.weekness_report") %>:<%= '' %>

    -
    -
    - <% if @git_commit_list_file %> - <% @git_commit_list_file.lines do |line|%> - <%= line %>
    - <% end%> - <% else %> -
    <%= I18n.t("site.system_preference_.summary.no_data") %>
    - <% end %> -
    -
    - <%if @db_backup_list_file %> - <% @db_backup_list_file.lines do |line|%> - <%=line %>
    - <% end %> - <% else %> -
    <%= I18n.t("site.system_preference_.summary.no_data") %>
    - <% end %> -
    -
    - <%if @db_backup_list_file %> - <% @resque_logs_file.lines do |line|%> - <%=line %>
    - <% end if @resque_logs_file%> - <%else %> -
    <%= I18n.t("site.system_preference_.summary.no_data") %>
    - <% end %> -
    -
    \ No newline at end of file diff --git a/app/views/admin/sites/system_info.html.erb b/app/views/admin/sites/system_info.html.erb index 1ce43e46..60ef9b1b 100644 --- a/app/views/admin/sites/system_info.html.erb +++ b/app/views/admin/sites/system_info.html.erb @@ -1,5 +1,159 @@ +<%= stylesheet_link_tag "lib/wrap-nav" %> +<%= stylesheet_link_tag "lib/main-list" %> +<%= stylesheet_link_tag "lib/main-forms" %> +<%= stylesheet_link_tag "lib/fileupload.css" %> +<%= stylesheet_link_tag "lib/togglebox.css" %> +<%= stylesheet_link_tag "lib/list-check.css" %> + +<%= javascript_include_tag "lib/site_set" %> +<%= javascript_include_tag "lib/list-check" %> + <% content_for :side_bar do %> <%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %> <% end %> -system_info.html.erb \ No newline at end of file +
    +
    +
    + + + +
    + +
    +

    <%= t("site.system_preference_.summary.disk_space") %>

    +
    +

    + <%= @disk_free %> +

    +
    +

    Nginx <%= t("site.system_preference_.summary.version") %>

    +
    +

    + <%= @nginx_version %> +

    +
    + +

    MongoDB <%= t("site.system_preference_.summary.version") %>

    +
    +

    + <%= @mongo_version %> +

    +
    +

    Linux <%= t("site.system_preference_.summary.version") %>

    +
    +

    + <%= @linux_version %> +

    +
    + +
    + + +
    + +
    +
    +

    + +

    + + + + + + + + + + + + + + + + + + + + + +
    + + <%= t(:sent_date) %><%= t(:subject) %><%= t(:mail_to) %><%= t(:mail_user) %><%= t(:mail_from_app) %>
    + + 2014-01-16 17:57【轉知】國家教育研究院辦理普通高級中學語文及社會領域課綱微調分區公聽會 + + alluser@tea.ntue.edu.tw蔣 欣潔er_email
    +
    +
    +

    + +

    + + + + + + + + + + + + + + + + + + + + + +
    + + SentdateSubjectMail ToMail UserMail From App
    + + 2014-01-16 17:57【轉知】國家教育研究院辦理普通高級中學語文及社會領域課綱微調分區公聽會 + + alluser@tea.ntue.edu.tw蔣 欣潔er_email
    +
    +
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/app/views/shared/preview/_modal_preview.html.erb b/app/views/shared/preview/_modal_preview.html.erb index ba53d1e6..d1c1f82c 100644 --- a/app/views/shared/preview/_modal_preview.html.erb +++ b/app/views/shared/preview/_modal_preview.html.erb @@ -41,7 +41,7 @@ function InsertPreviewImage(){ if($("iframe").contents().find('.news_image').length){ - $("iframe").contents().find('.news_image').append(""); + $("iframe").contents().find('.news_image').append(""); }else{ setTimeout(InsertPreviewImage,1000); } diff --git a/config/locales/en.yml b/config/locales/en.yml index c7f91ff4..86a2101c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -192,6 +192,8 @@ en: link: Editing link page: Editing page email: Email + email_log: Email Log + email_queue: Waiting to be sent enable: Enable enabled_for: Enabled for end: End @@ -274,6 +276,9 @@ en: setting: Mail settings tls: TLS user_name: User Name + mail_from_app: Mail From App + mail_to: Mail To + mail_user: Mail User manager: Manager markup: Markup markup_options: Markup options @@ -424,6 +429,7 @@ en: index: Index summary: Summary thumbnail: Thumbnail + sent_date: Sent Date settings: Site Setting site: backend_openness_on: Backend Openness @@ -454,6 +460,7 @@ en: tab_commits: Commits tab_summary: Summary tab_logs: Logs + tab_send_reminders_log: Send reminders log summary: code_update_at: Code Update histroy disk_space: Disk Free @@ -483,6 +490,7 @@ en: sub_role: Sub Role sub_role_field: Sub Role Field sub_role_info: " Sub Role Info." + subject: Subject subtitle: Subtitle submit: Submit submit_approval: Submit approval @@ -506,6 +514,7 @@ en: text: Text theme: Theme themes: Themes + this_action_can_not_be_restore: This action can not be restored, are you sure you want to delete? title: Title to_search: Set as Search Key to_show: Display in frontend diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index d0e2d70a..a5493fb6 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -192,6 +192,8 @@ zh_tw: link: 編輯連結 page: 編輯頁面 email: 電子郵件 + email_log: 寄送紀錄 + email_queue: 待寄送郵件 enable: 開啟 enabled_for: 啟用 end: 結束 @@ -276,6 +278,9 @@ zh_tw: setting: 電子郵件設定 tls: 電子郵件TLS user_name: 電子郵件帳號 + mail_from_app: 寄送模組 + mail_to: 收件者 + mail_user: 寄件者 manager: 管理者 markup: 輸入模式 markup_options: 標註選項 @@ -426,6 +431,7 @@ zh_tw: index: 檢索 summary: 摘要 thumbnail: 縮圖 + sent_date: 寄送日期 settings: 基本設定 site: frontend_closed: 前台關閉? @@ -456,6 +462,7 @@ zh_tw: tab_commits: 程式版本 tab_summary: 總覽 tab_logs: 排程工作日誌 + tab_send_reminders_log: 寄送提醒紀錄 summary: code_update_at: 程式更新紀錄 disk_space: 硬碟空間 @@ -485,6 +492,7 @@ zh_tw: sub_role: 子身份 sub_role_field: 子身份欄位 sub_role_info: 子身份資料 + subject: 主題 subtitle: 副標題 submit: 送出 submit_approval: 送出已核准 @@ -508,6 +516,7 @@ zh_tw: text: 內文 theme: 套用頁面樣式 themes: 主題 + this_action_can_not_be_restore: 刪除後將無法還原,您確定要刪除嗎? title: 標題 to_search: 加入搜尋條件 to_show: 是否顯示於前台 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 f44c7cbc..de369ee3 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 @@ -10,6 +10,7 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController end def preview + params['bulletin']['image'] = nil bulletin = Bulletin.new params @preview_obj = bulletin.to_preview @preview_obj.save