Git Product home page Git Product logo

refinerycms-copywriting's Introduction

Copywriting engine for Refinery CMS

Build Status

How do you manage your string in RefineryCMS?

Extended copywriting management: extract all your strings and leave no human word behind + i18n.

Do like this

<%= copywriting('phone number', { :scope => 'header', :default => '1-800-888-5555' }) %>

Or using block

<%= copywriting('slogan', { :scope => 'header' }) do %>
  Insert a slogan here
<% end %>

Just give it a name anyway

<%= copywriting('note1') %>

When it get more complex, avoid redundant options hash with options block

<% copywriting_options({ :scope => 'header', :phrase_type => 'wysiwyg' }) do %>
  ...
  <%= copywriting('contact information').html_safe do %>
    ...
  <% end %>
  ...
  <%= copywriting('phone number', { :phrase_type => 'string', :default => '1-800-888-5555' }) %>
  ...
<% end %>

Then edit the copywriting from the backend:

screenshot

Okay, but now, what if you want to have a string that change on every page, like a slogan?

Pass the @page object in the options hash:

<%= copywriting('slogan', { :scope => 'header', :page => @page }) do %>
  Insert a slogan here
<% end %>

screenshot

Install

# Gemfile
gem 'refinerycms-copywriting'
bundle
rails generate refinery:copywriting
rake db:migrate

Pull request?

Yes.

Helper method

copywriting('name', options) { ... optional block ... }

{
  :default => 'string...',        # if no block is given
  :page => @page,                 # the string will be scoped to the page, if no page_id option is provided
  :page_id => 1                   # using integer instead of page object
  :phrase_type => "wysiwyg"       # default is "text". Sets the type of field this is when editing. "string" gives you a single line text field. "text" gives you a multiline textarea. "wysiwyg" gives you the default Refinery visual editor.
}

copywriting_options(options) { ... use copywriting helper with default options hash ... }

refinerycms-copywriting's People

Contributors

arthurtalkgoal avatar bilus avatar bricesanchez avatar djones avatar dreamfall avatar ebeigarts avatar gotjosh avatar gwagener avatar jandupal avatar johanb avatar matfiz avatar mirosr avatar nashby avatar parndt avatar robyurkowski avatar rounders avatar timfjord avatar ugisozols avatar unixcharles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

refinerycms-copywriting's Issues

Non-text phrase types

It would be helpful if Copywriting would support non-text phrase types (e.g. images, resources, etc).

I understand if this goes too far from the intended purpose of the extension, but it seems like Copywriting might be the best of the existing extensions for adding extra metadata to pages, and this new functionality would be extremely helpful.

String type for value in translations

