roroacms 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. data/MIT-LICENSE +20 -20
  2. data/README.md +62 -61
  3. data/Rakefile +19 -19
  4. data/app/assets/javascripts/roroacms/admin/application.js +1 -3
  5. data/app/assets/javascripts/roroacms/admin/roroacms-tour.js +46 -46
  6. data/app/assets/javascripts/roroacms/application.js +9 -21
  7. data/app/assets/javascripts/roroacms/vendor/hopscotch.js +2409 -2409
  8. data/app/assets/stylesheets/roroacms/admin/application.css +5 -3
  9. data/app/assets/stylesheets/roroacms/vendor/hopscotch.css +512 -512
  10. data/app/assets/stylesheets/roroacms/vendor/jquery/jquery-ui.css +1177 -1177
  11. data/app/controllers/roroacms/admin_controller.rb +1 -0
  12. data/app/controllers/roroacms/application_controller.rb +5 -3
  13. data/app/helpers/roroacms/admin_roroa_helper.rb +4 -4
  14. data/app/helpers/roroacms/admin_view_helper.rb +16 -16
  15. data/app/helpers/roroacms/application_helper.rb +4 -4
  16. data/app/helpers/roroacms/general_helper.rb +8 -8
  17. data/app/helpers/roroacms/new_view_helper.rb +7 -6
  18. data/app/helpers/roroacms/routing_helper.rb +15 -15
  19. data/app/helpers/roroacms/seo_helper.rb +2 -1
  20. data/app/helpers/roroacms/theme_helper.rb +6 -6
  21. data/app/helpers/roroacms/view_helper.rb +4 -4
  22. data/app/mailers/roroacms/emailer.rb +31 -31
  23. data/app/views/layouts/roroacms/application.html.erb +1 -1
  24. data/app/views/roroacms/admin/partials/_append_sidebar_menu.html.erb +51 -51
  25. data/app/views/roroacms/admin/partials/_comment.html.erb +10 -1
  26. data/app/views/roroacms/admin/partials/_editor.html.erb +21 -21
  27. data/app/views/roroacms/setup/administrator.html.erb +72 -72
  28. data/app/views/roroacms/setup/index.html.erb +108 -108
  29. data/config/initializers/devise.rb +258 -258
  30. data/config/locales/devise.en.yml +115 -115
  31. data/config/locales/en.yml +1 -1
  32. data/config/routes.rb +96 -96
  33. data/db/migrate/20140801203556_add_admins.rb +44 -44
  34. data/db/migrate/20140802084604_add_roroacms_comments.rb +31 -31
  35. data/db/migrate/20140802084615_add_roroacms_menu_options.rb +24 -24
  36. data/db/migrate/20140802084624_add_roroacms_menus.rb +18 -18
  37. data/db/migrate/20140802084631_add_roroacms_posts.rb +42 -42
  38. data/db/migrate/20140802084638_add_roroacms_settings.rb +21 -21
  39. data/db/migrate/20140802084658_add_roroacms_term_anatomies.rb +20 -20
  40. data/db/migrate/20140802084707_add_roroacms_term_relationships.rb +23 -23
  41. data/db/migrate/20140802084717_add_roroacms_terms.rb +27 -27
  42. data/lib/ext/string.rb +4 -4
  43. data/lib/generators/roroacms/install_generator.rb +16 -16
  44. data/lib/roroacms/engine.rb +4 -5
  45. data/lib/roroacms/version.rb +3 -3
  46. data/lib/roroacms.rb +5 -5
  47. data/lib/tasks/roroacms_tasks.rake +9 -9
  48. data/spec/controllers/roroacms/admin/themes_controller_spec.rb +2 -2
  49. data/spec/dummy/README.rdoc +28 -28
  50. data/spec/dummy/Rakefile +6 -6
  51. data/spec/dummy/app/controllers/application_controller.rb +5 -5
  52. data/spec/dummy/app/helpers/application_helper.rb +2 -2
  53. data/spec/dummy/app/helpers/theme_helper.rb +12 -12
  54. data/spec/dummy/app/views/layouts/application.html.erb +14 -14
  55. data/spec/dummy/app/views/theme/roroa-bootstrap-3/theme_helper.rb +8 -8
  56. data/spec/dummy/app/views/theme/roroa1/assets/stylesheets/style.css.scss +8 -8
  57. data/spec/dummy/app/views/theme/roroa1/layout.html.erb +1 -1
  58. data/spec/dummy/bin/bundle +3 -3
  59. data/spec/dummy/bin/rails +4 -4
  60. data/spec/dummy/bin/rake +4 -4
  61. data/spec/dummy/config/application.rb +23 -23
  62. data/spec/dummy/config/boot.rb +5 -5
  63. data/spec/dummy/config/database.yml +7 -7
  64. data/spec/dummy/config/environment.rb +5 -5
  65. data/spec/dummy/config/environments/development.rb +37 -37
  66. data/spec/dummy/config/environments/production.rb +82 -82
  67. data/spec/dummy/config/environments/test.rb +39 -39
  68. data/spec/dummy/config/initializers/assets.rb +8 -8
  69. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -7
  70. data/spec/dummy/config/initializers/cookies_serializer.rb +2 -2
  71. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -4
  72. data/spec/dummy/config/initializers/inflections.rb +16 -16
  73. data/spec/dummy/config/initializers/mime_types.rb +4 -4
  74. data/spec/dummy/config/initializers/session_store.rb +3 -3
  75. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -14
  76. data/spec/dummy/config/locales/en.yml +23 -23
  77. data/spec/dummy/config/routes.rb +3 -3
  78. data/spec/dummy/config/secrets.yml +22 -22
  79. data/spec/dummy/config.ru +4 -4
  80. data/spec/dummy/db/schema.rb +149 -149
  81. data/spec/dummy/public/404.html +67 -67
  82. data/spec/dummy/public/422.html +67 -67
  83. data/spec/dummy/public/500.html +66 -66
  84. data/spec/dummy/public/javascripts/translations.js +1 -1
  85. data/spec/dummy/tmp/cache/i18n-js.yml +36 -36
  86. data/spec/models/roroacms/admin_spec.rb +67 -67
  87. data/spec/spec_helper.rb +35 -35
  88. data/spec/support/factories.rb +79 -79
  89. metadata +2 -2
