spina 0.8.3 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spina might be problematic. Click here for more details.

Files changed (197) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +63 -52
  3. data/app/assets/javascripts/spina/admin/application.js +0 -1
  4. data/app/controllers/spina/admin/accounts_controller.rb +11 -16
  5. data/app/controllers/spina/admin/admin_controller.rb +12 -23
  6. data/app/controllers/spina/admin/attachments_controller.rb +1 -1
  7. data/app/controllers/spina/admin/pages_controller.rb +14 -7
  8. data/app/controllers/spina/admin/photos_controller.rb +4 -2
  9. data/app/controllers/spina/admin/sessions_controller.rb +3 -3
  10. data/app/controllers/spina/admin/users_controller.rb +3 -3
  11. data/app/controllers/spina/application_controller.rb +7 -3
  12. data/app/controllers/spina/pages_controller.rb +13 -2
  13. data/app/controllers/spina/sitemaps_controller.rb +1 -0
  14. data/app/helpers/spina/admin/pages_helper.rb +12 -2
  15. data/app/helpers/spina/application_helper.rb +0 -9
  16. data/app/models/concerns/spina/part.rb +31 -0
  17. data/app/models/{spina → concerns/spina}/partable.rb +0 -0
  18. data/app/models/spina/ability.rb +0 -1
  19. data/app/models/spina/account.rb +6 -6
  20. data/app/models/spina/attachment.rb +1 -1
  21. data/app/models/spina/layout_part.rb +4 -27
  22. data/app/models/spina/line.rb +2 -0
  23. data/app/models/spina/page.rb +24 -5
  24. data/app/models/spina/page_part.rb +6 -30
  25. data/app/models/spina/structure_part.rb +7 -19
  26. data/app/models/spina/text.rb +2 -0
  27. data/app/views/layouts/spina/admin/application.html.haml +12 -14
  28. data/app/views/layouts/spina/admin/media_library.html.haml +4 -4
  29. data/app/views/layouts/spina/admin/settings.html.haml +7 -8
  30. data/app/views/layouts/spina/admin/website.html.haml +9 -16
  31. data/app/views/spina/admin/accounts/style.html.haml +10 -10
  32. data/app/views/spina/admin/attachments/_attachment.html.haml +1 -2
  33. data/app/views/spina/admin/{pages/_attachment_fields.html.haml → attachments/_fields.html.haml} +0 -0
  34. data/app/views/spina/admin/attachments/index.html.haml +2 -7
  35. data/app/views/spina/admin/layout_partables/colors/_form.html.haml +4 -0
  36. data/app/views/spina/admin/layout_partables/lines/_form.html.haml +2 -0
  37. data/app/views/spina/admin/page_partables/attachment_collections/_form.html.haml +15 -0
  38. data/app/views/spina/admin/page_partables/attachments/_form.html.haml +14 -0
  39. data/app/views/spina/admin/page_partables/colors/_form.html.haml +7 -0
  40. data/app/views/spina/admin/page_partables/lines/_form.html.haml +5 -0
  41. data/app/views/spina/admin/page_partables/photo_collections/_form.html.haml +17 -0
  42. data/app/views/spina/admin/page_partables/photos/_form.html.haml +18 -0
  43. data/app/views/spina/admin/page_partables/structures/_form.html.haml +22 -0
  44. data/app/views/spina/admin/page_partables/texts/_form.html.haml +5 -0
  45. data/app/views/spina/admin/pages/_form.html.haml +11 -8
  46. data/app/views/spina/admin/pages/_form_advanced.html.haml +3 -3
  47. data/app/views/spina/admin/pages/_form_page_content.html.haml +8 -3
  48. data/app/views/spina/admin/pages/_form_page_seo.html.haml +1 -1
  49. data/app/views/spina/admin/pages/edit.html.haml +13 -1
  50. data/app/views/spina/admin/photos/_photo.html.haml +1 -3
  51. data/app/views/spina/admin/photos/create.js.erb +1 -2
  52. data/app/views/spina/admin/photos/create_and_select.js.erb +7 -0
  53. data/app/views/spina/admin/photos/index.html.haml +7 -6
  54. data/app/views/spina/admin/shared/_primary_navigation.html.haml +19 -0
  55. data/app/views/spina/admin/shared/_rich_text_field.html.haml +2 -2
  56. data/app/views/spina/admin/structure_items/_fields.html.haml +16 -0
  57. data/app/views/spina/admin/structure_partables/lines/_form.html.haml +2 -0
  58. data/app/views/spina/admin/structure_partables/photos/_form.html.haml +11 -0
  59. data/app/views/spina/admin/structure_partables/texts/_form.html.haml +2 -0
  60. data/app/views/spina/sitemaps/show.xml.builder +12 -8
  61. data/{lib/spina/carrierwave.rb → config/initializers/spina.rb} +0 -0
  62. data/config/locales/de.yml +0 -26
  63. data/config/locales/en.yml +4 -26
  64. data/config/locales/es.yml +0 -26
  65. data/config/locales/fr.yml +4 -27
  66. data/config/locales/it.yml +0 -26
  67. data/config/locales/nl.yml +2 -28
  68. data/config/locales/pt-BR.yml +0 -26
  69. data/config/locales/ru.yml +0 -26
  70. data/config/locales/tr.yml +2 -28
  71. data/config/locales/zh-CN.yml +0 -3
  72. data/config/routes.rb +3 -19
  73. data/db/migrate/{20150507135428_create_spina_tables.rb → 1_create_spina_tables.rb} +0 -11
  74. data/db/migrate/2_create_spina_translation_tables.rb +13 -0
  75. data/lib/generators/spina/install_generator.rb +23 -9
  76. data/lib/generators/spina/templates/app/assets/stylesheets/demo/application.css.sass +3 -0
  77. data/lib/generators/spina/templates/app/views/demo/shared/_languages.html.haml +2 -0
  78. data/lib/generators/spina/templates/app/views/layouts/demo/application.html.haml +1 -0
  79. data/lib/generators/spina/templates/config/initializers/carrierwave.rb +17 -0
  80. data/lib/generators/spina/templates/config/initializers/spina.rb +2 -22
  81. data/lib/generators/spina/templates/config/initializers/themes/default.rb +29 -45
  82. data/lib/generators/spina/templates/config/initializers/themes/demo.rb +82 -92
  83. data/lib/spina.rb +24 -30
  84. data/lib/spina/engine.rb +2 -22
  85. data/lib/spina/plugin.rb +21 -3
  86. data/lib/spina/railtie.rb +9 -0
  87. data/lib/spina/theme.rb +34 -6
  88. data/lib/spina/version.rb +1 -1
  89. metadata +51 -124
  90. data/app/assets/javascripts/spina/admin/aviary.js.coffee +0 -25
  91. data/app/controllers/spina/admin/inquiries_controller.rb +0 -63
  92. data/app/controllers/spina/inquiries_controller.rb +0 -30
  93. data/app/mailers/spina/inquiry_mailer.rb +0 -19
  94. data/app/models/spina/inquiry.rb +0 -41
  95. data/app/views/layouts/spina/admin/messages.html.haml +0 -24
  96. data/app/views/spina/admin/accounts/aviary.html.haml +0 -26
  97. data/app/views/spina/admin/inquiries/inbox.html.haml +0 -30
  98. data/app/views/spina/admin/inquiries/index.html.haml +0 -36
  99. data/app/views/spina/admin/inquiries/show.html.haml +0 -23
  100. data/app/views/spina/admin/inquiries/spam.html.haml +0 -36
  101. data/app/views/spina/admin/layout_partables/_color_form.html.haml +0 -4
  102. data/app/views/spina/admin/layout_partables/_line_form.html.haml +0 -2
  103. data/app/views/spina/admin/page_partables/_attachment_collection_form.html.haml +0 -20
  104. data/app/views/spina/admin/page_partables/_attachment_form.html.haml +0 -19
  105. data/app/views/spina/admin/page_partables/_color_form.html.haml +0 -12
  106. data/app/views/spina/admin/page_partables/_line_form.html.haml +0 -10
  107. data/app/views/spina/admin/page_partables/_photo_collection_form.html.haml +0 -22
  108. data/app/views/spina/admin/page_partables/_photo_form.html.haml +0 -23
  109. data/app/views/spina/admin/page_partables/_structure_form.html.haml +0 -28
  110. data/app/views/spina/admin/page_partables/_text_form.html.haml +0 -10
  111. data/app/views/spina/admin/pages/_structure_item_fields.html.haml +0 -15
  112. data/app/views/spina/admin/shared/_navigation.html.haml +0 -21
  113. data/app/views/spina/admin/structure_partables/_line_form.html.haml +0 -2
  114. data/app/views/spina/admin/structure_partables/_photo_form.html.haml +0 -11
  115. data/app/views/spina/admin/structure_partables/_text_form.html.haml +0 -2
  116. data/app/views/spina/inquiries/create.html.haml +0 -2
  117. data/app/views/spina/inquiries/index.html.haml +0 -19
  118. data/app/views/spina/inquiry_mailer/inquiry.html.haml +0 -15
  119. data/test/dummy/README.rdoc +0 -261
  120. data/test/dummy/Rakefile +0 -7
  121. data/test/dummy/app/assets/javascripts/application.js +0 -15
  122. data/test/dummy/app/assets/stylesheets/default/application.css.sass +0 -0
  123. data/test/dummy/app/assets/stylesheets/demo/application.css.sass +0 -66
  124. data/test/dummy/app/assets/stylesheets/fonts.css.sass +0 -3
  125. data/test/dummy/app/controllers/application_controller.rb +0 -3
  126. data/test/dummy/app/helpers/application_helper.rb +0 -2
  127. data/test/dummy/app/views/default/pages/homepage.html.haml +0 -2
  128. data/test/dummy/app/views/default/pages/show.html.haml +0 -3
  129. data/test/dummy/app/views/default/shared/_navigation.html.haml +0 -5
  130. data/test/dummy/app/views/demo/pages/demo.html.haml +0 -30
  131. data/test/dummy/app/views/demo/pages/homepage.html.haml +0 -2
  132. data/test/dummy/app/views/demo/pages/show.html.haml +0 -3
  133. data/test/dummy/app/views/demo/shared/_navigation.html.haml +0 -5
  134. data/test/dummy/app/views/layouts/default/application.html.haml +0 -11
  135. data/test/dummy/app/views/layouts/demo/application.html.haml +0 -11
  136. data/test/dummy/config.ru +0 -4
  137. data/test/dummy/config/application.rb +0 -52
  138. data/test/dummy/config/application.yml +0 -2
  139. data/test/dummy/config/boot.rb +0 -10
  140. data/test/dummy/config/database.yml +0 -24
  141. data/test/dummy/config/environment.rb +0 -5
  142. data/test/dummy/config/environments/development.rb +0 -41
  143. data/test/dummy/config/environments/production.rb +0 -70
  144. data/test/dummy/config/environments/test.rb +0 -38
  145. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  146. data/test/dummy/config/initializers/inflections.rb +0 -15
  147. data/test/dummy/config/initializers/mime_types.rb +0 -5
  148. data/test/dummy/config/initializers/session_store.rb +0 -8
  149. data/test/dummy/config/initializers/spina.rb +0 -33
  150. data/test/dummy/config/initializers/themes/default.rb +0 -47
  151. data/test/dummy/config/initializers/themes/demo.rb +0 -103
  152. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  153. data/test/dummy/config/locales/en.yml +0 -5
  154. data/test/dummy/config/locales/nl.yml +0 -214
  155. data/test/dummy/config/routes.rb +0 -4
  156. data/test/dummy/config/secrets.yml +0 -7
  157. data/test/dummy/db/migrate/20160114085213_create_spina_tables.spina.rb +0 -167
  158. data/test/dummy/db/schema.rb +0 -183
  159. data/test/dummy/db/seeds.rb +0 -1
  160. data/test/dummy/public/404.html +0 -26
  161. data/test/dummy/public/422.html +0 -26
  162. data/test/dummy/public/500.html +0 -25
  163. data/test/dummy/public/favicon.ico +0 -0
  164. data/test/dummy/script/rails +0 -6
  165. data/test/dummy/tmp/restart.txt +0 -0
  166. data/test/fixtures/spina/accounts.yml +0 -3
  167. data/test/fixtures/spina/pages.yml +0 -10
  168. data/test/fixtures/spina/users.yml +0 -5
  169. data/test/functional/spina/admin/admin_controller.rb +0 -36
  170. data/test/functional/spina/admin/sessions_controller_test.rb +0 -32
  171. data/test/functional/spina/pages_controller_test.rb +0 -16
  172. data/test/integration/navigation_test.rb +0 -8
  173. data/test/integration/spina/admin/login_test.rb +0 -31
  174. data/test/integration/spina/admin/logout_test.rb +0 -17
  175. data/test/integration/spina/admin/pages_test.rb +0 -34
  176. data/test/integration/spina/pages_test.rb +0 -19
  177. data/test/models/spina/line_test.rb +0 -9
  178. data/test/models/spina/text_test.rb +0 -9
  179. data/test/test_helper.rb +0 -23
  180. data/test/unit/helpers/spina/accounts_helper_test.rb +0 -6
  181. data/test/unit/helpers/spina/inquiries_helper_test.rb +0 -6
  182. data/test/unit/helpers/spina/page_parts_helper_test.rb +0 -6
  183. data/test/unit/helpers/spina/pages_helper_test.rb +0 -6
  184. data/test/unit/helpers/spina/photos_helper_test.rb +0 -6
  185. data/test/unit/helpers/spina/sessions_helper_test.rb +0 -6
  186. data/test/unit/helpers/spina/users_helper_test.rb +0 -6
  187. data/test/unit/spina/account_test.rb +0 -9
  188. data/test/unit/spina/file_collection_file_test.rb +0 -9
  189. data/test/unit/spina/gallery_test.rb +0 -9
  190. data/test/unit/spina/inquiry_test.rb +0 -9
  191. data/test/unit/spina/page_include_test.rb +0 -9
  192. data/test/unit/spina/page_part_test.rb +0 -9
  193. data/test/unit/spina/page_test.rb +0 -9
  194. data/test/unit/spina/photo_collection_file_test.rb +0 -9
  195. data/test/unit/spina/photo_collection_test.rb +0 -9
  196. data/test/unit/spina/photo_test.rb +0 -9
  197. data/test/unit/spina/user_test.rb +0 -9
