From ef2d416c705b94953d137eacf44d556ec2a1fde2 Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Sun, 13 May 2012 19:36:04 +0800 Subject: [PATCH] Ray's changes for page_edit --- app/assets/images/editicon.png | Bin 0 -> 2935 bytes app/assets/stylesheets/sidebar.css.erb | 1 + app/assets/stylesheets/style.css.erb | 28 +++++- app/views/admin/pages/_edit.html.erb | 17 ++-- app/views/admin/pages/_form.html.erb | 128 ++++++++++++++++--------- lib/parsers/parser_back_end.rb | 2 +- 6 files changed, 121 insertions(+), 55 deletions(-) create mode 100644 app/assets/images/editicon.png diff --git a/app/assets/images/editicon.png b/app/assets/images/editicon.png new file mode 100644 index 0000000000000000000000000000000000000000..cef3e600041b8e110bc9050067807b87953ad38d GIT binary patch literal 2935 zcmai03p7;g9v?K`(JjVX(%bQEqTFiimR~qR`OK7ffYM z%#9=lQGGt!QoVV?qNP$15s8$^WC)oHLMVj$mJ~KMDgO- zPsX_%BoGVm0fAJa!lIY4sw@QrEW`g&md{^COQb=-e`EVgw1l}|1R#R|i7;NwQ58AT zPVJV6ND%{UsZh)m3S+-yoDnUQ3MJ7(5tI^)L!hAnYz|MLKKT;^pt7ZaCrp)p3><}n zqg|LN6cK|ZqVUcrJQ0QZ0~#RY@*?;D4-~^hyQ-mB7iZOG8LBEimn~)gUoe+Lj1-Fb zY*ht#>V8Fv1W})?1q2Z30*RC@-~e>0CrlL_g2&?$2^1{e2Tk=Mpzs(pnuhjv!{I0x z0@erbL&f=^v0u1UAtzp4hc8_2GM9$>Dp%dn>Piu*fS8v6aDBu=KJ-&Hh`g`+Lj9`V zXD;`vzEEjjdllt z7%1guGIyBYEKizL7L^PaDXIDjU6^+&?08qs;_714yi985a9&!a7{G+(Wt2dk zg}l=wAK{tt*YlAc~4E@^jJ+bdl9 z^-bB5q!$-`V}Z)Ov%Wj&n8oec&6Espc%0t4CAmq~4U?n0y51E$9p|UH9>Sh(+n?zl zWfTUsIPs0XUl(C7%=Xe=>AQeyHF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BpW!LV7eJe>!X1b`uZH=9Y*-NXW;B#gDa3BkXQBBq+1kjNct4#K!dS z8YkYB7z*8V@uy_)eC`4KOO)~$z5eERM^Rx^JYR?9X9lk7+tc==+4CX4s=4vR%1MZR zJj)hBcWq!Wh#(4!F!O)rT#@cYZ$T7DUvmdoVHlUny*0QVT>L8Wv48`wee(!}B zPv*4vp7j|jDesXMGBO^)x~I3uZM$O}@_8(SyVj01ekMIPo*?fwX8?f?dnhaL4lc>K z=ndj3vsurJqdoffD*D!9M92)5+$VR{O4BD21#7~b_%CufTRXiyJo-haucb%h7+M(vDtP2U1!-BT@* zt$l~#hb!jygb?jLhjy&`Z{sM8JyF*5(R z@3RkGUaw(RUmBQ*{#J)pTzbX&_4v=%b40J{YtF*ry$IQe%g_CKxJB!_S(nU%pR;JK z5ADq+z-~M5R~*rIb~m5|mOVLn$CT~61C7=cE1X5i%r^8;{M=7 zq3xNi<61lSWliI|Wrl~tG=|!b-#nG^YAJVMYy9XFP+@V{E9D}LVi1>-IvP|wX!jm- zKBPmc^UCwiyP$^1>6xqZJt1WyQS1JG+9V1B6HZf8p7|}h946bhx2;G&q}hkQd$4KO d{Bti2ZBWFK~`XBEIp0WS{ literal 0 HcmV?d00001 diff --git a/app/assets/stylesheets/sidebar.css.erb b/app/assets/stylesheets/sidebar.css.erb index 15922cc0..1e4b4010 100644 --- a/app/assets/stylesheets/sidebar.css.erb +++ b/app/assets/stylesheets/sidebar.css.erb @@ -11,6 +11,7 @@ } .nav-list ol li { padding: 5px 0; + list-style: none; } .nav-list ol li a { font-size: 13px; diff --git a/app/assets/stylesheets/style.css.erb b/app/assets/stylesheets/style.css.erb index c4b2e93c..ba1c3066 100644 --- a/app/assets/stylesheets/style.css.erb +++ b/app/assets/stylesheets/style.css.erb @@ -110,10 +110,8 @@ padding:6px; } #orbit-bar .nav > li.search { - background-image: none; overflow: hidden; width: 28px; - margin-bottom: 0; position: relative; } #orbit-bar .nav > li > a.orbit-bar-home { @@ -686,6 +684,32 @@ z-index: 2 !important; } +#back_main .editable { + position: relative; +} +#back_main .editable:after { + content: ''; + clear: both; + display: block; + visibility: hidden; + height: 0; +} + +#back_main .edit_link a { + position: absolute; + z-index: 10; + width: 100%; + height: 100%; + top: 0; + left: 0; + text-indent: -9999px; + background: url(<%= asset_path 'editicon.png' %>) no-repeat center center rgba(255,255,255,.8); + -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 1); + -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 1); + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 1); +} + + [class^="icons-"] { display: inline-block; width: 16px; diff --git a/app/views/admin/pages/_edit.html.erb b/app/views/admin/pages/_edit.html.erb index 61ff8046..b2da28d0 100644 --- a/app/views/admin/pages/_edit.html.erb +++ b/app/views/admin/pages/_edit.html.erb @@ -1,10 +1,11 @@ <%= flash_messages %> - -

