tenon 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/tenon/features/asset_detachment.js.coffee +1 -1
  3. data/app/assets/javascripts/tenon/features/asset_uploader.js.coffee +1 -1
  4. data/app/assets/javascripts/tenon/features/modal_windows.js.coffee +0 -2
  5. data/app/assets/javascripts/tenon/features/nested_fields.js +2 -2
  6. data/app/assets/javascripts/tenon/features/new_item_version_handler.js.coffee +2 -2
  7. data/app/assets/javascripts/tenon/features/protect_changes.js.coffee +1 -1
  8. data/app/assets/javascripts/tenon/features/record_approval.js.coffee +3 -3
  9. data/app/assets/javascripts/tenon/features/record_boolean_toggle.js.coffee +1 -1
  10. data/app/assets/javascripts/tenon/features/record_list.js.coffee +3 -3
  11. data/app/assets/javascripts/tenon/features/record_list_updater.js.coffee +1 -1
  12. data/app/assets/javascripts/tenon/features/tenon_content/asset_link.js.coffee +1 -1
  13. data/app/assets/javascripts/tenon/templates/assets/asset_field.jst.eco +2 -2
  14. data/app/assets/javascripts/tenon/templates/assets/asset_row.jst.eco +2 -2
  15. data/app/assets/javascripts/tenon/templates/assets/asset_select.jst.eco +1 -1
  16. data/app/assets/javascripts/tenon/templates/contacts/contact_row.jst.eco +9 -9
  17. data/app/assets/javascripts/tenon/templates/errors.jst.eco +2 -2
  18. data/app/assets/javascripts/tenon/templates/events/event_row.jst.eco +2 -2
  19. data/app/assets/javascripts/tenon/templates/item_versions/item_version_row.jst.eco +2 -2
  20. data/app/assets/javascripts/tenon/templates/pages/page_row.jst.eco +1 -1
  21. data/app/assets/javascripts/tenon/templates/post_categories/post_category_row.jst.eco +1 -1
  22. data/app/assets/javascripts/tenon/templates/posts/post_row.jst.eco +3 -3
  23. data/app/assets/javascripts/tenon/templates/users/user_row.jst.eco +2 -2
  24. data/app/controllers/tenon/assets_controller.rb +1 -1
  25. data/app/controllers/tenon/base_controller.rb +4 -4
  26. data/app/controllers/tenon/comments_controller.rb +2 -2
  27. data/app/controllers/tenon/contacts_controller.rb +4 -4
  28. data/app/controllers/tenon/resources_controller.rb +3 -3
  29. data/app/decorators/tenon/asset_decorator.rb +3 -3
  30. data/app/decorators/tenon/comment_decorator.rb +1 -1
  31. data/app/decorators/tenon/contact_decorator.rb +2 -2
  32. data/app/decorators/tenon/event_decorator.rb +2 -2
  33. data/app/helpers/tenon/application_helper.rb +6 -0
  34. data/app/helpers/tenon/asset_helper.rb +1 -1
  35. data/app/helpers/tenon/item_version_helper.rb +5 -5
  36. data/app/helpers/tenon/tenon_content_helper.rb +1 -1
  37. data/app/helpers/tenon/tenon_helper.rb +7 -7
  38. data/app/mailers/tenon/comment_mailer.rb +1 -1
  39. data/app/mailers/tenon/contact_mailer.rb +1 -1
  40. data/app/models/tenon/asset.rb +1 -1
  41. data/app/models/tenon/page.rb +3 -3
  42. data/app/models/tenon/tenon_content/row_types.rb +17 -17
  43. data/app/views/layouts/tenon/application.html.haml +4 -0
  44. data/app/views/layouts/tenon/login.html.haml +3 -0
  45. data/app/views/tenon/assets/_form.html.haml +2 -2
  46. data/app/views/tenon/assets/_sidebar_index.html.haml +6 -6
  47. data/app/views/tenon/assets/crop.html.haml +3 -4
  48. data/app/views/tenon/assets/edit.html.haml +1 -1
  49. data/app/views/tenon/assets/index.html.haml +2 -2
  50. data/app/views/tenon/comment_mailer/comment_notification.html.haml +2 -2
  51. data/app/views/tenon/comments/_sidebar_index.html.haml +6 -6
  52. data/app/views/tenon/comments/index.html.haml +2 -2
  53. data/app/views/tenon/comments/index.json.jbuilder +1 -1
  54. data/app/views/tenon/contact_mailer/contact_notification.html.haml +4 -4
  55. data/app/views/tenon/contacts/_sidebar_index.html.haml +8 -8
  56. data/app/views/tenon/contacts/index.html.haml +2 -2
  57. data/app/views/tenon/contacts/index.json.jbuilder +4 -4
  58. data/app/views/tenon/events/_form.html.haml +7 -7
  59. data/app/views/tenon/events/edit.html.haml +1 -1
  60. data/app/views/tenon/events/index.html.haml +4 -4
  61. data/app/views/tenon/events/index.json.jbuilder +1 -1
  62. data/app/views/tenon/events/new.html.haml +1 -1
  63. data/app/views/tenon/fields/_asset.html.haml +3 -3
  64. data/app/views/tenon/galleries/_form.html.haml +7 -7
  65. data/app/views/tenon/galleries/edit.html.haml +1 -1
  66. data/app/views/tenon/galleries/index.html.haml +5 -5
  67. data/app/views/tenon/galleries/new.html.haml +1 -1
  68. data/app/views/tenon/index/index.html.haml +4 -4
  69. data/app/views/tenon/item_assets/new.html.haml +6 -6
  70. data/app/views/tenon/item_versions/_item_version.json.jbuilder +4 -4
  71. data/app/views/tenon/item_versions/index.html.haml +2 -5
  72. data/app/views/tenon/item_versions/new.html.haml +1 -1
  73. data/app/views/tenon/pages/_form.html.haml +14 -14
  74. data/app/views/tenon/pages/edit.html.haml +1 -1
  75. data/app/views/tenon/pages/index.html.haml +5 -5
  76. data/app/views/tenon/pages/index.json.jbuilder +4 -4
  77. data/app/views/tenon/pages/new.html.haml +1 -1
  78. data/app/views/tenon/post_categories/_form.html.haml +1 -1
  79. data/app/views/tenon/post_categories/_post_category.json.jbuilder +1 -1
  80. data/app/views/tenon/post_categories/index.html.haml +5 -5
  81. data/app/views/tenon/posts/_form.html.haml +14 -14
  82. data/app/views/tenon/posts/edit.html.haml +1 -1
  83. data/app/views/tenon/posts/index.html.haml +6 -6
  84. data/app/views/tenon/posts/index.json.jbuilder +2 -2
  85. data/app/views/tenon/posts/new.html.haml +1 -1
  86. data/app/views/tenon/redirects/_form.html.haml +10 -10
  87. data/app/views/tenon/redirects/_redirect.json.jbuilder +1 -1
  88. data/app/views/tenon/redirects/edit.html.haml +1 -1
  89. data/app/views/tenon/redirects/index.html.haml +8 -8
  90. data/app/views/tenon/redirects/new.html.haml +1 -1
  91. data/app/views/tenon/settings/_contact.html.haml +8 -8
  92. data/app/views/tenon/settings/_general.html.haml +4 -4
  93. data/app/views/tenon/settings/_seo.html.haml +4 -4
  94. data/app/views/tenon/settings/show.html.haml +9 -9
  95. data/app/views/tenon/shared/_i18n_language_nav.html.haml +3 -3
  96. data/app/views/tenon/shared/_main_nav.html.haml +11 -11
  97. data/app/views/tenon/shared/_posts_nav.html.haml +3 -3
  98. data/app/views/tenon/shared/_seo_fields.html.haml +3 -3
  99. data/app/views/tenon/shared/_util_nav.html.haml +2 -2
  100. data/app/views/tenon/shared/_version_warning.html.haml +5 -6
  101. data/app/views/tenon/shared/menu_items/_comments.html.haml +1 -1
  102. data/app/views/tenon/shared/menu_items/_events.html.haml +2 -2
  103. data/app/views/tenon/shared/menu_items/_galleries.html.haml +2 -2
  104. data/app/views/tenon/shared/menu_items/_pages.html.haml +2 -2
  105. data/app/views/tenon/shared/menu_items/_posts.html.haml +2 -2
  106. data/app/views/tenon/shared/section_header/_quick_search.html.haml +1 -1
  107. data/app/views/tenon/tenon_callouts/_form.html.haml +7 -9
  108. data/app/views/tenon/tenon_callouts/edit.html.haml +1 -1
  109. data/app/views/tenon/tenon_callouts/index.html.haml +5 -5
  110. data/app/views/tenon/tenon_callouts/new.html.haml +1 -1
  111. data/app/views/tenon/tenon_content/_builder.html.haml +2 -2
  112. data/app/views/tenon/tenon_content/_display.html.haml +3 -3
  113. data/app/views/tenon/tenon_content/_embed_modal.html.haml +3 -3
  114. data/app/views/tenon/tenon_content/_fields.html.haml +9 -10
  115. data/app/views/tenon/tenon_content/_row.html.haml +4 -4
  116. data/app/views/tenon/tenon_content/piece_types/form/_background_image.html.haml +6 -6
  117. data/app/views/tenon/tenon_content/piece_types/form/_embedded_content.html.haml +1 -2
  118. data/app/views/tenon/tenon_content/piece_types/form/_image.html.haml +17 -17
  119. data/app/views/tenon/users/_form.html.haml +11 -11
  120. data/app/views/tenon/users/edit.html.haml +1 -1
  121. data/app/views/tenon/users/index.html.haml +5 -5
  122. data/app/views/tenon/users/index.json.jbuilder +3 -3
  123. data/app/views/tenon/users/new.html.haml +1 -1
  124. data/config/locales/tenon.en.yml +313 -0
  125. data/lib/tenon/version.rb +1 -1
  126. metadata +4 -4
  127. data/app/models/tenon/thinger.rb +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43b616872ac8b90802cf3c43e82b32ee468acd61