@@ -33,6 +33,7 @@ module Roroacms
33
33
  redirect_to admin_path, flash: { error: I18n.t("controllers.admin.misc.authorize_admin_access_error") }
34
34
  end
35
35
  end
36
+
36
37
 
37
38
  def after_sign_out_path_for(resource_or_scope)
38
39
  clear_cache
@@ -24,10 +24,12 @@ module Roroacms
24
24
  # Override the generic 404 page to use the 404 in the theme directory
25
25
 
26
26
  def render_404
27
- render( :template => "theme/#{current_theme}/error_404", :layout => 'layouts/roroacms/application', :status => :not_found) if File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/error_404.html.erb")
27
+ if File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/error_404.html.erb")
28
+ render( :template => "themes/#{current_theme}/error_404", :layout => 'layouts/roroacms/application', :status => :not_found)
29
+ else
30
+ raise ActionController::RoutingError.new('404: Page was not found')
31
+ end
28
32
  end
29
-
30
-
31
33
 
32
34
  # Get the current theme being used by the application
33
35
 
@@ -15,7 +15,7 @@ module Roroacms
15
15
  def get_theme_options
16
16
 
17
17
  hash = []
18
- Dir.glob("#{Rails.root}/app/views/theme/*/") do |themes|
18
+ Dir.glob("#{Rails.root}/app/views/themes/*/") do |themes|
19
19
  opt = themes.split('/').last
20
20
  if File.exists?("#{themes}theme.yml")
21
21
  info = YAML.load(File.read("#{themes}theme.yml"))
@@ -33,7 +33,7 @@ module Roroacms
33
33
 
34
34
  def destory_theme(theme)
35
35
  require 'fileutils'
36
- FileUtils.rm_rf("#{Rails.root}/app/views/theme/#{theme}")
36
+ FileUtils.rm_rf("#{Rails.root}/app/views/themes/#{theme}")
37
37
  end
38
38
 
39
39
  # retuns a hash of the template files within the current theme
@@ -42,7 +42,7 @@ module Roroacms
42
42
  hash = []