<%= t('admin.editing_page') %>

- -<%= form_for @item, :url => admin_page_path(@item) do |f| %> - <%= render :partial => "form", :locals => { :f => f } %> -

- <%= f.submit t('update') %> <%= link_back %> -

+
+

<%= t('admin.editing_page') %>

+ <%= form_for @item, :url => admin_page_path(@item), :html => { :class => 'form-horizontal edit_page' } do |f| %> + <%= render :partial => "form", :locals => { :f => f } %> +
+ <%= f.submit t('update'), :class => 'btn btn-primary' %> + <%= link_to t('cancel'), get_go_back, :class=>"btn" %> +
+
<% end %> \ No newline at end of file diff --git a/app/views/admin/pages/_form.html.erb b/app/views/admin/pages/_form.html.erb index 7aae7c00..94632b57 100644 --- a/app/views/admin/pages/_form.html.erb +++ b/app/views/admin/pages/_form.html.erb @@ -1,52 +1,92 @@ <%= f.error_messages %> <%= f.hidden_field :parent, :value => (@item.parent.id rescue nil) %> -

-<%= f.label :name, t('admin.name') %> -<%= f.text_field :name, :class => 'text' %> -

+
+ <%= f.label :name, t('admin.name'), :class => 'control-label' %> +
+ <%= f.text_field :name, :class => 'text input-xlarge' %> +

In addition to freeform text, any HTML5 text-based input appears like so.

+
+
<%= f.fields_for :i18n_variable, (@item.new_record? ? @item.build_i18n_variable : @item.i18n_variable) do |f| %> - <% @site_valid_locales.each do |locale| %> -

- <%= f.label :locale, "#{t('admin.title')} #{I18nVariable.from_locale(locale)}" %> - <%= f.text_field locale %> -

- <% end %> + <% @site_valid_locales.each do |locale| %> +
+ <%= f.label :locale, "#{t('admin.title')} #{I18nVariable.from_locale(locale)}", :class => 'control-label' %> +
+ <%= f.text_field locale, :class => 'text input-xlarge' %> +

In addition to freeform text, any HTML5 text-based input appears like so.