4
- data.tar.gz: 3e05204e249940d672054c186039586376373476
3
+ metadata.gz: 967b1850854d4e7f6cb607d7f7b3763de4714b35
4
+ data.tar.gz: 72534e798939103469b7e284ef9d8ebfc6bcf809
5
5
  SHA512:
6
- metadata.gz: e3a2bc0e821162306fb2133c12579c3f75eab043c61891a30c1c25cfc5f92c016f52564aa94d5e7e36225979740e3ef077a80adae5aeee1fc04adbbcace2f885
7
- data.tar.gz: 837a421d8809593ec427b09c5e556acc458420c410299fa1f813d06431e7a71e20b3e92f19983d90b1cf79886ce86baca48c1b79e272e8152a24eb8c035b4c50
6
+ metadata.gz: 9e865dfd372376f5eb278b89d7da6d1a5612e43a43cfdbc2e6108d19da0368e901934f0b709f6bf7f5a8a129b21f3b74611cdb61d9a4b447a754580994d26fbc
7
+ data.tar.gz: b0f461df34c107b0e21dd168643d299cc4116e00b6c57594b85ffde0632f4114c3e02649e4aada3c1eda59c48a2a5ef7f41fa3cd41b3ea9f551f5b5d4c14a7ec
@@ -8,4 +8,4 @@ class Tenon.features.AssetDetachment
8
8
  @$assetField = $(e.currentTarget).closest('.tn-tc-asset-field')