43
43
  current_theme = Setting.get('theme_folder')
44
44
 
45
- Dir.glob("#{Rails.root}/app/views/theme/#{current_theme}/template-*.html.erb") do |my_text_file|
45
+ Dir.glob("#{Rails.root}/app/views/themes/#{current_theme}/template-*.html.erb") do |my_text_file|
46
46
  opt = my_text_file.split('/').last
47
47
  opt['template-'] = ''
48
48
  opt['.html.erb'] = ''
@@ -125,7 +125,7 @@ module Roroacms
125
125
 
126
126
  def theme_exists
127
127
 
128
- if !Dir.exists?("app/views/theme/#{Setting.get('theme_folder')}/")
128
+ if !Dir.exists?("app/views/themes/#{Setting.get('theme_folder')}/")
129
129
  html = "<div class='alert alert-danger'><strong>" + I18n.t("helpers.admin_roroa_helper.theme_exists.warning") + "!</strong> " + I18n.t("helpers.admin_roroa_helper.theme_exists.message") + "!</div>"
130
130
  render :inline => html.html_safe
131
131
  end
@@ -1,17 +1,17 @@
1
- module Roroacms
2
- module AdminViewHelper
3
-
4
- def obtain_admin_table_header(variables)
5
- render partial: 'roroacms/admin/partials/table_header', locals: variables
6
- end
7
-
8
- def obtain_admin_submit_bar
9
- render :partial => 'roroacms/admin/partials/submit_bar'
10
- end
11
-
12
- def obtain_admin_editor(variables)
13
- render :partial => 'roroacms/admin/partials/editor', locals: variables
14
- end
15
-
16
- end
1
+ module Roroacms
2
+ module AdminViewHelper
3
+
4
+ def obtain_admin_table_header(variables)
5
+ render partial: 'roroacms/admin/partials/table_header', locals: variables
6
+ end
7
+
8
+ def obtain_admin_submit_bar
9
+ render :partial => 'roroacms/admin/partials/submit_bar'
10
+ end
11
+
12
+ def obtain_admin_editor(variables)
13
+ render :partial => 'roroacms/admin/partials/editor', locals: variables
14
+ end
15
+
16
+ end
17
17
  end
@@ -1,4 +1,4 @@
1
- module Roroacms
2
- module ApplicationHelper
3
- end
4
- end
1
+ module Roroacms
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -6,8 +6,8 @@ module Roroacms
6
6
  # +key+:: YAML key of the value that you want to retrive
7
7
 
8
8
  def theme_yaml(key = nil)
9
- if File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/theme.yml")
10
- theme_yaml = YAML.load(File.read("#{Rails.root}/app/views/theme/#{current_theme}/theme.yml"))
9
+ if File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/theme.yml")
10
+ theme_yaml = YAML.load(File.read("#{Rails.root}/app/views/themes/#{current_theme}/theme.yml"))
11
11
  theme_yaml[key]
12
12
  else
13
13
  'html.erb'
@@ -18,10 +18,10 @@ module Roroacms
18
18
 
19
19
  def rewrite_theme_helper
20
20
 
21
- if File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/theme_helper.rb")
21
+ if File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/theme_helper.rb")
22
22
 
23
23
  # get the theme helper from the theme folder
24
- file = File.open("#{Rails.root}/app/views/theme/#{current_theme}/theme_helper.rb", "rb")
24
+ file = File.open("#{Rails.root}/app/views/themes/#{current_theme}/theme_helper.rb", "rb")
25
25
  contents = file.read
26
26
 
27
27
  # check if the first line starts with the module name or not
@@ -46,7 +46,7 @@ module Roroacms
46
46
  # do a check to see if theme has theme.yml file
47
47
 
48
48
  def check_theme_folder
49
- if !File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/theme.yml")
49
+ if !File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/theme.yml")
50
50
  render :inline => I18n.t("helpers.general_helper.check_theme_folder.message") and return
51
51
  end
52
52
  end
@@ -55,17 +55,17 @@ module Roroacms
55
55
  change = false
56
56
  hash = {'theme.yml' => 'Y', 'layout.html.erb' => 'Y', 'page.html.erb' => 'Y'}
57
57
 