@@ -1,25 +0,0 @@
1
- $(document).ready ->
2
- if(typeof(Aviary) != "undefined")
3
- featherEditor = new Aviary.Feather
4
- apiKey: $('body').attr('aviary_api_key'),
5
- theme: 'dark',
6
- language: $('body').attr('aviary_language'),
7
- tools: 'crop,enhance,contrast,sharpness,text,whiten,effects,warmth,orientation,brightness,saturation,redeye,blemish',
8
- onSave: (imageID, newURL) ->
9
- img = $('#' + imageID)
10
- img.attr('src', newURL)
11
- $.post(img.attr('data-posturl'), { new_image: newURL })
12
- ,
13
- onError: (errorObj) ->
14
- alert(errorObj.message)
15
-
16
- launchEditor = (id, src) ->
17
- featherEditor.launch
18
- image: id,
19
- url: ($('body').attr('ngrok_address') + src)
20
- return false
21
-
22
- $(document).on 'click', '[data-aviary]', (e) ->
23
- e.preventDefault()
24
- image = $(this).parents('.item').find('img')
25
- return launchEditor(image.attr('id'), image.attr('data-image'))
@@ -1,63 +0,0 @@
1
- module Spina
2
- module Admin
3
- class InquiriesController < AdminController
4
-
5
- authorize_resource class: Inquiry
6
-
7
- layout "spina/admin/messages"
8
-
9
- def show
10
- @inquiry = Inquiry.find(params[:id])
11
- add_breadcrumb I18n.t('spina.inquiries.all'), spina.admin_inquiries_path
12
- add_breadcrumb @inquiry.name
13
- end
14
-
15
- def inbox_show
16
- @inquiry = Inquiry.find(params[:id])
17
- add_breadcrumb I18n.t('spina.inquiries.inbox'), spina.inbox_admin_inquiries_path
18
- add_breadcrumb @inquiry.name
19
- render :show
20
- end
21
-
22
- def index
23
- add_breadcrumb I18n.t('spina.inquiries.all'), spina.admin_inquiries_path
24
- @inquiries = Inquiry.sorted
25
- end
26
-
27
- def inbox
28
- add_breadcrumb I18n.t('spina.inquiries.inbox'), spina.inbox_admin_inquiries_path
29
- @inquiries = Inquiry.new_messages.sorted
30
- end
31
-
32
- def spam
33
- add_breadcrumb I18n.t('spina.inquiries.all'), spina.admin_inquiries_path
34
- add_breadcrumb I18n.t('spina.inquiries.spam'), spina.spam_admin_inquiries_path
35
- @inquiries = Inquiry.spam.order('created_at DESC')
36
- end
37
-
38
- def mark_as_read
39
- @inquiry = Inquiry.find(params[:id])
40
- @inquiry.update_attribute(:archived, true)
41
- redirect_to spina.inbox_admin_inquiries_path
42
- end
43
-
44
- def unmark_spam
45
- @inquiry = Inquiry.find(params[:id])
46
- @inquiry.ham!
47
- redirect_to spina.admin_inquiries_path
48
- end
49
-
50
- def destroy
51
- @inquiry = Inquiry.find(params[:id])
52
- @inquiry.destroy
53
- redirect_to spina.admin_inquiries_path
54
- end
55
-
56
- private
57
-
58
- def inquiry_params
59
- params.require(:inquiry).permit(:archived, :email, :message, :name, :phone)
60
- end
61
- end
62
- end
63
- end
@@ -1,30 +0,0 @@
1
- module Spina
2
- class InquiriesController < Spina::ApplicationController
3
-
4
- before_filter :setup_negative_captcha, only: [:create]
5
-
6
- def create
7
- @inquiry = Inquiry.new(@captcha.values)
8
-
9
- if @inquiry.save
10
- @inquiry.spam! unless @captcha.valid?
11
- InquiryMailer.inquiry(@inquiry).deliver unless @inquiry.spam
12
- else
13
- flash[:notice] = @captcha.error if @captcha.error
14
- render :failed
15
- end
16
- end
17
-
18
- private
19
-
20
- def setup_negative_captcha
21
- @captcha = NegativeCaptcha.new(
22
- secret: Spina.config.NEGATIVE_CAPTCHA_SECRET,
23
- spinner: request.remote_ip,
24
- fields: [:email, :message, :name],
25
- params: params
26
- )
27
- end
28
-
29
- end
30
- end
@@ -1,19 +0,0 @@
1
- module Spina
2
- class InquiryMailer < ActionMailer::Base
3
- layout 'spina/email'
4
-
5
- def inquiry(inquiry)
6
- @inquiry = inquiry
7
- @current_account = Account.first
8
-
9
- # attachments.inline['logo.jpg'] = LogoUploader.new.read(@current_account.logo) if @current_account.logo.url
10
-
11
- mail(
12
- to: "\"#{@current_account.name}\" <#{ @current_account.email }>",
13
- from: "\"#{@inquiry.name}\" <#{@inquiry.email}>",
14
- subject: @inquiry.message.truncate(97, separator: ' ')
15
- )
16
- end
17
-
18
- end
19
- end
@@ -1,41 +0,0 @@
1
- module Spina
2
- class Inquiry < ActiveRecord::Base
3
- include ActionView::Helpers::TextHelper
4
-
5
- validates_presence_of :email, :message, :name
6
- validates :email, format: {with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i}
7
-
8
- before_save :archive_if_spam
9
-
10
- # Filters spam gem incompatible met rails 4.1
11
- # filters_spam({
12
- # author_field: :name,
13
- # message_field: :message,
14
- # email_field: :email,
15
- # other_fields: [],
16
- # extra_spam_words: %w()
17
- # })
18
-
19
- scope :ham, -> { where(spam: [false, nil]) }
20
- scope :spam, -> { where(spam: true)}
21
- scope :new_messages, -> { ham.where(archived: false) }
22
- scope :sorted, -> { ham.order("created_at DESC") }
23
-
24
- def archive_if_spam
25
- self.archived = true if self.spam
26
- end
27
-
28
- def summary
29
- truncate(message, length: 120)
30
- end
31
-
32
- def ham!
33
- update_attributes({spam: false}, without_protection: true)
34
- end
35
-
36
- def spam!
37
- update_attributes({spam: true}, without_protection: true)
38
- end
39
-
40
- end
41
- end
@@ -1,24 +0,0 @@
1
- - content_for :secondary_navigation do
2
- %nav#secondary
3
- %h1= Spina::Inquiry.model_name.human(count: 2)
4
-
5
- %ul
6
- %li{class: ('active' if ["inbox", "inbox_show"].include? action_name )}
7
- = link_to spina.inbox_admin_inquiries_path do
8
- = icon('mail-outline')
9
- - if @new_messages.present?
10
- = "#{t('spina.inquiries.inbox')} (#{@new_messages.size})"
11
- - else
12
- = t('spina.inquiries.inbox')
13
- %small= t('spina.inquiries.inbox_description')
14
-
15
- %li{class: ('active' if ["index", "spam", "show"].include? action_name )}
16
- = link_to spina.admin_inquiries_path do
17
- = icon('inbox-outline')
18
- = t('spina.inquiries.all')
19
- %small= t('spina.inquiries.all_description')
20
-
21
- - content_for :content do
22
- = yield
23
-
24
- = render template: "layouts/spina/admin/application"
@@ -1,26 +0,0 @@
1
- = form_for [spina, :admin, current_account] do |f|
2
- .table-container
3
- %table.table.table-form
4
- %tr
5
- %td
6
- = Spina::Account.human_attribute_name(:aviary_language)
7
- %td
8
- .select-dropdown
9
- = f.select :aviary_language, [["English", "en"],["Bulgarian", "bg"],["Catalan", "ca"],["Chinese-(simplified)", "zh_HANS"],["Chinese-(traditional)", "zh_HANT"],["Czech", "cs"],["Danish", "da"],["Dutch", "nl"],["Finnish", "fi"],["French", "fr"],["German", "de"],["Greek", "el"],["Hebrew", "he"],["Hungarian", "hu"],["Indonesian", "id"],["Italian", "it"],["Japanese", "ja"],["Korean", "ko"],["Latvian", "lv"],["Lithuanian", "lt"],["Norwegian", "no"],["Polish", "pl"],["Portuguese", "pt"],["Portuguese-(Brazilian)", "pt_BR"],["Russian", "ru"],["Spanish", "es"],["Slovak", "sk"],["Swedish", "sv"],["Turkish", "tr"],["Vietnamese", "vi"]], prompt: "Select language"
10
- %tr
11
- %td
12
- = Spina::Account.human_attribute_name(:aviary_api_key)
13
- %td
14
- = f.text_field :aviary_api_key, placeholder: Spina::Account.human_attribute_name(:aviary_api_key)
15
- %tr
16
- %td
17
- = Spina::Account.human_attribute_name(:ngrok_address)
18
- %br
19
- %span
20
- %i Localhost aviary testing
21
- %td
22
- = f.text_field :ngrok_address, placeholder: Spina::Account.human_attribute_name(:ngrok_address)
23
-
24
- %button.button.button-primary{type: 'submit'}
25
- = icon('check')
26
- = t('spina.preferences.aviary_save')
@@ -1,30 +0,0 @@
1
- .table-container
2
- %table.table
3
- %thead
4
- %tr
5
- %th{width: 200}= Spina::Inquiry.human_attribute_name(:name)
6
- %th= Spina::Inquiry.human_attribute_name(:message)
7
- %th{colspan: 2}
8
-
9
- %tbody
10
- - if @inquiries.present?
11
- - @inquiries.each do |inquiry|
12
- %tr
13
- %td
14
- %p
15
- %strong= inquiry.name
16
-
17
- %td
18
- %p= link_to inquiry.summary, spina.inbox_show_admin_inquiry_path(inquiry)
19
-
20
- %td.nowrap
21
- = l inquiry.created_at, format: '%e %B %Y %H:%M'
22
-
23
- %td.nowrap
24
- = link_to t('spina.inquiries.mark_as_read'), spina.mark_as_read_admin_inquiry_path(inquiry), method: :patch, class: 'button button-link button-small', data: {icon: 'k'}
25
- = link_to t('spina.delete'), spina.admin_inquiry_path(inquiry), method: :delete, class: 'button button-danger button-link button-small', data: {confirm: t('spina.inquiries.delete_confirmation', subject: inquiry.name)}
26
-
27
- - else
28
- %tr
29
- %td.align-center{colspan: 3}
30
- %em= t('spina.inquiries.empty_inbox')
@@ -1,36 +0,0 @@
1
- - content_for(:tertiary_navigation) do
2
- %nav.tabs
3
- %ul
4
- %li{class: ('active' if action_name == "index")}
5
- = link_to spina.admin_inquiries_path do
6
- = t('spina.inquiries.all')
7
- %li{ class: ('active' if action_name == 'spam')}
8
- = link_to spina.spam_admin_inquiries_path do
9
- = t('spina.inquiries.spam')
10
-
11
- .table-container
12
- %table.table
13
- %thead
14
- %tr
15
- %th{width: 200}= Spina::Inquiry.human_attribute_name(:name)
16
- %th= Spina::Inquiry.human_attribute_name(:message)
17
- %th{colspan: 2}
18
-
19
- %tbody
20
- - if @inquiries.present?
21
- - @inquiries.each do |inquiry|
22
- %tr
23
- %td
24
- %p
25
- %strong= inquiry.name
26
- %td
27
- %p
28
- = link_to inquiry.summary, spina.admin_inquiry_path(inquiry)
29
- %td.nowrap
30
- %small=l inquiry.created_at, format: '%e %B %Y %H:%M'
31
- %td.nowrap
32
- = link_to t('spina.delete'), spina.admin_inquiry_path(inquiry), method: :delete, class: 'button button-danger button-link button-small', data: {confirm: t('spina.inquiries.delete_confirmation', subject: inquiry.name)}
33
- - else
34
- %tr
35
- %td.align-center{colspan: 3}
36
- %em= t('spina.inquiries.empty')
@@ -1,23 +0,0 @@
1
- .table-container.table-form
2
- %table.table
3
- %tr
4
- %th= Spina::Inquiry.human_attribute_name(:name)
5
- %td= @inquiry.name
6
- %tr
7
- %th= Spina::Inquiry.human_attribute_name(:email)
8
- %td= @inquiry.email
9
- %tr
10
- %th= Spina::Inquiry.human_attribute_name(:phone)
11
- %td= @inquiry.phone
12
- %tr
13
- %td
14
- %td= simple_format @inquiry.message
15
-
16
- .pull-right
17
- - unless @inquiry.archived?
18
- = link_to t('spina.inquiries.mark_as_read'), spina.mark_as_read_admin_inquiry_path(@inquiry), method: :patch, class: 'button', data: {icon: 'k'}
19
-
20
- - if @inquiry.spam
21
- = link_to t('spina.inquiries.no_spam'), spina.unmark_spam_admin_inquiry_path(@inquiry), method: :patch, class: 'button', data: {icon: 'v'}
22
-
23
- = link_to t('spina.delete'), spina.admin_inquiry_path(@inquiry), method: :delete, class: 'button button-danger button-link', data: {confirm: t('spina.inquiries.delete_confirmation', subject: @inquiry.name)}
@@ -1,36 +0,0 @@
1
- - content_for(:tertiary_navigation) do
2
- %nav.tabs
3
- %ul
4
- %li{class: ('active' if action_name == "index")}
5
- = link_to spina.admin_inquiries_path do
6
- = t('spina.inquiries.all')
7
- %li{ class: ('active' if action_name == 'spam')}
8
- = link_to spina.spam_admin_inquiries_path do
9
- = t('spina.inquiries.spam')
10
-
11
- .table-container
12
- %table.table
13
- %thead
14
- %tr
15
- %th{width: 200}= Spina::Inquiry.human_attribute_name(:name)
16
- %th= Spina::Inquiry.human_attribute_name(:message)
17
- %th{colspan: 2}
18
-
19
- %tbody
20
- - if @inquiries.present?
21
- - @inquiries.each do |inquiry|
22
- %tr
23
- %td
24
- %p
25
- %strong= inquiry.name
26
- %td
27
- %p= link_to inquiry.summary, spina.admin_inquiry_path(inquiry)
28
- %td.nowrap
29
- %small=l inquiry.created_at, format: '%e %B %Y %H:%M'
30
- %td.nowrap
31
- = link_to t('spina.inquiries.no_spam'), spina.unmark_spam_admin_inquiry_path(inquiry), method: :patch, class: 'button button-link button-primary button-small', data: {icon: 'x'}
32
- = link_to t('spina.delete'), spina.admin_inquiry_path(inquiry), method: :delete, class: 'button button-danger button-link button-small', data: {confirm: t('spina.inquiries.delete_confirmation', subject: inquiry.name)}
33
- - else
34
- %tr
35
- %td.align-center{colspan: 3}
36
- %em= t('spina.inquiries.empty_spam')
@@ -1,4 +0,0 @@
1
- = color_form.fields_for :layout_partable, color_form.object.layout_partable do |form|
2
- .colorpicker
3
- = form.text_field :content, placeholder: color_form.object.title
4
- .colorpicker-container
@@ -1,2 +0,0 @@
1
- = line_form.fields_for :layout_partable, line_form.object.layout_partable do |form|
2
- = form.text_field :content, placeholder: line_form.object.title
@@ -1,20 +0,0 @@
1
- .horizontal-form-label
2
- = attachment_collection_form.object.title
3
- .horizontal-form-content
4
- = attachment_collection_form.hidden_field :id
5
- = attachment_collection_form.hidden_field :title
6
- = attachment_collection_form.hidden_field :page_partable_type
7
- = attachment_collection_form.hidden_field :name
8
-
9
- = attachment_collection_form.fields_for :page_partable, attachment_collection_form.object.page_partable do |form|
10
- = link_to select_collection_admin_attachments_path(form.object_name), remote: true, class: "media_picker" do
11
- .clearfix
12
- .placeholder.pull-right
13
- %span.button.button-small.button-round
14
- %i.icon.icon-dots
15
- = t('spina.choose_from_library')
16
- - if form.object.attachments.any?
17
- - form.object.attachments.each do |attachment|
18
- .attachment= attachment.name
19
-
20
- = form.hidden_field :attachment_tokens, value: form.object.attachment_ids.join(",")
@@ -1,19 +0,0 @@
1
- .horizontal-form-label
2
- = attachment_form.object.title
3
- .horizontal-form-content
4
- = attachment_form.hidden_field :id
5
- = attachment_form.hidden_field :title
6
- = attachment_form.hidden_field :page_partable_type
7
- = attachment_form.hidden_field :name
8
-
9
- = link_to select_admin_attachments_path(attachment_form.object_name), remote: true, class: "media_picker" do
10
- .clearfix
11
- .placeholder.pull-right
12
- %span.button.button-small.button-round
13
- %i.icon.icon-dots
14
- = t('spina.choose_from_library')
15
-
16
- - if attachment_form.object.page_partable && attachment_form.object.page_partable.file.present?
17
- .attachment= attachment_form.object.page_partable.name
18
-
19
- = attachment_form.hidden_field :page_partable_id
@@ -1,12 +0,0 @@
1
- .horizontal-form-label
2
- = color_form.object.title
3
- .horizontal-form-content
4
- = color_form.hidden_field :id
5
- = color_form.hidden_field :title
6
- = color_form.hidden_field :page_partable_type
7
- = color_form.hidden_field :name
8
-
9
- = color_form.fields_for :page_partable, color_form.object.page_partable do |form|
10
- .colorpicker
11
- = form.text_field :content, placeholder: color_form.object.title
12
- .colorpicker-container
@@ -1,10 +0,0 @@
1
- .horizontal-form-label
2
- = line_form.object.title
3
- .horizontal-form-content
4
- = line_form.hidden_field :id
5
- = line_form.hidden_field :title
6
- = line_form.hidden_field :page_partable_type
7
- = line_form.hidden_field :name
8
-
9
- = line_form.fields_for :page_partable, line_form.object.page_partable do |form|
10
- = form.text_field :content, placeholder: "#{t 'spina.pages.page_part'} #{line_form.object.name.downcase}"