9
9
  @$assetField.find('.asset-id-field').removeAttr('value')
10
10
  @$assetField.find('.thumbnail img').attr('src', '/assets/tenon/thumb-doc.png')
11
- @$assetField.find('.asset-info').html('No asset selected.')
11
+ @$assetField.find('.asset-info').html(I18n.tenon.assets.no_asset_selected)
@@ -61,7 +61,7 @@ class Tenon.features.AssetUploader
61
61
  @titleCounter += 1
62
62
 
63
63
  _updateButtonText: ->
64
- $('#choose-files').text('Choose Another File')
64
+ $('#choose-files').text(I18n.tenon.assets.choose_another_file)
65
65
 
66
66
  _resetCounter: =>
67
67
  $('#asset_title').val($('#aset_title').data('original-value'))
@@ -41,7 +41,6 @@ class Tenon.features.ModalWindows
41
41
  @_launchWithContent() if @opts.content?.length
42
42
 
43
43
  _launchWithUrl: (e) =>
44
- console.debug("called _launchWithUrl")
45
44
  @remote = true
46
45
  Tenon.$genericLoader.show()
47
46
  $.ajax
@@ -51,7 +50,6 @@ class Tenon.features.ModalWindows
51
50
  beforeSend: null
52
51
 
53
52
  _launchWithTarget: (e) =>
54
- console.debug("called _launchWithTarget")
55
53
  if @opts.closest?.length && @opts.$link
56
54
  $parentNode = @opts.$link.closest(@opts.closest)
57
55
  $el = $parentNode.find(@opts.target)
@@ -52,7 +52,7 @@ Tenon.features.nestedFields = {
52
52
  var self = Tenon.features.nestedFields,
53
53
  hiddenField = $(this).prev('input[name*=_destroy]')[0];
54
54
 
55
- if (confirm("Are you sure?")) {
55
+ if (confirm(I18n.tenon.common.are_you_sure)) {
56
56
  // Existing records get set as deleted, new records just get cleared out of the DOM
57
57
  if(hiddenField) {
58
58
  hiddenField.value = 'true';
@@ -92,4 +92,4 @@ Tenon.features.nestedFields = {
92
92
  }
93
93
  });
94
94
  }
95
- };
95
+ };
@@ -28,5 +28,5 @@ class Tenon.features.NewItemVersionHandler
28
28
  $.extend(itemFormData, versionFormData)
29
29
 
30
30
  _failure: =>
31
- msg = "Failed to save draft."
32
- @$versionForm.prepend(msg)
31
+ msg = I18n.tenon.item_versions.failed_to_save_draft
32
+ @$versionForm.prepend(msg)
@@ -22,4 +22,4 @@ class Tenon.features.ProtectChanges
22
22
 
23
23
  confirmNavigation: =>
24
24
  if @changesMade
25
- 'You have unsaved changes, are you sure you want to leave this page?'
25
+ I18n.tenon.common.you_have_unsaved_changes
@@ -14,10 +14,10 @@ class Tenon.features.RecordApproval
14
14
  _finishToggle: =>
15
15
  @$link.toggleClass('unapprove approve')
16
16
  if @$link.hasClass('approve')
17
- @_setTooltip('Approve')
17
+ @_setTooltip(I18n.tenon.common.approve)
18
18
  @$link.find('i').toggleClass('fa-spin fa-gear fa-thumbs-up')
19
19
  else
20
- @_setTooltip('Unapprove')
20
+ @_setTooltip(I18n.tenon.common.unapprove)
21
21
  @$link.find('i').toggleClass('fa-spin fa-gear fa-thumbs-down')
22
22
 
23
23
  _startIconLoad: =>
@@ -30,4 +30,4 @@ class Tenon.features.RecordApproval
30
30
  .tooltip('hide')
31
31
  .attr('data-original-title', tooltip)
32
32
  .tooltip('fixTitle')