58
- if !File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/theme.yml")
58
+ if !File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/theme.yml")
59
59
  hash['theme.yml'] = 'N'
60
60
  change = true
61
61
  end
62
62
 
63
- if !File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/layout.html.erb")
63
+ if !File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/layout.html.erb")
64
64
  hash['layout.html.erb'] = 'N'
65
65
  change = true
66
66
  end
67
67
 
68
- if !File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/page.html.erb")
68
+ if !File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/page.html.erb")
69
69
  hash['page.html.erb'] = 'N'
70
70
  change = true
71
71
  end
@@ -409,7 +409,7 @@ module Roroacms
409
409
  segments = params[:slug].split('/')
410
410
 
411
411
  if type == 'string'
412
-
412
+ return '' if not defined?(@content.terms)
413
413
  terms = @content.terms.where(roroacms_term_anatomies: {taxonomy: 'tag'}).includes(:term_anatomy)
414
414
  return terms.all.map do |u|
415
415
  url = article_url + '/' + tag_url + u.structured_url
@@ -533,6 +533,7 @@ module Roroacms
533
533
  p = Post.where("(post_type = 'post' AND post_status = 'Published' AND disabled = 'N') AND post_date <= CURRENT_TIMESTAMP").uniq.pluck("EXTRACT(year FROM post_date)")
534
534
  lp = {}
535
535
 
536
+
536
537
  if !p.blank?
537
538
  p.each do |f|
538
539
  lp["#{f}"] = Post.where("EXTRACT(year from post_date) = #{f} AND (post_type = 'post' AND disabled = 'N' AND post_status = 'Published' AND post_date <= CURRENT_TIMESTAMP)").uniq.pluck("EXTRACT(MONTH FROM post_date)")
@@ -547,7 +548,7 @@ module Roroacms
547
548
  h["#{article_url}/#{k.to_i}"] = k.to_i
548
549
  end
549
550
 
550
- i.each do |nm|
551
+ i.sort.each do |nm|
551
552
  h["#{article_url}/#{k.to_i}/#{nm.to_i}"] = "#{get_date_name_by_number(nm.to_i)} - #{k.to_i}"
552
553
  end
553
554
 
@@ -839,8 +840,8 @@ module Roroacms
839
840
  if Setting.get('article_comments') == 'Y'
840
841
  type = Setting.get('article_comment_type')
841
842
  @new_comment = Comment.new
842
- if File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/comments_form." + get_theme_ext)
843
- render(:template => "theme/#{current_theme}/comments_form." + get_theme_ext , :layout => nil, :locals => { type: type }).to_s
843
+ if File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/comments_form." + get_theme_ext)
844
+ render(:template => "themes/#{current_theme}/comments_form." + get_theme_ext , :layout => nil, :locals => { type: type }).to_s
844
845
  else
845
846
  render :inline => 'comments_form.html.erb does not exist in current theme'
846
847
  end
@@ -852,8 +853,8 @@ module Roroacms
852
853
  # this is created and displayed from the theme.
853
854
 
854
855
  def obtain_search_form
855
- if File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/search_form." + get_theme_ext)
856
- render :template => "theme/#{current_theme}/search_form." + get_theme_ext
856
+ if File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/search_form." + get_theme_ext)
857
+ render :template => "themes/#{current_theme}/search_form." + get_theme_ext
857
858
  else
858
859
  render :inline => 'search_form.html.erb does not exist in current theme'
859
860
  end
@@ -200,7 +200,7 @@ module Roroacms
200
200
  term = Term.where(:structured_url => '/' + segments.join('/')).first
201
201
 
202
202
  # do a search for the content
203
- gloalize Post.joins(terms: :term_anatomy).where("post_status = 'Published' AND post_type != 'autosave' AND post_date <= CURRENT_TIMESTAMP AND disabled = 'N' AND terms.id = ? ", term).where(term_anatomies: {taxonomy: term_type}).order('post_date DESC').page(params[:page]).per(Setting.get('pagination_per_fe'))
203
+ gloalize Post.joins(terms: :term_anatomy).where("post_status = 'Published' AND post_type != 'autosave' AND post_date <= CURRENT_TIMESTAMP AND disabled = 'N' AND roroacms_terms.id = ? ", term).where(roroacms_term_anatomies: {taxonomy: term_type}).order('post_date DESC').page(params[:page]).per(Setting.get('pagination_per_fe'))
204
204
 
