diff --git a/Gemfile b/Gemfile index a9813caa..1e6ce8fc 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ gem 'rails', '>=3.1.0.rc4' gem 'yajl-ruby', :require => 'yajl' gem 'bson_ext' -gem 'carrierwave', '0.5.6' +gem 'carrierwave', '0.5.4' gem 'ckeditor' gem 'devise' gem 'mini_magick' diff --git a/Gemfile.lock b/Gemfile.lock index 7177ff7e..74e4c8c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -36,7 +36,7 @@ GEM bson (1.3.1) bson_ext (1.3.1) builder (3.0.0) - carrierwave (0.5.6) + carrierwave (0.5.4) activesupport (~> 3.0) chronic (0.6.2) ckeditor (3.6.1) @@ -171,7 +171,7 @@ PLATFORMS DEPENDENCIES bson_ext - carrierwave (= 0.5.6) + carrierwave (= 0.5.4) ckeditor coffee-rails (~> 3.1.0.rc) delorean diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index d6992c71..a0f4231e 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -21,14 +21,11 @@ class Admin::PagesController < ApplicationController @item = Page.new @item.is_published = true @item.parent_id = @parent_item.id rescue nil + @designs = Design.all.entries + @default_design = @designs.detect {|d| d.title.to_s == 'Bob' } end def edit - @item = Page.find(params[:id]) - # @item.content = parse_content(@item.content, {:locale => 'show'}) - @item.content = parse_page_code(@item) - @i18n_variable = @item.i18n_variable - @code = params[:code] end def create @@ -51,19 +48,6 @@ class Admin::PagesController < ApplicationController end def update - @item = Page.find(params[:id]) - parse_content_update_code(@item, params[:page][:content]) - if @item.update_attributes(params[:item]) - flash[:notice] = t('admin.update_success_page') - respond_to do |format| - format.html { - redirect_to admin_page_url(@item) - } - format.js {} - end - else - render :action => "edit" - end end def destroy diff --git a/app/helpers/admin/item_helper.rb b/app/helpers/admin/item_helper.rb index 7994cb25..e91265fc 100644 --- a/app/helpers/admin/item_helper.rb +++ b/app/helpers/admin/item_helper.rb @@ -12,7 +12,6 @@ module Admin::ItemHelper ret << "
- <%= f.submit t(:update) %> <%= link_back %> -
-<% 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 54ee892f..4afc26e7 100644 --- a/app/views/admin/pages/_form.html.erb +++ b/app/views/admin/pages/_form.html.erb @@ -15,8 +15,14 @@ <% end %>-<%= f.label :design_id, t('admin.design_name') %> -<%= f.select :design_id, Design.all.map{ |l| [l.title, l.id] } %> + <%= t('admin.design_name') %> + <%= f.select :design_id, @designs.collect { |d| [d.title, d.id] }, :selected => @default_design.id %> +
++ <%= @item.design.inspect %> + <%= t('admin.theme') %> + <%= f.select :theme_id, @default_design.themes.collect { |t| [t.name, t.id] }, :selected => @default_design.themes.detect {|t| t.file_filename.to_s == 'default.css' }.id %> + <%#= f.collection_select :design, @designs, :id, :title %>
diff --git a/app/views/admin/pages/_form_code.html.erb b/app/views/admin/pages/_form_code.html.erb deleted file mode 100644 index ad0e55ed..00000000 --- a/app/views/admin/pages/_form_code.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= f.error_messages %> - -<%= f.text_area :content %> \ No newline at end of file diff --git a/app/views/admin/pages/edit.html.erb b/app/views/admin/pages/edit.html.erb deleted file mode 100644 index b4bfc607..00000000 --- a/app/views/admin/pages/edit.html.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% content_for :sidebar do %> - <%= render 'admin/items/site_map_left_bar' %> -<% end -%> - -
- <%= f.submit t('update') %> <%= link_back %> - -
-<% end %> diff --git a/app/views/admin/pages/edit.js.erb b/app/views/admin/pages/edit.js.erb deleted file mode 100644 index 9c61245e..00000000 --- a/app/views/admin/pages/edit.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#panel_main').html("<%= escape_javascript(render(:partial => @code ? 'edit_code' : 'edit')) %>"); \ No newline at end of file diff --git a/app/views/admin/pages/show.html.erb b/app/views/admin/pages/show.html.erb index 6dd0f923..d6b6a8a2 100644 --- a/app/views/admin/pages/show.html.erb +++ b/app/views/admin/pages/show.html.erb @@ -2,4 +2,4 @@ <%= render 'admin/items/site_map_left_bar' %> <% end -%> -<%= render @code ? 'show_code' : 'show' %> \ No newline at end of file +<%= render 'show' %> \ No newline at end of file diff --git a/app/views/admin/pages/update.js.erb b/app/views/admin/pages/update.js.erb deleted file mode 100644 index 20cb22c1..00000000 --- a/app/views/admin/pages/update.js.erb +++ /dev/null @@ -1,2 +0,0 @@ -$('#panel_main').html("<%= escape_javascript(render(:partial => 'admin/pages/show')) %>"); -history.pushState(null, document.title, "<%= escape_javascript(admin_page_url(@item)) %>"); diff --git a/lib/fraisier/themes/red.css b/lib/fraisier/themes/red.css new file mode 100644 index 00000000..97097ed2 --- /dev/null +++ b/lib/fraisier/themes/red.css @@ -0,0 +1 @@ +/* Some css */ \ No newline at end of file diff --git a/lib/parser.rb b/lib/parser.rb index 83e5bcf8..a5299af3 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -105,12 +105,6 @@ module Parser end end - def parse_content(page_content, attributes = {}) - context = parser_context(page_content, attributes) - parser = Radius::Parser.new(context, :tag_prefix => 'r') - parser.parse(page_content) - end - def parse_page(page) if page._type == 'Page' layout_content = page.design.layout.content @@ -214,33 +208,6 @@ module Parser end end - def parse_page_code(page) - layout_content = page.design.layout.content - context = parser_context_code(page) - parser = Radius::Parser.new(context, :tag_prefix => 'r') - parser.parse(layout_content) - end - - def parser_context_code(page) #context should be interpretd as the orginally one - Radius::Context.new do |c| - c.define_tag 'stylesheets' do |tag| - res << "