33
- .tooltip('show')
33
+ .tooltip('show')
@@ -10,7 +10,7 @@ class Tenon.features.RecordBooleanToggle
10
10
  @trueTooltip = @$link.data('truetooltip')
11
11
  @falseTooltip = @$link.data('falsetooltip')
12
12
  @_startIconLoad()
13
- @_setTooltip('Loading...')
13
+ @_setTooltip(I18n.tenon.common.loading)
14
14
  $.getJSON(@$link.attr('href'))
15
15
  .done(@_finishToggle)
16
16
  .fail((data)-> console.log(data))
@@ -41,9 +41,9 @@ class Tenon.features.RecordList
41
41
 
42
42
  _dataLoaded: (data) =>
43
43
  if data.records.length == 0
44
- @_showInfoLi('No entries found.')
44
+ @_showInfoLi(I18n.tenon.record_list.no_entries_found)
45
45
  else if @$list.data('records-nested')
46
- @_showInfoLi('No entries found.') if data.records.length == 0
46
+ @_showInfoLi(I18n.tenon.record_list.no_entries_found) if data.records.length == 0
47
47
  new Tenon.features.NestedSetWriter(data.records, @$list, @_templatePath, @_recordName)
48
48
  else
49
49
  @_drawRecords(data.records)
@@ -52,7 +52,7 @@ class Tenon.features.RecordList
52
52
  @$list.trigger('tenon.records-refreshed')
53
53
 
54
54
  _failedLoad: =>
55
- @_showInfoLi('There was an error contacting the server.')
55
+ @_showInfoLi(I18n.tenon.record_list.there_was_an_error_contacting_the_server)
56
56
 
57
57
  _drawRecords: (records) =>
58
58
  for record in records
@@ -9,7 +9,7 @@ class Tenon.features.RecordListUpdater
9
9
  $el = $(e.currentTarget)
10
10
  @clearQuery = $el.attr('data-clear-record-list-params')
11
11
  if $el.prop("tagName").toLowerCase() == 'form'
12
- @_updateWithQuery(@_processFormData($el), 'Search', $el)
12
+ @_updateWithQuery(@_processFormData($el), I18n.tenon.common.search, $el)
13
13
  else
14
14
  @_updateWithQuery(URI($el.attr('href')).query(true), $el.textContent)
15
15
 
@@ -2,7 +2,7 @@ class Tenon.features.tenonContent.AssetLink extends Tenon.features.tenonContent.
2
2
  _setFields: ($li) =>
3
3
  $link = $('<a />').attr('href', $li.data('style-urls')['original'])
4
4
  selected = @$browseButton.getSelection().getSelectedText()
5
- text = if selected.length then selected else 'Asset Link'
5
+ text = if selected.length then selected else I18n.tenon.assets.asset_link
6
6
  $link.html(text)
7
7
  @$browseButton.insertHtml($link[0].outerHTML)
8
8
 
@@ -10,8 +10,8 @@
10
10
  </div>
11
11
  </div>
12
12
  <div class="record-actions">
13
- <a data-tooltip="Edit" href="<%= @asset.edit_path %>" title="Edit"><i class="fa fa-pencil"></i></a>
14
- <a data-confirm="Are you sure? There is no undo for this!" data-method="delete" data-tooltip="Delete" href="<%= @asset.path %>" rel="nofollow" title="Delete"><i class="fa fa-trash-o"></i></a>
13
+ <a data-tooltip="<%= I18n.tenon.common.edit %>" href="<%= @asset.edit_path %>" title="<%= I18n.tenon.common.edit %>"><i class="fa fa-pencil"></i></a>
14
+ <a data-confirm="<%= I18n.tenon.common.are_you_sure %>" data-method="delete" data-tooltip="<%= I18n.tenon.common.delete %>" href="<%= @asset.path %>" rel="nofollow" title="<%= I18n.tenon.common.delete %>"><i class="fa fa-trash-o"></i></a>
15
15
  </div>
16
16
  </div>
17
17
  </li>
@@ -2,12 +2,12 @@
2
2
  <div class="thumbnail"><%- @asset.icon %></div>
3
3
  <div class="record-details">
4
4
  <div class="record-title">
5
- <a href="<%= @asset.edit_path %>" data-modal-remote="true" data-modal-title="Edit Asset"><%= @asset.display_name %></a>
5
+ <a href="<%= @asset.edit_path %>" data-modal-remote="true" data-modal-title="<%= I18n.tenon.assets.edit_asset %>"><%= @asset.display_name %></a>
6
6
  </div>
7
7
 
8
8
  <div class="record-fields">
9
9
  <div class="record-field">
10
- Size - <%= @asset.human_size %>
10
+ <%= I18n.tenon.assets.size %> - <%= @asset.human_size %>
11
11
  </div>
12
12
  </div>
13
13
 
@@ -1 +1 @@
1
- <li>Asset</li>
1
+ <li>Asset</li>
@@ -8,13 +8,13 @@
8
8
  </div>
9
9
 
10
10
  <div class="record-title">
11
- From:
11
+ <%= I18n.tenon.contact_mailer.from %>:
12
12
  <strong>