+
+
+ <% end %> <% end %> -

- <%= t('admin.design_name') %> - <%= f.collection_select :design, @designs, :id, :title, {:selected => @design.id}, {:rel => admin_pages_path} %> -

-

- <%= t('admin.theme') %> - <%= f.select :theme_id, @design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %> -

-

- <%= t('admin.module_app') %> - <%= render :partial => "app_selector", :locals => { :f => f } %> - <%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%> - <%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category], :include_blank => true ) rescue ''%> -

-

- <%= f.label :is_published, "#{t('admin.is_published')} ?" %> - <%= f.radio_button :is_published, true %>Yes <%= f.radio_button :is_published, false %> No -

-

- <%= f.label :menu_enabled_for, "#{t('admin.menu_enabled_for')}:" %> - <% @site_valid_locales.each do |valid_locale| %> - <%= check_box_tag 'page[menu_enabled_for][]', valid_locale, (@item.menu_enabled_for.nil? ? true : @item.menu_enabled_for.include?(valid_locale)) %> - <%= I18nVariable.from_locale(valid_locale) %> - <% end %> - <%= hidden_field_tag 'page[menu_enabled_for][]', '' %> -

-

- <%= f.label :enabled_for, "#{t('admin.enabled_for')}:" %> - <% @site_valid_locales.each do |valid_locale| %> - <%= check_box_tag 'page[enabled_for][]', valid_locale, (@item.enabled_for.nil? ? true : @item.enabled_for.include?(valid_locale)) %> - <%= I18nVariable.from_locale(valid_locale) %> - <% end %> - <%= hidden_field_tag 'page[enabled_for][]', '' %> -

+
+ <%= f.label :name, t('admin.design_name'), :class => 'control-label' %> +
+ <%= f.collection_select :design, @designs, :id, :title, {:selected => @design.id}, {:rel => admin_pages_path} %> +

In addition to freeform text, any HTML5 text-based input appears like so.

+
+
+
+ <%= f.label :name, t('admin.theme'), :class => 'control-label' %> +
+ <%= f.select :theme_id, @design.themes.collect { |t| [t.name.capitalize, t.id] }, :include_blank => true %> +

In addition to freeform text, any HTML5 text-based input appears like so.

+
+
+
+ <%= f.label :name, t('admin.module_app'), :class => 'control-label' %> +
+ <%= render :partial => "app_selector", :locals => { :f => f } %> + + <%= select('page','app_frontend_url', @app_frontend_urls, :selected => @item.app_frontend_url ) rescue ''%> + + + <%= select('page','category', @categories.collect{|category| [category.i18n_variable[I18n.locale], category.id]}, :selected => @item[:category], :include_blank => true ) rescue ''%> + +

In addition to freeform text, any HTML5 text-based input appears like so.

+
+
+
+ <%= f.label :is_published, "#{t('admin.is_published')} ?", :class => 'control-label' %> +
+ + +

In addition to freeform text, any HTML5 text-based input appears like so.

+
+
+
+ <%= f.label :menu_enabled_for, "#{t('admin.menu_enabled_for')}:", :class => 'control-label' %> +
+ <% @site_valid_locales.each do |valid_locale| %> + + <% end %> + <%= hidden_field_tag 'page[menu_enabled_for][]', '' %> +

In addition to freeform text, any HTML5 text-based input appears like so.

+
+
+ +
+ <%= f.label :enabled_for, "#{t('admin.enabled_for')}:", :class => 'control-label' %> +
+ <% @site_valid_locales.each do |valid_locale| %> + + <% end %> + <%= hidden_field_tag 'page[enabled_for][]', '' %> +

In addition to freeform text, any HTML5 text-based input appears like so.

+
+
diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb index e9c08a01..03141df2 100644 --- a/lib/parsers/parser_back_end.rb +++ b/lib/parsers/parser_back_end.rb @@ -50,7 +50,7 @@ module ParserBackEnd ret << "'>" else part = page.page_parts.detect{ |p| p.name.to_s == content['name'].to_s } rescue nil - ret << "
" if part + ret << "
" if part ret << "'