205
205
  # add the breadcrumbs
206
206
  add_breadcrumb "#{article_url.capitalize}", "/#{article_url}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: article_url.capitalize)
@@ -275,7 +275,7 @@ module Roroacms
275
275
  add_breadcrumb "#{segments[1]}", "/#{article_url}/#{segments[1]}", :title => I18n.t("helpers.routing_helper.generic.back_to", word: segments[1])
276
276
 
277
277
  # build SQL variable
278
- build_sql = Post.where("(disabled = 'N' AND post_status = 'Published') AND post_type = 'Post' AND (EXTRACT(year from post_date) = ?)", segments[1])
278
+ build_sql = Post.where("(disabled = 'N' AND post_status = 'Published') AND post_type = 'post' AND (EXTRACT(year from post_date) = ?)", segments[1])
279
279
 
280
280
 
281
281
  if !segments[2].blank?
@@ -306,7 +306,7 @@ module Roroacms
306
306
  # returns a boolean as to wether the template file actually exist in the theme?
307
307
 
308
308
  def template_exists?(path)
309
- File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/" + path + '.' + get_theme_ext)
309
+ File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/" + path + '.' + get_theme_ext)
310
310
  end
311
311
 
312
312
  # checks for the top level file, but returns the file that it can actually use
@@ -319,27 +319,27 @@ module Roroacms
319
319
  when 'archive'
320
320
 
321
321
  if template_exists?("archive")
322
- render :template => "theme/#{current_theme}/archive." + get_theme_ext
322
+ render :template => "themes/#{current_theme}/archive." + get_theme_ext
323
323
  elsif template_exists?("category")
324
- render :template => "theme/#{current_theme}/category." + get_theme_ext
324
+ render :template => "themes/#{current_theme}/category." + get_theme_ext
325
325
  else
326
- render :template => "theme/#{current_theme}/page." + get_theme_ext
326
+ render :template => "themes/#{current_theme}/page." + get_theme_ext
327
327
  end
328
328
 
329
329
  when 'category'
330
330
 
331
331
  if template_exists?("category")
332
- render :template => "theme/#{current_theme}/category." + get_theme_ext
332
+ render :template => "themes/#{current_theme}/category." + get_theme_ext
333
333
  else
334
- render :template => "theme/#{current_theme}/page." + get_theme_ext
334
+ render :template => "themes/#{current_theme}/page." + get_theme_ext
335
335
  end
336
336
 
337
337
  when 'search'
338
338
 
339
339
  if template_exists?("category")
340
- render :template => "theme/#{current_theme}/search." + get_theme_ext
340
+ render :template => "themes/#{current_theme}/search." + get_theme_ext
341
341
  else
342
- render :tempalte => "theme/#{current_theme}/page." + get_theme_ext
342
+ render :tempalte => "themes/#{current_theme}/page." + get_theme_ext
343
343
  end
344
344
 
345
345
  end
@@ -357,16 +357,16 @@ module Roroacms
357
357
  # check if the template file actually exists
358
358
  if template_exists?("template-#{@content.post_template.downcase}")
359
359
 
360
- render :template => "theme/#{current_theme}/template-#{@content.post_template.downcase}." + get_theme_ext
360
+ render :template => "themes/#{current_theme}/template-#{@content.post_template.downcase}." + get_theme_ext
361
361
 
362
362
  else
363
363
 
364
364
  # check if a file with the given name exists
365
365
  if template_exists?(name)
366
- render :template => "theme/#{current_theme}/#{name}." + get_theme_ext
366
+ render :template => "themes/#{current_theme}/#{name}." + get_theme_ext
367
367
  elsif template_exists?("page")
368
368
  # if not use the page.html.erb template which has to be included in the theme
369
- render :template => "theme/#{current_theme}/page." + get_theme_ext
369
+ render :template => "themes/#{current_theme}/page." + get_theme_ext
370
370
  else
371
371
  render :inline => I18n.t("helpers.routing_helper.render_template.template_error")