13
13
  <a href="mailto:<%= @contact.email %>"><%= @contact.name %> (<%= @contact.email %>)</a>
14
14
  </strong>
15
15
  <br />
16
16
  <small>
17
- Sent on:
17
+ <%= I18n.tenon.contact_mailer.sent_on %>:
18
18
  <strong>
19
19
  <%- @contact.sent_date %>
20
20
  </strong>
@@ -25,28 +25,28 @@
25
25
  <p><%= @contact.content %></p>
26
26
  <hr />
27
27
  <p>
28
- <strong>Name: </strong>
28
+ <strong><%= I18n.tenon.contact_mailer.name %>: </strong>
29
29
  <%= @contact.name %>
30
30
  </p>
31
31
  <p>
32
- <strong>Email: </strong>
32
+ <strong><%= I18n.tenon.contact_mailer.email %>: </strong>
33
33
  <a href="mailto: <%= @contact.email %>"><%= @contact.email %></a>
34
34
  </p>
35
35
  <p>
36
36
  <p>
37
- <strong>Phone: </strong>
38
- <%= @contact.ophone %>
37
+ <strong><%= I18n.tenon.contact_mailer.phone %>: </strong>
38
+ <%= @contact.phone %>
39
39
  </p>
40
40
  <p>
41
- <strong>IP:</strong>
41
+ <strong><%= I18n.tenon.contact_mailer.ip %>:</strong>
42
42
  <%= @contact.user_ip %>
43
43
  </p>
44
44
  <p>
45
- <strong>Agent:</strong>
45
+ <strong><%= I18n.tenon.contact_mailer.agent %>:</strong>
46
46
  <%= @contact.user_agent %>
47
47
  </p>
48
48
  <p>
49
- <strong>Referrer:</strong>
49
+ <strong><%= I18n.tenon.contact_mailer.referrer %>:</strong>
50
50
  <%= @contact.referrer %>
51
51
  </p>
52
52
  </div>
@@ -1,5 +1,5 @@
1
1
  <div class="error-explanation">
2
- <h4>The following errors occurred:</h2>
2
+ <h4><%= I18n.tenon.common.the_following_errors_occurred %>:</h2>
3
3
  <ul>
4
4
  <% for field, errors of @errors: %>
5
5
  <% for error in errors: %>
@@ -10,4 +10,4 @@
10
10
  <% end %>
11
11
  <% end %>
12
12
  </ul>
13
- </div>
13
+ </div>
@@ -12,10 +12,10 @@
12
12
 
13
13
  <div class="record-fields">
14
14
  <div class="record-field">
15
- When - <%= @event.display_date %>
15
+ <%= I18n.tenon.events.when %> - <%= @event.display_date %>
16
16
  </div>
17
17
  <div class="record-field">
18
- Where - <%= @event.location %>
18
+ <%= I18n.tenon.events.where %> - <%= @event.location %>
19
19
  </div>
20
20
  </div>
21
21
  </div>
@@ -10,11 +10,11 @@
10
10
 
11
11
  <div class="record-fields">
12
12
  <div class="record-field">
13
- Created - <%= @item_version.created_at %>
13
+ <%= I18n.tenon.item_versions.created %> - <%= @item_version.created_at %>
14
14
  </div>
15
15
 
16
16
  <div class="record-field">
17
- Creator - <%= @item_version.user_email %>
17
+ <%= I18n.tenon.item_versions.creator %> - <%= @item_version.user_email %>
18
18
  </div>
19
19
  </div>
20
20
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  <div class="record-fields">
16
16
  <div class="record-field">
17
- Last Updated - <%= @page.updated_at %> by <%=@page.updater %>
17
+ <%= I18n.tenon.pages.last_updated %> - <%= @page.updated_at %> by <%=@page.updater %>
18
18
  </div>
19
19
  </div>
20
20
  </div>
@@ -6,7 +6,7 @@
6
6
  </div>
7
7
 
8
8
  <div class="record-title">
9
- <a href="<%= @post_category.edit_path %>" data-modal-remote="true" data-modal-title="Edit Post Category"><%= @post_category.title %></a>
9
+ <a href="<%= @post_category.edit_path %>" data-modal-remote="true" data-modal-title="<%= I18n.tenon.post_categories.edit_post_category %>"><%= @post_category.title %></a>
10
10
  </div>
11
11
  </div>
12
12
  </li>
@@ -14,15 +14,15 @@
14
14
  <div class="record-fields">
15
15
  <% if @post.author: %>
16
16
  <div class="record-field">
17
- Author - <%= @post.author %>
17
+ <%= I18n.tenon.posts.author %> - <%= @post.author %>
18
18
  </div>
19
19
  <% end %>
20
20
  <div class="record-field">
21
- Published - <%= @post.publish_at %>
21
+ <%= I18n.tenon.posts.published %> - <%= @post.publish_at %>
22
22
  </div>
23
23
  <% if @post.categories: %>
24
24
  <div class="record-field">
25
- Categories - <%= @post.categories %>
25
+ <%= I18n.tenon.posts.categories %> - <%= @post.categories %>
26
26
  </div>
27
27
  <% end %>
28
28
  </div>