ActiveRecord::StatementInvalid (PGError: ERROR: value too long for type character varying(255)
2011-07-18T19:09:13+00:00 app[web.1]: : UPDATE "copywriting_phrase_translations" SET "value" = '

Международная компания
«Счастливая Реальность»
(Happy Everyday, Ltd),
создана как центр системного
развития гармоничной
личности в 2006г.


2011-07-18T19:09:13+00:00 app[web.1]:

Тренинги нашей компании
предназначены для успешных
людей, желающих осознать
свою суть и стать еще более
эффективными в
предъявлении себя

', "updated_at" = '2011-07-18 19:09:13.112089' WHERE "copywriting_phrase_translations"."id" = 1):

rake db:migrate shows error .

rake db:migrate

==  CreateCopywritings: migrating =============================================
-- create_table(:copywriting_phrases)
   -> 0.0149s
-- add_index(:copywriting_phrases, [:name, :scope])
   -> 0.0024s
==  CreateCopywritings: migrated (0.0248s) ====================================

==  CreateCopywritingTranslationTable: migrating ==============================
-- rename_column("copywriting_phrase_translations", :copywriting_phrase_id, :refinery_copywriting_phrase_id)
rake aborted!
An error has occurred, this and all later migrations canceled:

Index name 'temp_index_altered_copywriting_phrase_translations_on_copywriting_phrase_id' on table 'altered_copywriting_phrase_translations' is too long; the limit is 64 characters/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/schema_statements.rb:573:in `add_index_options'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/schema_statements.rb:351:in `add_index'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb:539:in `block in copy_table_indexes'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb:522:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb:522:in `copy_table_indexes'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb:515:in `copy_table'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb:488:in `move_table'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb:481:in `block in alter_table'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb:480:in `alter_table'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/sqlite_adapter.rb:458:in `rename_column'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:466:in `block in method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:438:in `block in say_with_time'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:438:in `say_with_time'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:458:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:334:in `method_missing'
/home/gloscon/Downloads/Te/db/migrate/20130911053328_create_copywriting_translation_table.refinery_copywriting.rb:17:in `up'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:370:in `up'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:410:in `block (2 levels) in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:410:in `block in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:129:in `with_connection'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:389:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:528:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:775:in `call'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:775:in `block in ddl_transaction'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/transactions.rb:208:in `transaction'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:775:in `ddl_transaction'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:719:in `block in migrate'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:700:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:700:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:570:in `up'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/migration.rb:551:in `migrate'
/usr/local/rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:193:in `block (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Please help :)

breaks site_bar

brand new refinerycms 2.0.3
only refinerycms-copywriting extra added in to Gemfile

if I comment out site bar partial and method call it works

NoMethodError in Refinery/pages#home

Showing /Users/ivan/.rvm/gems/ruby-1.9.3-p194/gems/refinerycms-core-2.0.3/app/views/refinery/_site_bar.html.erb where line #1 raised:

undefined method `refinery_user?' for #<#Class:0x007fa2b3244b60:0x007fa2b78c1340>
Extracted source (around line #1):


1: <% if refinery_user? && "#{controller_name}##{action_name}" != 'pages#preview' %>
2:   <% unless admin? # all required JS included by backend. %>
3:     <% content_for :stylesheets, stylesheet_link_tag('refinery/site_bar') unless !!local_assigns[:exclude_css] %>
4:     <%= yield(:stylesheets) unless local_assigns[:head] or local_assigns[:exclude_css] %>
Trace of template inclusion: app/views/layouts/application.html.erb

Rails.root: /Users/ivan/Development/vedanet

Application Trace | Framework Trace | Full Trace
/gems/refinerycms-core-2.0.3/app/views/refinery/_site_bar.html.erb:1:in `___sers_ivan__rvm_gems_ruby_______p____gems_refinerycms_core_______app_views_refinery__site_bar_html_erb__3437625627314673690_70168410868880'
/gems/actionpack-3.2.3/lib/action_view/template.rb:143:in `block in render'
/gems/activesupport-3.2.3/lib/active_support/notifications.rb:125:in `instrument'
/gems/actionpack-3.2.3/lib/action_view/template.rb:141:in `render'
/gems/actionpack-3.2.3/lib/action_view/renderer/partial_renderer.rb:265:in `render_partial'
/gems/actionpack-3.2.3/lib/action_view/renderer/partial_renderer.rb:238:in `block in render'
/gems/actionpack-3.2.3/lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `block in instrument'
/gems/activesupport-3.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `instrument'
/gems/actionpack-3.2.3/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
/gems/actionpack-3.2.3/lib/action_view/renderer/partial_renderer.rb:237:in `render'
/gems/actionpack-3.2.3/lib/action_view/renderer/renderer.rb:41:in `render_partial'
/gems/actionpack-3.2.3/lib/action_view/helpers/rendering_helper.rb:27:in `render'
app/views/layouts/application.html.erb:3:in `_app_views_layouts_application_html_erb__2530179061045854165_70168420227600'
/gems/actionpack-3.2.3/lib/action_view/template.rb:143:in `block in render'
/gems/activesupport-3.2.3/lib/active_support/notifications.rb:125:in `instrument'
/gems/actionpack-3.2.3/lib/action_view/template.rb:141:in `render'
/gems/actionpack-3.2.3/lib/action_view/renderer/template_renderer.rb:59:in `render_with_layout'
/gems/actionpack-3.2.3/lib/action_view/renderer/template_renderer.rb:45:in `render_template'
/gems/actionpack-3.2.3/lib/action_view/renderer/template_renderer.rb:18:in `render'
/gems/actionpack-3.2.3/lib/action_view/renderer/renderer.rb:36:in `render_template'
/gems/actionpack-3.2.3/lib/action_view/renderer/renderer.rb:17:in `render'
/gems/actionpack-3.2.3/lib/abstract_controller/rendering.rb:110:in `_render_template'
/gems/actionpack-3.2.3/lib/action_controller/metal/streaming.rb:225:in `_render_template'
/gems/actionpack-3.2.3/lib/abstract_controller/rendering.rb:103:in `render_to_body'
/gems/actionpack-3.2.3/lib/action_controller/metal/renderers.rb:28:in `render_to_body'
/gems/actionpack-3.2.3/lib/action_controller/metal/compatibility.rb:50:in `render_to_body'
/gems/actionpack-3.2.3/lib/abstract_controller/rendering.rb:88:in `render'
/gems/actionpack-3.2.3/lib/action_controller/metal/rendering.rb:16:in `render'
/gems/actionpack-3.2.3/lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render'
/gems/activesupport-3.2.3/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
/Users/ivan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/gems/activesupport-3.2.3/lib/active_support/core_ext/benchmark.rb:5:in `ms'
/gems/actionpack-3.2.3/lib/action_controller/metal/instrumentation.rb:40:in `block in render'
/gems/actionpack-3.2.3/lib/action_controller/metal/instrumentation.rb:83:in `cleanup_view_runtime'
/gems/activerecord-3.2.3/lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
/gems/actionpack-3.2.3/lib/action_controller/metal/instrumentation.rb:39:in `render'
/gems/refinerycms-pages-2.0.3/lib/refinery/pages/instance_methods.rb:28:in `render_with_presenters'
/gems/actionpack-3.2.3/lib/action_controller/metal/implicit_render.rb:10:in `default_render'
/gems/actionpack-3.2.3/lib/action_controller/metal/implicit_render.rb:5:in `send_action'
/gems/actionpack-3.2.3/lib/abstract_controller/base.rb:167:in `process_action'
/gems/actionpack-3.2.3/lib/action_controller/metal/rendering.rb:10:in `process_action'
/gems/actionpack-3.2.3/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:458:in `_run__2281924430559390808__process_action__3156516921902887797__callbacks'
/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
/gems/actionpack-3.2.3/lib/abstract_controller/callbacks.rb:17:in `process_action'
/gems/actionpack-3.2.3/lib/action_controller/metal/rescue.rb:29:in `process_action'
/gems/actionpack-3.2.3/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `block in instrument'
/gems/activesupport-3.2.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/gems/activesupport-3.2.3/lib/active_support/notifications.rb:123:in `instrument'
/gems/actionpack-3.2.3/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/gems/actionpack-3.2.3/lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
/gems/activerecord-3.2.3/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/gems/actionpack-3.2.3/lib/abstract_controller/base.rb:121:in `process'
/gems/actionpack-3.2.3/lib/abstract_controller/rendering.rb:45:in `process'
/gems/actionpack-3.2.3/lib/action_controller/metal.rb:203:in `dispatch'
/gems/actionpack-3.2.3/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/gems/actionpack-3.2.3/lib/action_controller/metal.rb:246:in `block in action'
/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:73:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:36:in `call'
/gems/journey-1.0.3/lib/journey/router.rb:68:in `block in call'
/gems/journey-1.0.3/lib/journey/router.rb:56:in `each'
/gems/journey-1.0.3/lib/journey/router.rb:56:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:600:in `call'
/gems/railties-3.2.3/lib/rails/engine.rb:479:in `call'
/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
/gems/journey-1.0.3/lib/journey/router.rb:68:in `block in call'
/gems/journey-1.0.3/lib/journey/router.rb:56:in `each'
/gems/journey-1.0.3/lib/journey/router.rb:56:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:600:in `call'
/gems/warden-1.1.1/lib/warden/manager.rb:35:in `block in call'
/gems/warden-1.1.1/lib/warden/manager.rb:34:in `catch'
/gems/warden-1.1.1/lib/warden/manager.rb:34:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/gems/rack-1.4.1/lib/rack/etag.rb:23:in `call'
/gems/rack-1.4.1/lib/rack/conditionalget.rb:25:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/head.rb:14:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/flash.rb:242:in `call'
/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/cookies.rb:338:in `call'
/gems/dragonfly-0.9.12/lib/dragonfly/cookie_monster.rb:9:in `call'
/gems/activerecord-3.2.3/lib/active_record/query_cache.rb:64:in `call'
/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:467:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `_run__769019731473264505__call__125179061411774550__callbacks'
/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:405:in `__run_callback'
/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
/gems/activesupport-3.2.3/lib/active_support/callbacks.rb:81:in `run_callbacks'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/gems/dragonfly-0.9.12/lib/dragonfly/middleware.rb:13:in `call'
/gems/dragonfly-0.9.12/lib/dragonfly/middleware.rb:13:in `call'
/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
/gems/rack-cache-1.2/lib/rack/cache/context.rb:245:in `fetch'
/gems/rack-cache-1.2/lib/rack/cache/context.rb:185:in `lookup'
/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/reloader.rb:65:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/gems/railties-3.2.3/lib/rails/rack/logger.rb:26:in `call_app'
/gems/railties-3.2.3/lib/rails/rack/logger.rb:16:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
/gems/activesupport-3.2.3/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/gems/rack-1.4.1/lib/rack/lock.rb:15:in `call'
/gems/actionpack-3.2.3/lib/action_dispatch/middleware/static.rb:62:in `call'
/gems/railties-3.2.3/lib/rails/engine.rb:479:in `call'
/gems/railties-3.2.3/lib/rails/application.rb:220:in `call'
/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
/gems/railties-3.2.3/lib/rails/rack/log_tailer.rb:14:in `call'
/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
/Users/ivan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/Users/ivan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/Users/ivan/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

Default value is not updated

If a phrase is created with no default and the code is later changed to give it a default the change is not represented on the rendered page. When a phrase is loaded if a default is provided by the options and is different then the default field should be updated.

In the mean time the workaround is to remove the database record and let it be recreated.

Similar to #7

How to refresh the copywriting options on a page

It seems like I have to do Page.find(1).copywriting_phrases.destroy_all if I need to re-work the callouts on the page. Is this normal? I'd expect that if I remove a phrase from a pages back end code that it's editing input would also be removed, but this doesn't seem to be the case. The phrase_type also seems to get embedded and to change it requires removing it from the copywriting_phrases of the page in the db.

Any help would be much appreciated!

Thanks,
-Jon

rake db:migrate

Hi,

I just ran rake db:migrate after bundle install with your gem and I got the following:

Index name 'temp_index_altered_copywriting_phrase_translations_on_copywriting_phrase_id' on table 'altered_copywriting_phrase_translations' is too long; the limit is 64 characters

This is on localhost sqlite.

Please advise.

Generating all copywritings in initializer

It appears that to create a copywriting record, I have to view the page where the copywriting method is called.

Is it possible to generate all of the copywritings in an initializer? This way, I can see immediately all the copywritings available to me by default (instead of having to click through every page where a copywriting call might be). What would this approach look like?

Thank you for your work on this gem.

config options for disabling page / global copywriting

On the current project I am using refinerycms-copywriting, we are using a few global things but no page-level things. This client is very non-technical, so having the extra "copywriting" tab in the page editor view is confusing for them. It would be great if I could disable the page editor's copywriting tab since I don't plan to use it. Likewise, I can imagine someone being in the opposite situation and not wanting the top-level copywriting tab in the admin interface.

Updating phrase fails in Rails 3.2.2 and Refinery 2.0.2.

When I try to update a phrase in a Refinery 2.0.2/Rails 3.2.2 app with Copywriting 2.0.0, it fails with a RoutingError:

No route matches {:page=>2, :controller=>"refinery/copywriting/admin/phrases", :action=>"update", :id=>"956"}

I've run rake routes and the routes seems properly setup. Also it actually updates the phrase, but it seems like the redirect after the update fails.

Screenshot:
screenshot

SyntaxError in _locale_filters.html.erb

In the master branch, when you access the copywriting tab, a syntax error appears.
I fixed it by adding an "if" in the first line of the file (copywriting / admin / phrases / _locale_filters.html)

seleccin_003

Automatically pass in locale in copywriting helper

Currently it doesn't seem that the copywriting helper passes in the locale information. I end up having to write this in my views:

<%= copywriting('foobar', :locale => ::I18n.locale) %>

The copywriting helper could easily do this automatically and keep me from accidentally not providing the locale.

This project is using an older version of refinerycms-copywriting so it is possible this has been fixed already. I'm sorry for adding noise if this is the case.

wysiwyg frontend is not working properly

When trying to render the wysiwyg content in the frontend
<%= copywriting("footer", {:phrase_type => 'wysiwyg' })%>
I have a raw output not the result of rendering the html

undefined method `action'

I'm running rails 3.2.1 and refinery 2.0.5. I just installed copywriting 2.0.2, bundled, generated, migrated, and added a call to copywriting in one view. When I go to the admin tab, the copywriting item is there, but when I click edit it pops up a modal box with an error:

NoMethodError in Refinery::Admin::BaseController#error_404
undefined method 'action' for Refinery::Admin::BaseController:Module

If I copy the edit link URL and open a new tab for it, I get the correct, working page. It has something to do with the get parameters messing up the path. If I remove the switch_locale parameter, the dialog works fine. If I remove the dialog parameter, it works fine it just takes me to a new page to edit the item. The path listed for the error is "path"=>"copywriting/phrases/2/edit&switch_locale=en",. There is no ? to indicate the start of parameters, so rails isn't finding the route.

I can provide the trace if that would be helpful.

Copywriting breaks versions of Refinery prior to 0.9.9.18

This is really high priority, it only affects sites two major versions behind! Mass assignment protection was added in Refinery 0.9.9.18. Using Copywriting with versions before that prevents any other Page attributes from being updated. https://github.com/gwagener/refinerycms-copywriting/commits/refinerycms-0.9 is a horrible little hack that fixes this. I thought you might want to pull in the branch locally, but I didn't make a pull request because it shouldn't be merged into anything.

Posts -> Uncategorized Posts link in Refinery Admin Interface

Using refinerycms 2.0.5 - In RefineryCMS's admin interface link Post-> Uncategorized raised the following error message

ActiveRecord::StatementInvalid in Refinery/blog/admin/posts#uncategorized

Showing C:/Ruby192/lib/ruby/gems/1.9.1/gems/refinerycms-blog-2.0.4/app/views/refinery/blog/admin/posts/uncategorized.html.erb where line #13 raised:

Mysql2::Error: Unknown column 'categories.refinery_blog_categories_blog_posts' in 'where clause': SELECT COUNT(DISTINCT refinery_blog_posts.id) FROM refinery_blog_posts LEFT OUTER JOIN refinery_blog_categories_blog_posts ON refinery_blog_categories_blog_posts.blog_post_id = refinery_blog_posts.id LEFT OUTER JOIN refinery_blog_categories ON refinery_blog_categories.id = refinery_blog_categories_blog_posts.blog_category_id WHERE categories.refinery_blog_categories_blog_posts = '---\n:blog_category_id: !!null \n' AND (published_at < '2012-07-23 05:40:44' and draft = 0)\

Many thanks

Defaults for multiple locales

As far as I can tell, there is no way to specify default values for multiple locales. That means my workflow is to set a default for the main locale, then go into the admin panel change to the other locale, and copy and paste the default into the editor dialog. Obviously this is not ideal.

It would be great if there were some mechanism for providing defaults for multiple locales, and I think this would dovetail nicely with an external solution as proposed in #11.

License missing from gemspec

RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.

via e.g.

  spec.license = 'MIT'
  # or
  spec.licenses = ['MIT', 'GPL-2']

Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.

There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!

Appendix:

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies

p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.

depends on refinerycms-i18n

I have removed refinerycms-i18n from my Gemfile, and commented out the initialization code.

However, when I went to look at a troublesome copywriting phrase I got the error

NameError in Refinery::Copywriting::Admin::PhrasesController#index

uninitialized constant Refinery::I18n

  1. Shouldn't the dependency show up earlier than this?
  2. The gem shouldn't be dependent on i18n.

WYM editor in backend

Well, the title says enough ;)
It would be nice to have the refinerycms What-You-Mean editor in the backend to edit the copywritings.

undefined method 'copywriting_phrases' for Refinery::Page

This error is thrown after visits to any page edit window.

Problem seems to occur with a combination of refinerycms-page-images and refinerycms-copywriting.

Works with both Gem installed. Error occurs once I removed the page-images gem. Problem seems to be reproducible, though I did not test against a clean seed.rb (did test after db:setup, and error still occurs).

undefined method `copywriting'

If I create a decorator in

app/decorators/controllers/refinery/pages_controller_decorator.rb

With a basic declarartion:

Refinery::PagesController.class_eval do
end

The server said:

undefined method `copywriting' for #<#Class:0x007fc959c4c528:0x007fc95b200608>

Seems that the Helper is out of scope. I tried to make

Refinery::PagesController.class_eval do
include Refinery::Copywriting::CopywritingHelper
end

But same result

Creating copywriting phrases on the backend

There seems to be no way to define copywriting phrases, from scratch, on the backend.

I deleted my remaining copywriting phrase and am now offered only the information that "There are no copywriting phrases yet."

Creating one in the code seems to be an odd way to go about it.

copywriting breaks page preview

When editing a page whose view template uses the copywriting helper, any attempt to use Refinery's "Preview" function fails with the following error:

NoMethodError in Refinery/pages/admin/preview#show

Showing [path-to-my-app]/refinery-sandbox/app/views/refinery/pages/show.html.erb where line #1 raised:

undefined method `copywriting' for #<#<Class:0x007ff1d01a6c28>:0x007ff1c9609010>
Extracted source (around line #1):

1: <% test_phrase = copywriting("Test Phrase", { :page => @page, :scope => "Test", :phrase_type => 'string', :default => 'foo' }) %>
2: 
3: <%= test_phrase %>
4: 

Polymorphic like refinerycms-page-images

It would be really useful to have copywriting be polymorphic as refinerycms-page-images is. That would make it easy to use copywriting to add bits of text to engine models as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.