372
372
  end
@@ -377,10 +377,10 @@ module Roroacms
377
377
 
378
378
  # check if a file with the given name exists
379
379
  if template_exists?(name)
380
- render :template => "theme/#{current_theme}/#{name}." + get_theme_ext
380
+ render :template => "themes/#{current_theme}/#{name}." + get_theme_ext
381
381
  elsif template_exists?("page")
382
382
  # if not use the page.html.erb template which has to be included in the theme
383
- render :template => "theme/#{current_theme}/page." + get_theme_ext
383
+ render :template => "themes/#{current_theme}/page." + get_theme_ext
384
384
  else
385
385
  render :inline => I18n.t("helpers.routing_helper.render_template.template_error")
386
386
  end
@@ -14,6 +14,7 @@ module Roroacms
14
14
 
15
15
  if !@content.nil?
16
16
 
17
+
17
18
  # if it has ACTUAL content then generate meta from the page content
18
19
  if !(@content.respond_to? :length)
19
20
 
@@ -24,7 +25,7 @@ module Roroacms
24
25
  headtags = get_manual_metadata 'home'
25
26
  else
26
27
  # use the page content to generate the meta data
27
- headtags = "#{@seo_title}\n"
28
+ headtags = "#{get_page_title}\n"
28
29
  headtags += "#{get_meta_description}\n"
29
30
  headtags += "#{get_google_analytics}\n"
30
31
  headtags += "#{get_robots_tag}"
@@ -1,7 +1,7 @@
1
- module Roroacms
2
- module ThemeHelper
3
-
4
- # theme helper
5
-
6
- end
1
+ module Roroacms
2
+ module ThemeHelper
3
+
4
+ # theme helper
5
+
6
+ end
7
7
  end
@@ -137,7 +137,7 @@ module Roroacms
137
137
  # +name+:: the name of the template file that you want to check exists
138
138
 
139
139
  def view_file_exists?(name)
140
- File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/template-#{name}." + get_theme_ext )
140
+ File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/template-#{name}." + get_theme_ext )
141
141
  end
142
142
 
143
143
 
@@ -154,19 +154,19 @@ module Roroacms
154
154
  # +append+:: the name of the file that you want to render
155
155
 
156
156
  def theme_url(append)
157
- "theme/#{current_theme}/#{append}"
157
+ "themes/#{current_theme}/#{append}"
158
158
  end
159
159
 
160
160
  # displays the header. + get_theme_ext template in the theme if the file exists
161
161
 
162
162
  def display_header
163
- render :template => "/theme/#{current_theme}/header." + get_theme_ext if File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/header." + get_theme_ext )
163
+ render :template => "/themes/#{current_theme}/header." + get_theme_ext if File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/header." + get_theme_ext )
164
164
  end
165
165
 
166
166
  # displays the header. + get_theme_ext template in the theme if the file exists
167
167
 
168
168
  def display_footer
169
- render :template => "theme/#{current_theme}/footer." + get_theme_ext if File.exists?("#{Rails.root}/app/views/theme/#{current_theme}/footer." + get_theme_ext )
169
+ render :template => "themes/#{current_theme}/footer." + get_theme_ext if File.exists?("#{Rails.root}/app/views/themes/#{current_theme}/footer." + get_theme_ext )
170
170
  end
171
171
 
172
172
  end