@@ -11,10 +11,10 @@
11
11
 
12
12
  <div class="record-fields">
13
13
  <div class="record-field">
14
- Roles - <%= @user.roles %>
14
+ <%= I18n.tenon.users.roles %> - <%= @user.roles %>
15
15
  </div>
16
16
  <div class="record-field">
17
- Last Login - <%= @user.last_login %>
17
+ <%= I18n.tenon.users.last_login %> - <%= @user.last_login %>
18
18
  </div>
19
19
  </div>
20
20
  </div>
@@ -19,7 +19,7 @@ module Tenon
19
19
 
20
20
  def create
21
21
  asset = Tenon::Asset.new(resource_params)
22
- flash[:notice] = 'Asset was successfully uploaded.' if asset.save && !request.xhr?
22
+ flash[:notice] = t('tenon.assets.successfully_uploaded') if asset.save && !request.xhr?
23
23
  @asset = asset.decorate
24
24
  respond_with(@asset, location: assets_path)
25
25
  end
@@ -6,7 +6,7 @@ module Tenon
6
6
  before_filter :require_admin, unless: :devise_controller?
7
7
 
8
8
  rescue_from CanCan::AccessDenied do |exception|
9
- flash[:warning] = 'You are not authorized to access that page.'
9
+ flash[:warning] = t('tenon.common.you_are_not_authorized')
10
10
  redirect_to root_path
11
11
  end
12
12
 
@@ -23,9 +23,9 @@ module Tenon
23
23
  def set_title
24
24
  case params[:action]
25
25
  when 'new', 'create'
26
- @page_title = "New #{params[:controller].gsub('tenon/', '').singularize.humanize}".titleize
26
+ @page_title = "#{t('tenon.common.new')} #{params[:controller].gsub('tenon/', '').singularize.humanize}".titleize
27
27
  when 'edit', 'update'
28
- @page_title = "Edit #{params[:controller].gsub('tenon/', '').singularize.humanize}".titleize
28
+ @page_title = "#{t('tenon.common.edit')} #{params[:controller].gsub('tenon/', '').singularize.humanize}".titleize
29
29
  else
30
30
  @page_title = params[:controller].gsub('tenon/', '').humanize.titleize
31
31
  end
@@ -34,7 +34,7 @@ module Tenon
34
34
 
35
35
  def require_admin
36
36
  unless current_user && current_user.staff?
37
- flash[:warning] = "You're not authorized for that." if current_user
37
+ flash[:warning] = t('tenon.common.youre_not_authorized_for_that') if current_user
38
38
  redirect_to new_user_session_path
39
39
  end
40
40
  end
@@ -27,10 +27,10 @@ module Tenon
27
27
  respond_to do |format|
28
28
  if @comment.toggle_approved!
29
29
  format.json { render json: @comment.to_json }
30
- format.html { flash[:notice] = 'Comment approved.' and redirect_to comments_path }
30
+ format.html { flash[:notice] = t('tenon.comments.comment_approved') and redirect_to comments_path }
31
31
  else
32
32
  format.json { render status: 500, nothing: true }
33
- format.html { flash[:warning] = 'Error approving comment.' and redirect_to comments_path }
33
+ format.html { flash[:warning] = t('tenon.comments.error_approving_comment') and redirect_to comments_path }
34
34
  end
35
35
  end
36
36
  end
@@ -29,10 +29,10 @@ module Tenon
29
29
  respond_to do |format|
30
30
  if @contact.toggle_read!
31
31
  format.json { render json: @contact.to_json }
32
- format.html { flash[:notice] = 'Comment flagged as read.' and redirect_to contacts_path }
32
+ format.html { flash[:notice] = t('tenon.contacts.contact_flagged_as_read') and redirect_to contacts_path }
33
33
  else
34
34
  format.json { render status: 500, nothing: true }
35
- format.html { flash[:warning] = 'Error flagging contact as read.' and redirect_to contacts_path }
35
+ format.html { flash[:warning] = t('tenon.contacts.error_flagging_contact_as_read') and redirect_to contacts_path }
36
36
  end
37
37
  end
38
38
  end
@@ -41,10 +41,10 @@ module Tenon
41
41
  respond_to do |format|
42
42
  if @contact.toggle_replied!
43
43
  format.json { render json: @contact.to_json }
44
- format.html { flash[:notice] = 'Comment flagged as replied.' and redirect_to contacts_path }
44
+ format.html { flash[:notice] = t('tenon.contacts.contact_flagged_as_replied') and redirect_to contacts_path }
45
45
  else
46
46
  format.json { render status: 500, nothing: true }
47
- format.html { flash[:warning] = 'Error flagging contact as replied.' and redirect_to contacts_path }
47
+ format.html { flash[:warning] = t('tenon.contacts.error_flagging_contact_as_replied.') and redirect_to contacts_path }
48
48
  end
49
49
  end
50
50
  end
@@ -41,7 +41,7 @@ module Tenon
41
41
  authorize!(:publish, resource)
42
42
  if resource.update_attributes(resource_params)
43
43
  save_item_version if resource.respond_to?(:versions)
