diff --git a/app/controllers/admin/imports_controller.rb b/app/controllers/admin/imports_controller.rb index 0a4ced95..9e58c86a 100644 --- a/app/controllers/admin/imports_controller.rb +++ b/app/controllers/admin/imports_controller.rb @@ -23,7 +23,10 @@ module Admin def create begin - job = Locomotive::Import::Job.new(params[:zipfile], current_site) + job = Locomotive::Import::Job.new(params[:zipfile], current_site, { + :samples => Boolean.set(params[:samples]), + :reset => Boolean.set(params[:reset]) + }) Delayed::Job.enqueue job, { :site => current_site, :job_type => 'import' } diff --git a/app/views/admin/imports/new.html.haml b/app/views/admin/imports/new.html.haml index 60cb76d5..a5b58cc0 100644 --- a/app/views/admin/imports/new.html.haml +++ b/app/views/admin/imports/new.html.haml @@ -18,12 +18,12 @@ %p.inline-errors= @error %p.inline-hints= t('formtastic.hints.import.source') - %li.input + %li.input.toggle = label_tag 'samples', t('formtastic.labels.import.new.samples') = check_box_tag 'samples' %p.inline-hints= t('formtastic.hints.import.samples') - %li.input + %li.input.toggle = label_tag 'reset', t('formtastic.labels.import.new.reset') = check_box_tag 'reset' %p.inline-hints= t('formtastic.hints.import.reset') diff --git a/app/views/admin/snippets/index.html.haml b/app/views/admin/snippets/index.html.haml deleted file mode 100644 index a118fff8..00000000 --- a/app/views/admin/snippets/index.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -- title t('.title') - -- content_for :submenu do - = render 'admin/shared/menu/settings' - -- content_for :buttons do - = admin_button_tag :new, new_admin_snippet_url, :class => 'new' - -%p!= t('.help') - -- if @snippets.empty? - %p.no-items!= t('.no_items', :url => new_admin_snippet_url) -- else - %ul#snippets-list.list - = render @snippets diff --git a/app/views/admin/theme_assets/index.html.haml b/app/views/admin/theme_assets/index.html.haml index bd7cc409..7928fb1c 100644 --- a/app/views/admin/theme_assets/index.html.haml +++ b/app/views/admin/theme_assets/index.html.haml @@ -12,7 +12,7 @@ %h3!= t('.snippets') - if @snippets.empty? - %p.no-items!= t('.no_items', :url => new_admin_snippet_url) + %p.no-items!= t('admin.snippets.index.no_items', :url => new_admin_snippet_url) - else %ul.list.theme-assets = render @snippets diff --git a/config/locales/admin_ui_en.yml b/config/locales/admin_ui_en.yml index 777c2767..f971039e 100644 --- a/config/locales/admin_ui_en.yml +++ b/config/locales/admin_ui_en.yml @@ -325,6 +325,8 @@ en: import: new: source: File + samples: Copy samples + reset: Reset site hints: page: @@ -347,4 +349,6 @@ en: hint: "Text displayed in the model form just below the field" import: source: "A zipfile containing a database.yml along with assets and templates" + samples: "If enabled, the import process will also copy contents and assets" + reset: "If enabled, all the data of your site will be destroyed before importing the new site" diff --git a/config/locales/admin_ui_fr.yml b/config/locales/admin_ui_fr.yml index 882e073d..55106098 100644 --- a/config/locales/admin_ui_fr.yml +++ b/config/locales/admin_ui_fr.yml @@ -297,6 +297,8 @@ fr: import: new: source: Fichier + samples: Copier contenu + reset: Remettre à zéro hints: page: @@ -319,3 +321,5 @@ fr: hint: "Texte affiché dans le formulaire de l'élément juste en dessous du champ." import: source: "Un fichier zip contenant database.yml, les fichiers du thème et les templates de page" + samples: "Si activé, les contenus et les média seront aussi copiés lors de l'import" + reset: "Si activé, toutes les données de votre site seront détruites avant l'import du nouveau site" diff --git a/doc/TODO b/doc/TODO index ab5be540..597bb634 100644 --- a/doc/TODO +++ b/doc/TODO @@ -5,10 +5,6 @@ BOARD: - editable elements should wrap a tag: div, h1, ...etc (default span) - edit images (upload new ones, ...etc) => wait for aloha or send them an email ? -- import tools - - give choice to reset site / add samples - - french translatations - - refactor slugify method (use parameterize + create a module) - [content types] the "display column" selector should not include file types @@ -143,6 +139,8 @@ x import tool: x asset collections x page templatized (tied to content type) x remove existing pages / contents option => reset + x give choice to reset site / add samples + x french translatations x cosmetic / ui bugs / bugs: x segmentation fault with with_scope x paginate is not working diff --git a/public/stylesheets/admin/inline_editor.css b/public/stylesheets/admin/inline_editor.css index 5c611b93..235184ab 100644 --- a/public/stylesheets/admin/inline_editor.css +++ b/public/stylesheets/admin/inline_editor.css @@ -6,7 +6,8 @@ background: transparent url('/images/admin/inline_editor/bg.png') repeat-x 0 0; padding: 0 10px; font-family: Helvetica; - -webkit-box-shadow: -3px 3px 12px #818181; + -webkit-box-shadow: -3px 3px 12px rgba(0, 0, 0, 0.4); + -moz-box-shadow: -3px 3px 12px rgba(0, 0, 0, 0.4); z-index: 999; } @@ -23,13 +24,17 @@ #page-toolbar ul li.link a { display: block; background: transparent url('/images/admin/inline_editor/action-left.png') no-repeat 0 0; - height: 21px; + height: 19px; + line-height: 19px; padding-left: 24px; text-decoration: none; color: #fff; outline: none; + border: 0px; + font-size: 12px; } +#page-toolbar ul li.link a:active { border: 0px; text-decoration: none; color: #fff; top: 0px; } #page-toolbar ul li.link a:hover span { text-decoration: underline; } #page-toolbar ul li.save a { background-position: 0 -21px; } @@ -42,7 +47,7 @@ #page-toolbar ul li.link a span { display: block; background: transparent url('/images/admin/inline_editor/action-right.png') no-repeat right 0; - height: 20px; + height: 19px; padding: 1px 10px 0 2px; text-shadow: 1px 1px 1px #000; } @@ -60,12 +65,17 @@ height: 10px; background: transparent url('/images/admin/inline_editor/drawer.png') no-repeat 0 0; text-decoration: none; + border: 0px; + padding: 0px; + margin: 0px; } #page-toolbar ul li.drawer a.off { background-position: 0 -10px; } +#page-toolbar ul li.drawer a:active { border: 0px; text-decoration: none; top: 6px; padding: 0px; } + #page-toolbar ul li.spinner a { padding-left: 24px; position: relative; @@ -87,4 +97,9 @@ border-left: 1px solid #56575e; } -#page-toolbar ul li.clear { clear: both; } \ No newline at end of file +#page-toolbar ul li.clear { clear: both; } + +/* ___ aloha ___ */ + +.x-tab-panel a.x-tab-right { border-bottom: 0px; padding-bottom: 0px; } +.x-tab-panel input[type=text] { border: 1px solid gray; border-spacing: 2px; -webkit-border-radius: 0px; -webkit-box-shadow: none; background: #fff; color: #000; padding: 2px; } \ No newline at end of file