@@ -1,31 +1,31 @@
1
- module Roroacms
2
- class Emailer < ActionMailer::Base
3
- default from: "from@example.com"
4
- add_template_helper(Roroacms::AdminRoroaHelper)
5
- add_template_helper(Roroacms::NewViewHelper)
6
- default from: Setting.get('smtp_domain')
7
-
8
- class MailSettingsInterceptor
9
- def self.delivering_email(message)
10
- message.delivery_method.settings.merge!(Setting.mail_settings)
11
- end
12
- end
13
- register_interceptor MailSettingsInterceptor
14
-
15
- # sends an email to the admin email address (set in the admin panel)
16
- # notifying them that a new administrator has been set up
17
- def profile(admin = nil)
18
- @admin = admin
19
- mail to: Setting.get('site_email')
20
- end
21
-
22
- # sends an email to the admin email address (set in the admin panel)
23
- # when someone comments on a blog post
24
-
25
- def comment(com)
26
- @comment = com
27
-
28
- mail to: Setting.get('site_email')
29
- end
30
- end
31
- end
1
+ module Roroacms
2
+ class Emailer < ActionMailer::Base
3
+ default from: "from@example.com"
4
+ add_template_helper(Roroacms::AdminRoroaHelper)
5
+ add_template_helper(Roroacms::NewViewHelper)
6
+ default from: Setting.get('smtp_domain')
7
+
8
+ class MailSettingsInterceptor
9
+ def self.delivering_email(message)
10
+ message.delivery_method.settings.merge!(Setting.mail_settings)
11
+ end
12
+ end
13
+ register_interceptor MailSettingsInterceptor
14
+
15
+ # sends an email to the admin email address (set in the admin panel)
16
+ # notifying them that a new administrator has been set up
17
+ def profile(admin = nil)
18
+ @admin = admin
19
+ mail to: Setting.get('site_email')
20
+ end
21
+
22
+ # sends an email to the admin email address (set in the admin panel)
23
+ # when someone comments on a blog post
24
+
25
+ def comment(com)
26
+ @comment = com
27
+
28
+ mail to: Setting.get('site_email')
29
+ end
30
+ end
31
+ end
@@ -1 +1 @@
1
- <%= render :template => "theme/#{current_theme}/layout" %>
1
+ <%= render :template => "themes/#{current_theme}/layout" %>
@@ -1,52 +1,52 @@
1
- <% if menu_block[:sub_menu].blank? %>
2
-
3
- <% if menu_block[:user_groups].blank? || (!menu_block[:user_groups].blank? && menu_block[:user_groups].include?(current_user.access_level)) %>
4
-
5
- <li class="">
6
-
7
- <%= link_to menu_block[:link] do %>
8
- <% if !menu_block[:icon].blank? %>
9
- <%= menu_block[:icon].html_safe %>
10
- <% end %>
11
- <%= menu_block[:title] %>
12
- <% end %>
13
-
14
- </li>
15
-
16
- <% end %>
17
-
18
- <% else %>
19
-
20
- <% if menu_block[:user_groups].blank? || (!menu_block[:user_groups].blank? && menu_block[:user_groups].include?(current_user.access_level)) %>
21
-
22
- <li class="sub-menu">
23
- <a href="javascript:;">
24
- <% if !menu_block[:icon].blank? %>
25
- <%= menu_block[:icon].html_safe %>
26
- <% end %>
27
- <%= menu_block[:title] %>
28
- <i class="arrow fa fa-angle-right pull-right"></i>
29
- </a>
30
- <ul>
31
-
32
- <% menu_block[:sub_menu].each do |link| %>
33
-
34
- <% if link[:user_groups].blank? || (!link[:user_groups].blank? && link[:user_groups].include?(current_user.access_level)) %>
35
- <li class="">
36
- <%= link_to link[:link] do %>
37
- <% if !link[:icon].blank? %>
38
- <%= link[:icon].html_safe %>
39
- <% end %>
40
- <%= link[:title] %>
41
- <% end %>
42
- </li>
43
- <% end %>
44
-
45
- <% end %>
46
-
47
- </ul>
48
- </li>
49
-
50
- <% end %>
51
-
1
+ <% if menu_block[:sub_menu].blank? %>
2
+
3
+ <% if menu_block[:user_groups].blank? || (!menu_block[:user_groups].blank? && menu_block[:user_groups].include?(current_user.access_level)) %>
4
+
5
+ <li class="">
6
+
7
+ <%= link_to menu_block[:link] do %>
8
+ <% if !menu_block[:icon].blank? %>
9
+ <%= menu_block[:icon].html_safe %>
10
+ <% end %>
11
+ <%= menu_block[:title] %>
12
+ <% end %>
13
+
14
+ </li>
15
+
16
+ <% end %>
17
+
18
+ <% else %>
19
+
20
+ <% if menu_block[:user_groups].blank? || (!menu_block[:user_groups].blank? && menu_block[:user_groups].include?(current_user.access_level)) %>
21
+
22
+ <li class="sub-menu">
23
+ <a href="javascript:;">
24
+ <% if !menu_block[:icon].blank? %>
25
+ <%= menu_block[:icon].html_safe %>
26
+ <% end %>
27
+ <%= menu_block[:title] %>
28
+ <i class="arrow fa fa-angle-right pull-right"></i>
29
+ </a>
30
+ <ul>
31
+
32
+ <% menu_block[:sub_menu].each do |link| %>
33
+
34
+ <% if link[:user_groups].blank? || (!link[:user_groups].blank? && link[:user_groups].include?(current_user.access_level)) %>
35
+ <li class="">
36
+ <%= link_to link[:link] do %>
37
+ <% if !link[:icon].blank? %>
38
+ <%= link[:icon].html_safe %>
39
+ <% end %>
40
+ <%= link[:title] %>
41
+ <% end %>
42
+ </li>
43
+ <% end %>
44
+
45
+ <% end %>
46
+
47
+ </ul>
48
+ </li>
49
+
50
+ <% end %>
51
+
52
52
  <% end %>