44
- flash[:notice] = "#{human_name} saved successfully." unless request.xhr?
44
+ flash[:notice] = "#{human_name} #{t('tenon.common.saved_successfully')}." unless request.xhr?
45
45
  end
46
46
 
47
47
  self.resource = resource.decorate
@@ -52,7 +52,7 @@ module Tenon
52
52
  self.resource = klass.new(resource_params).decorate
53
53
  authorize!(:publish, resource)
54
54
  if resource.save && !request.xhr?
55
- flash[:notice] = "#{human_name} saved successfully."
55
+ flash[:notice] = "#{human_name} #{t('tenon.common.saved_successfully')}."
56
56
  save_item_version if resource.respond_to?(:versions)
57
57
  end
58
58
  respond_with(resource.decorate, location: after_create_path, status: (201 if resource.valid?))
@@ -83,7 +83,7 @@ module Tenon
83
83
  item_version.user = current_user
84
84
  item_version.created_at = resource.updated_at
85
85
  item_version.save_type = 'post-save'
86
- item_version.title = 'Post-Save'
86
+ item_version.title = t('tenon.item_versions.post_save')
87
87
  item_version.save
88
88
  end
89
89
 
@@ -19,7 +19,7 @@ module Tenon
19
19
 
20
20
  def crop_link
21
21
  h.action_link(
22
- 'Crop',
22
+ I18n.t('tenon.assets.crop'),
23
23
  [:crop, object],
24
24
  'crop',
25
25
  class: 'asset-crop',
@@ -33,13 +33,13 @@ module Tenon
33
33
  def edit_link(opts = {})
34
34
  defaults = {
35
35
  'data-modal-remote' => true,
36
- 'data-modal-title' => 'Edit Asset'
36
+ 'data-modal-title' => I18n.t('tenon.assets.edit_asset')
37
37
  }
38
38
  super(opts.merge(defaults))
39
39
  end
40
40
 
41
41
  def download_link
42
- h.action_link('Download', object.attachment.url, 'download', target: '_')
42
+ h.action_link(I18n.t('tenon.assets.download'), object.attachment.url, 'download', target: '_')
43
43
  end
44
44
 
45
45
  def style_urls
@@ -16,7 +16,7 @@ module Tenon
16
16
  def error_message
17
17
  errors = []
18
18
  @object.errors.full_messages.each { |error| errors << "<li>#{error}</li>" }
19
- "<div class='error-explanation' id='error-explanation'>There were problems with the following fields:<ul>#{errors.join('')}<ul></div>"
19
+ "<div class='error-explanation' id='error-explanation'>#{I18n.t('tenon.common.there_were_problems_with_the_following_fields')}:<ul>#{errors.join('')}<ul></div>"
20
20
  end
21
21
  end
22
22
  end
@@ -1,13 +1,13 @@
1
1
  module Tenon
2
2
  class ContactDecorator < ApplicationDecorator
3
3
  def sent_date
4
- @object.created_at.strftime('%B %e, %Y at %l:%M %p')
4
+ "#{@object.created_at.strftime('%B %e, %Y')} #{I18n.t('tenon.common.at')} #{@object.created_at.strftime('%l:%M %p')}"
5
5
  end
6
6
 
7
7
  def error_message
8
8
  errors = []
9
9
  @object.errors.full_messages.each { |error| errors << "<li>#{error}</li>" }
10
- "<div class='error-explanation' id='error-explanation'>There were problems with the following fields:<ul>#{errors.join('')}<ul></div>"
10
+ "<div class='error-explanation' id='error-explanation'>#{I18n.t('tenon.common.there_were_problems_with_the_following_fields')}:<ul>#{errors.join('')}<ul></div>"
11
11
  end
12
12
  end
13
13
  end
@@ -2,9 +2,9 @@ module Tenon
2
2
  class EventDecorator < ApplicationDecorator
3
3
  def display_date
4
4
  if @object.starts_at.to_date == @object.ends_at.to_date
5
- "#{@object.starts_at.strftime('%B %d, %Y')} from #{@object.starts_at.strftime('%I:%M%p')} until #{@object.ends_at.strftime('%I:%M%p')}"
5
+ "#{@object.starts_at.strftime('%B %d, %Y')} #{I18n.t('tenon.events.from')} #{@object.starts_at.strftime('%I:%M%p')} #{I18n.t('tenon.events.until')} #{@object.ends_at.strftime('%I:%M%p')}"
6
6
  else
7
- "#{@object.starts_at.strftime("%B %d, %Y at %I:%M%p")} until #{@object.ends_at.strftime("%B %d, %Y at %I:%M%p")}"
7
+ "#{@object.starts_at.strftime("%B %d, %Y at %I:%M%p")} #{I18n.t('tenon.events.until')} #{@object.ends_at.strftime("%B %d, %Y at %I:%M%p")}"
8
8
  end
9
9
  end
10
10
  end
@@ -79,6 +79,12 @@ module Tenon
79
79
  false
80
80
  end
81
81
 
82
+ def current_translations
83
+ I18n.backend.send(:init_translations) unless I18n.backend.initialized?
84
+ @translations ||= I18n.backend.send(:translations)
85
+ @translations[I18n.locale].with_indifferent_access
86
+ end
87
+
82
88
  private
83
89
 
84
90
  def h5bp_opening_tag(ie_versions = 6..8)
@@ -56,7 +56,7 @@ module Tenon
56
56
  def default_options
57
57
  {
58
58
  'data-modal-remote' => true,
59
- 'data-modal-title' => 'Edit Asset'
59
+ 'data-modal-title' => t('tenon.assets.edit_asset')
60
60
  }
61
61
  end
62
62
  end
@@ -17,24 +17,24 @@ module Tenon
17
17
  data = {
18
18
  'modal-remote' => true,
19
19
  'modal-handler' => 'Tenon.features.NewItemVersionHandler',
20
- 'modal-title' => 'Save Draft'
20
+ 'modal-title' => t('tenon.item_versions.save_draft')
21
21
  }
22
- link_to 'Save Draft', path, class: css_class, data: data
22
+ link_to t('tenon.item_versions.save_draft'), path, class: css_class, data: data
23
23
  end
24
24
 
25
25
  def clear_draft_link
26
26
  path = url_for(version: nil)
27
- link_to 'Load Active Version', path, class: 'delete-link'
27
+ link_to t('tenon.item_versions.load_active_version'), path, class: 'delete-link'
28
28
  end
29
29
 
30
30
  def load_draft_link(obj)
31
31
  path = item_versions_path(item_type: obj.class.to_s, item_id: obj.id)
32
32
  data = {
33
33
  'modal-remote' => true,
34
- 'modal-title' => 'Load Draft',
34
+ 'modal-title' => t('tenon.item_versions.load_draft'),
35
35
  'modal-handler' => 'Tenon.features.ItemVersionIndexHandler'
36
36
  }
37
- link_to 'Load Draft', path, class: 'delete-link', data: data
37
+ link_to t('tenon.item_versions.load_draft'), path, class: 'delete-link', data: data
38
38
  end
39
39
 
40
40
  private
@@ -32,7 +32,7 @@ module Tenon
32
32
  links << link_to(name.to_s.titleize, '#', class: 'btn btn-white', data: { size: size_for_breakpoint(widths[:default]) })
33
33
  end
34
34
  last = Tenon.config.breakpoints.front_end.values.last
35
- links << link_to('Mobile', '#', class: 'btn btn-white', data: { size: 320, mobile: true })
35
+ links << link_to(t('tenon.common.mobile'), '#', class: 'btn btn-white', data: { size: 320, mobile: true })
36
36
  links.join('').html_safe
37
37
  end
38
38
 
@@ -36,7 +36,7 @@ module Tenon
36
36
  def edit_link(obj, options = {})
37
37
  if can?(:edit, obj)
38
38
  url = polymorphic_url([:edit] + Array(obj))
39
- action_link('Edit', url, 'pencil', options)
39
+ action_link(t('tenon.common.edit'), url, 'pencil', options)
40
40
  end
41
41
  end
42
42
 
@@ -44,21 +44,21 @@ module Tenon
44
44
  def delete_link(obj, options = {})
45
45
  if can?(:destroy, obj)
46
46
  default_options = { data: {
47
- confirm: 'Are you sure? There is no undo for this!',
48
- tooltip: 'Delete',
47
+ confirm: t('tenon.common.are_you_sure'),
48
+ tooltip: t('tenon.common.delete'),
49
49
  method: 'Delete',
50
50
  remote: 'true'
51
51
  } }
52
52
  url = polymorphic_url(obj)
53
- action_link('Delete', url, 'trash-o', default_options.deep_merge(options))
53
+ action_link(t('tenon.common.delete'), url, 'trash-o', default_options.deep_merge(options))
54
54
  end
55
55
  end
56
56
 
57
57
  # browser detection and warning message
58
58
  def browser_detection(http)
59
- if http.match(/MSIE 6|MSIE 7|MSIE 8.0/)
60
- content_tag(:div, "For an optimal Tenon experience, please upgrade Internet Explorer to the #{link_to 'latest version', 'http://browsehappy.com/', target: '_blank'} or switch to another #{link_to 'modern browser', 'http://browsehappy.com/', target: '_blank'}.".html_safe, id: 'flash-warning', class: 'flash-msg')
61
- end
59
+ # if http.match(/MSIE 6|MSIE 7|MSIE 8.0/)
60
+ content_tag(:div, t('tenon.common.for_an_optimal_tenon_experience', latest_version: link_to('latest version', 'http://browsehappy.com/', target: '_blank'), modern_browser: link_to('modern browser', 'http://browsehappy.com/', target: '_blank')).html_safe, id: 'flash-warning', class: 'flash-msg')
61
+ # end
62
62
  end
63
63
 
64
64
  def i18n_language_nav(table)
@@ -8,7 +8,7 @@ module Tenon
8
8
  @comment = comment
9
9
  mail(
10
10
  to: email,
11
- subject: "#{Tenon::MySettings.site_name} - New Comment: #{@post.title}",
11
+ subject: "#{Tenon::MySettings.site_name} - #{I18n.t('tenon.comment_mailer.new_comment')}: #{@post.title}",
12
12
  from: Tenon::MySettings.from_email
13
13
  )
14
14
  end