@@ -1,7 +1,16 @@
1
1
  <li class='comment'>
2
2
  <article class='comment'>
3
3
  <section class='comment-content comment'>
4
- <div class='comment-meta' data-author='<%= @comment.author %>'><a href='http://<%= @comment.website %>' target='_blank'><%= @comment.author %></a> <%= t("views.admin.generic.says") %>:-</div>
4
+ <div class='comment-meta' data-author='<%= @comment.author %>'>
5
+ <% if @comment.website.blank? %>
6
+ <%= @comment.author %>
7
+ <% else %>
8
+ <a href='http://<%= @comment.website %>' target='_blank'>
9
+ <%= @comment.author %>
10
+ </a>
11
+ <% end %>
12
+ <%= t("views.admin.generic.said") %>:-
13
+ </div>
5
14
  <span class='date'><%= @comment.submitted_on.strftime("%b %e %Y, %l:%M %p") %></span>
6
15
  <%= @comment.comment.html_safe %>
7
16
  </section>
@@ -1,22 +1,22 @@
1
- <div class="features">
2
- <section class="editor">
3
- <div class="outer">
4
- <div class="editorwrap">
5
- <section class="entry-markdown">
6
- <header class="floating-header"><%= t("views.admin.pages.new.tab_content.markdown") %> <a href="javascript:;" data-toggle="modal" data-target="#mdModal"><i class="fa fa-info-circle pull-right"></i></a></header>
7
- <section class="entry-markdown-content">
8
- <%= f.text_area field.to_sym, :class => 'markdown_editor', :value => content.blank? ? '...' : content %>
9
- </section>
10
- </section>
11
- <section class="entry-preview active">
12
- <header class="floating-header">&nbsp; <%= t("views.admin.generic.preview") %> <span class="entry-word-count">0 <%= t("views.admin.generic.words") %></span> </header>
13
- <section class="entry-preview-content">
14
- <div class="rendered-markdown"></div>
15
- </section>
16
- </section>
17
- </div>
18
- </div>
19
- </section>
20
- </div>
21
-
1
+ <div class="features">
2
+ <section class="editor">
3
+ <div class="outer">
4
+ <div class="editorwrap">
5
+ <section class="entry-markdown">
6
+ <header class="floating-header"><%= t("views.admin.pages.new.tab_content.markdown") %> <a href="javascript:;" data-toggle="modal" data-target="#mdModal"><i class="fa fa-info-circle pull-right"></i></a></header>
7
+ <section class="entry-markdown-content">
8
+ <%= f.text_area field.to_sym, :class => 'markdown_editor', :value => content.blank? ? '...' : content %>
9
+ </section>
10
+ </section>
11
+ <section class="entry-preview active">
12
+ <header class="floating-header">&nbsp; <%= t("views.admin.generic.preview") %> <span class="entry-word-count">0 <%= t("views.admin.generic.words") %></span> </header>
13
+ <section class="entry-preview-content">
14
+ <div class="rendered-markdown"></div>
15
+ </section>
16
+ </section>
17
+ </div>
18
+ </div>
19
+ </section>
20
+ </div>
21
+
22
22
  <%= render 'roroacms/admin/partials/markdown_modal' %>