sunrise-core 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/README.rdoc +1 -1
- data/lib/generators/sunrise/templates/models/defaults/position_type.rb +2 -0
- data/lib/generators/sunrise/templates/models/defaults/role_type.rb +2 -0
- data/lib/generators/sunrise/templates/models/defaults/structure_type.rb +2 -0
- data/lib/sunrise/version.rb +1 -1
- data/spec/dummy/log/test.log +5332 -39751
- data/spec/dummy/script/rails +0 -0
- metadata +862 -1288
- data/spec/dummy/public/uploads/avatar/4/rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/4/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/5/rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/5/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/6/rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/6/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/7/rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/7/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/8/rails.png +0 -0
- data/spec/dummy/public/uploads/avatar/8/thumb_rails.png +0 -0
- data/spec/dummy/public/uploads/tmp/20110819-1743-19227-1016/silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/20110819-1743-19227-1016/thumb_silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/20110819-1744-19584-0221/silicon_valley.jpg +0 -0
- data/spec/dummy/public/uploads/tmp/20110819-1744-19584-0221/thumb_silicon_valley.jpg +0 -0
- data/spec/tmp/app/helpers/manage/assets_helper.rb +0 -2
- data/spec/tmp/app/helpers/manage/base_helper.rb +0 -83
- data/spec/tmp/app/helpers/manage/pages_helper.rb +0 -2
- data/spec/tmp/app/helpers/manage/settings_helper.rb +0 -2
- data/spec/tmp/app/helpers/manage/structures_helper.rb +0 -12
- data/spec/tmp/app/helpers/manage/users_helper.rb +0 -6
- data/spec/tmp/app/models/defaults/ability.rb +0 -39
- data/spec/tmp/app/models/defaults/asset.rb +0 -9
- data/spec/tmp/app/models/defaults/attachment_file.rb +0 -31
- data/spec/tmp/app/models/defaults/avatar.rb +0 -34
- data/spec/tmp/app/models/defaults/header.rb +0 -5
- data/spec/tmp/app/models/defaults/page.rb +0 -5
- data/spec/tmp/app/models/defaults/picture.rb +0 -31
- data/spec/tmp/app/models/defaults/position_type.rb +0 -7
- data/spec/tmp/app/models/defaults/role.rb +0 -20
- data/spec/tmp/app/models/defaults/role_type.rb +0 -8
- data/spec/tmp/app/models/defaults/structure.rb +0 -9
- data/spec/tmp/app/models/defaults/structure_type.rb +0 -9
- data/spec/tmp/app/models/defaults/user.rb +0 -47
- data/spec/tmp/app/uploaders/attachment_file_uploader.rb +0 -5
- data/spec/tmp/app/uploaders/avatar_uploader.rb +0 -13
- data/spec/tmp/app/uploaders/picture_uploader.rb +0 -17
- data/spec/tmp/app/views/layouts/application.html.erb +0 -35
- data/spec/tmp/app/views/pages/show.html.erb +0 -2
- data/spec/tmp/app/views/shared/_notice.html.erb +0 -17
- data/spec/tmp/config/application.rb +0 -47
- data/spec/tmp/config/application.yml.sample +0 -4
- data/spec/tmp/config/database.yml.sample +0 -34
- data/spec/tmp/config/initializers/sunrise.rb +0 -7
- data/spec/tmp/config/logrotate-config.sample +0 -9
- data/spec/tmp/config/nginx-config-passenger.sample +0 -60
- data/spec/tmp/config/routes.rb +0 -7
- data/spec/tmp/db/migrate/20110819144550_sunrise_create_users.rb +0 -29
- data/spec/tmp/db/migrate/20110819144650_sunrise_create_roles.rb +0 -16
- data/spec/tmp/db/migrate/20110819144750_sunrise_create_structures.rb +0 -27
- data/spec/tmp/db/migrate/20110819144850_sunrise_create_pages.rb +0 -17
- data/spec/tmp/db/migrate/20110819144950_sunrise_create_assets.rb +0 -28
- data/spec/tmp/db/migrate/20110819145050_sunrise_create_headers.rb +0 -20
- data/spec/tmp/db/seeds.rb +0 -25
- data/spec/tmp/public/images/alert.png +0 -0
- data/spec/tmp/public/images/cross_ico.png +0 -0
- data/spec/tmp/public/images/manage/add_post_bot.gif +0 -0
- data/spec/tmp/public/images/manage/add_post_top.gif +0 -0
- data/spec/tmp/public/images/manage/add_white_bot.gif +0 -0
- data/spec/tmp/public/images/manage/add_white_top.gif +0 -0
- data/spec/tmp/public/images/manage/arrow.png +0 -0
- data/spec/tmp/public/images/manage/back_but_lc.gif +0 -0
- data/spec/tmp/public/images/manage/back_but_rc.gif +0 -0
- data/spec/tmp/public/images/manage/bot_corn.gif +0 -0
- data/spec/tmp/public/images/manage/bot_duo_corn.gif +0 -0
- data/spec/tmp/public/images/manage/but_bg.png +0 -0
- data/spec/tmp/public/images/manage/but_block_lc.gif +0 -0
- data/spec/tmp/public/images/manage/but_block_rc.gif +0 -0
- data/spec/tmp/public/images/manage/but_freze_lc.gif +0 -0
- data/spec/tmp/public/images/manage/but_freze_rc.gif +0 -0
- data/spec/tmp/public/images/manage/but_gr.gif +0 -0
- data/spec/tmp/public/images/manage/but_gr_l.gif +0 -0
- data/spec/tmp/public/images/manage/but_gr_r.gif +0 -0
- data/spec/tmp/public/images/manage/but_search.gif +0 -0
- data/spec/tmp/public/images/manage/but_unfreze_lc.gif +0 -0
- data/spec/tmp/public/images/manage/but_unfreze_rc.gif +0 -0
- data/spec/tmp/public/images/manage/button_add_foto.gif +0 -0
- data/spec/tmp/public/images/manage/button_add_foto_ru.gif +0 -0
- data/spec/tmp/public/images/manage/button_add_foto_ua.gif +0 -0
- data/spec/tmp/public/images/manage/button_add_foto_uk.gif +0 -0
- data/spec/tmp/public/images/manage/cancelbutton.gif +0 -0
- data/spec/tmp/public/images/manage/dark_arr.gif +0 -0
- data/spec/tmp/public/images/manage/dark_arr_left.gif +0 -0
- data/spec/tmp/public/images/manage/dark_cross_ico.gif +0 -0
- data/spec/tmp/public/images/manage/dot.gif +0 -0
- data/spec/tmp/public/images/manage/duo_bg.gif +0 -0
- data/spec/tmp/public/images/manage/duo_bg_small.gif +0 -0
- data/spec/tmp/public/images/manage/duo_bg_small_blocked.gif +0 -0
- data/spec/tmp/public/images/manage/duo_bg_small_frozed.gif +0 -0
- data/spec/tmp/public/images/manage/duo_bg_small_notact.gif +0 -0
- data/spec/tmp/public/images/manage/duo_bot_small.gif +0 -0
- data/spec/tmp/public/images/manage/duo_bot_small_blocked.gif +0 -0
- data/spec/tmp/public/images/manage/duo_bot_small_frozed.gif +0 -0
- data/spec/tmp/public/images/manage/duo_bot_small_notact.gif +0 -0
- data/spec/tmp/public/images/manage/duo_top_small.gif +0 -0
- data/spec/tmp/public/images/manage/duo_top_small_blocked.gif +0 -0
- data/spec/tmp/public/images/manage/duo_top_small_frozed.gif +0 -0
- data/spec/tmp/public/images/manage/duo_top_small_notact.gif +0 -0
- data/spec/tmp/public/images/manage/edit_white_top.gif +0 -0
- data/spec/tmp/public/images/manage/empty.gif +0 -0
- data/spec/tmp/public/images/manage/filter_bot_bg.gif +0 -0
- data/spec/tmp/public/images/manage/filter_top_bg.gif +0 -0
- data/spec/tmp/public/images/manage/flag_en.gif +0 -0
- data/spec/tmp/public/images/manage/flag_en_nonact.gif +0 -0
- data/spec/tmp/public/images/manage/flag_ru.gif +0 -0
- data/spec/tmp/public/images/manage/flag_ru_nonact.gif +0 -0
- data/spec/tmp/public/images/manage/flag_ua.gif +0 -0
- data/spec/tmp/public/images/manage/flag_ua_nonact.gif +0 -0
- data/spec/tmp/public/images/manage/foto.jpg +0 -0
- data/spec/tmp/public/images/manage/ico_add.gif +0 -0
- data/spec/tmp/public/images/manage/ico_delete.gif +0 -0
- data/spec/tmp/public/images/manage/ico_down.gif +0 -0
- data/spec/tmp/public/images/manage/ico_edit.gif +0 -0
- data/spec/tmp/public/images/manage/ico_settings.gif +0 -0
- data/spec/tmp/public/images/manage/ico_up.gif +0 -0
- data/spec/tmp/public/images/manage/input_bg.gif +0 -0
- data/spec/tmp/public/images/manage/l_but_corn.gif +0 -0
- data/spec/tmp/public/images/manage/minimise_but.gif +0 -0
- data/spec/tmp/public/images/manage/mp3.png +0 -0
- data/spec/tmp/public/images/manage/page_arr_hover.png +0 -0
- data/spec/tmp/public/images/manage/page_next_arr.gif +0 -0
- data/spec/tmp/public/images/manage/page_num_hover.gif +0 -0
- data/spec/tmp/public/images/manage/page_prev_arr.gif +0 -0
- data/spec/tmp/public/images/manage/panel/l_but_corn.gif +0 -0
- data/spec/tmp/public/images/manage/panel/maximise_but.gif +0 -0
- data/spec/tmp/public/images/manage/panel/r_but_corn.gif +0 -0
- data/spec/tmp/public/images/manage/panel/top_menu_arr.gif +0 -0
- data/spec/tmp/public/images/manage/panel/user_pic.gif +0 -0
- data/spec/tmp/public/images/manage/preloader.gif +0 -0
- data/spec/tmp/public/images/manage/r_but_corn.gif +0 -0
- data/spec/tmp/public/images/manage/select_bg.gif +0 -0
- data/spec/tmp/public/images/manage/select_corn.gif +0 -0
- data/spec/tmp/public/images/manage/struct_corn_lg.gif +0 -0
- data/spec/tmp/public/images/manage/struct_corn_llg.gif +0 -0
- data/spec/tmp/public/images/manage/struct_corn_lw.gif +0 -0
- data/spec/tmp/public/images/manage/struct_corn_rg.gif +0 -0
- data/spec/tmp/public/images/manage/struct_corn_rlg.gif +0 -0
- data/spec/tmp/public/images/manage/struct_corn_rw.gif +0 -0
- data/spec/tmp/public/images/manage/tab_gl.gif +0 -0
- data/spec/tmp/public/images/manage/tab_gr.gif +0 -0
- data/spec/tmp/public/images/manage/tab_wl.gif +0 -0
- data/spec/tmp/public/images/manage/tab_wr.gif +0 -0
- data/spec/tmp/public/images/manage/top_corn.gif +0 -0
- data/spec/tmp/public/images/manage/top_duo_corn.gif +0 -0
- data/spec/tmp/public/images/manage/top_menu_arr.gif +0 -0
- data/spec/tmp/public/images/manage/transp_cross.png +0 -0
- data/spec/tmp/public/images/manage/upload_progress.gif +0 -0
- data/spec/tmp/public/images/manage/user_act_lc.gif +0 -0
- data/spec/tmp/public/images/manage/user_act_rc.gif +0 -0
- data/spec/tmp/public/images/manage/user_ico.gif +0 -0
- data/spec/tmp/public/images/manage/user_pic.gif +0 -0
- data/spec/tmp/public/images/manage/user_pic_small.gif +0 -0
- data/spec/tmp/public/images/manage/user_pic_thumb.gif +0 -0
- data/spec/tmp/public/javascripts/datepicker/jquery-ui-i18n.js +0 -1176
- data/spec/tmp/public/javascripts/datepicker/jquery.ui.datepicker-ru.js +0 -37
- data/spec/tmp/public/javascripts/datepicker/jquery.ui.datepicker-uk.js +0 -37
- data/spec/tmp/public/javascripts/jquery-ui-timepicker-addon.js +0 -911
- data/spec/tmp/public/javascripts/jquery.cookie.js +0 -97
- data/spec/tmp/public/javascripts/jquery.fancybox-1.3.4.pack.js +0 -46
- data/spec/tmp/public/javascripts/jquery.tmpl.min.js +0 -10
- data/spec/tmp/public/javascripts/manage-fileuploader.js +0 -182
- data/spec/tmp/public/javascripts/manage.js +0 -294
- data/spec/tmp/public/javascripts/preloader.js +0 -47
- data/spec/tmp/public/javascripts/rails.js +0 -331
- data/spec/tmp/public/stylesheets/alert.css +0 -26
- data/spec/tmp/public/stylesheets/application.css +0 -1
- data/spec/tmp/public/stylesheets/fancybox/images/blank.gif +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_close.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_loading.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_nav_left.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_nav_right.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_shadow_e.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_shadow_n.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_shadow_ne.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_shadow_nw.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_shadow_s.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_shadow_se.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_shadow_sw.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_shadow_w.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_title_left.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_title_main.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_title_over.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancy_title_right.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancybox-x.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancybox-y.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/images/fancybox.png +0 -0
- data/spec/tmp/public/stylesheets/fancybox/jquery.fancybox-1.3.4.css +0 -359
- data/spec/tmp/public/stylesheets/manage/buttons.css +0 -42
- data/spec/tmp/public/stylesheets/manage/ie.css +0 -16
- data/spec/tmp/public/stylesheets/manage/main.css +0 -1108
- data/spec/tmp/public/stylesheets/manage/panel.css +0 -126
- data/spec/tmp/public/stylesheets/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/spec/tmp/public/stylesheets/smoothness/jquery-ui-1.8.13.custom.css +0 -578
- data/spec/tmp/spec/controllers/pages_controller_spec.rb +0 -22
- data/spec/tmp/spec/controllers/welcome_controller_spec.rb +0 -18
- data/spec/tmp/spec/factories/structure_factory.rb +0 -22
- data/spec/tmp/spec/factories/user_factory.rb +0 -60
- data/spec/tmp/spec/spec_helper.rb +0 -37
- data/spec/tmp/spec/support/helpers/controller_macros.rb +0 -51
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,83 +0,0 @@
|
|
1
|
-
module Manage::BaseHelper
|
2
|
-
def content_manager?
|
3
|
-
user_signed_in? && current_user.admin?
|
4
|
-
end
|
5
|
-
|
6
|
-
def link_to_unless_current_span2(name, options = {}, html_options = {}, &block)
|
7
|
-
if current_page?(options)
|
8
|
-
if block_given?
|
9
|
-
block.arity <= 1 ? yield(name) : yield(name, options, html_options)
|
10
|
-
else
|
11
|
-
content_tag(:span, content_tag(:span, name), html_options)
|
12
|
-
end
|
13
|
-
else
|
14
|
-
link_to(name, options, html_options)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def options_for_ckeditor(options = {})
|
19
|
-
{ :width => 860, :height => 400 }.merge(options)
|
20
|
-
end
|
21
|
-
|
22
|
-
def white_block_form(options = {}, &block)
|
23
|
-
title = options[:title]
|
24
|
-
|
25
|
-
concat(content_tag(:div, {:class=>"edit-white-bl"}) do
|
26
|
-
concat(content_tag(:div, {:class=>"bot-bg"}) do
|
27
|
-
concat(content_tag(:div, title, :class=>"wh-title")) unless title.blank?
|
28
|
-
yield if block_given?
|
29
|
-
end)
|
30
|
-
end)
|
31
|
-
end
|
32
|
-
|
33
|
-
def link_to_sort(title, options = {})
|
34
|
-
options.symbolize_keys!
|
35
|
-
|
36
|
-
order_type = options[:order_type] || 'asc'
|
37
|
-
order_column = options[:name] || 'id'
|
38
|
-
class_name = options[:class] || nil
|
39
|
-
|
40
|
-
search_options = request.params[:search] || {}
|
41
|
-
search_options.update(:order_column => order_column, :order_type => order_type)
|
42
|
-
|
43
|
-
link_to(title, :search => search_options, :class => class_name)
|
44
|
-
end
|
45
|
-
|
46
|
-
def remove_child_link(name, f)
|
47
|
-
f.hidden_field(:_destroy) + link_to_function(name, "remove_fields(this)")
|
48
|
-
end
|
49
|
-
|
50
|
-
def add_child_link(name, f, method, options={})
|
51
|
-
options.symbolize_keys!
|
52
|
-
|
53
|
-
html_options = options.delete(:html) || {}
|
54
|
-
fields = new_child_fields(f, method, options)
|
55
|
-
|
56
|
-
html_options[:class] ||= "new"
|
57
|
-
|
58
|
-
content_tag(:div,
|
59
|
-
link_to_function(name, raw("insert_fields(this, \"#{method}\", \"#{escape_javascript(fields)}\")"), html_options),
|
60
|
-
:class=>"add-bl")
|
61
|
-
end
|
62
|
-
|
63
|
-
def new_child_fields(form_builder, method, options = {})
|
64
|
-
options[:object] ||= form_builder.object.class.reflect_on_association(method).klass.new
|
65
|
-
options[:partial] ||= method.to_s.singularize
|
66
|
-
options[:form_builder_local] ||= :form
|
67
|
-
|
68
|
-
form_builder.fields_for(method, options[:object], :child_index => "new_#{method}") do |f|
|
69
|
-
render(:partial => options[:partial], :locals => { options[:form_builder_local] => f })
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
def cookie_content_tag(tag_name, options={}, &block)
|
74
|
-
key = options[:id]
|
75
|
-
options[:style] = "display:none;" if !cookies[key].blank? && cookies[key].to_i != 1
|
76
|
-
content_tag(tag_name, options, &block)
|
77
|
-
end
|
78
|
-
|
79
|
-
def manage_icon(image, options = {})
|
80
|
-
options = { :alt => t(image, :scope => 'manage.icons'), :title => t(image, :scope => 'manage.icons') }.merge(options)
|
81
|
-
image_tag("manage/ico_#{image}.gif", options)
|
82
|
-
end
|
83
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module Manage::StructuresHelper
|
2
|
-
|
3
|
-
def edit_structure_record_path(structure)
|
4
|
-
case structure.structure_type
|
5
|
-
when StructureType.page then edit_manage_structure_page_path(:structure_id=>structure.id)
|
6
|
-
when StructureType.posts then manage_structure_posts_path(:structure_id => structure.id)
|
7
|
-
when StructureType.main then '#'
|
8
|
-
when StructureType.redirect then structure.slug
|
9
|
-
when StructureType.group then '#'
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
class Ability
|
2
|
-
include CanCanNamespace::Ability
|
3
|
-
|
4
|
-
attr_accessor :context, :user
|
5
|
-
|
6
|
-
def initialize(user, context = nil)
|
7
|
-
alias_action :delete, :to => :destroy
|
8
|
-
|
9
|
-
@user = (user || User.new) # guest user (not logged in)
|
10
|
-
@context = context
|
11
|
-
|
12
|
-
case @user.role_type_id
|
13
|
-
when RoleType.default.id then default
|
14
|
-
when RoleType.redactor.id then redactor
|
15
|
-
when RoleType.moderator.id then moderator
|
16
|
-
when RoleType.admin.id then admin
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def default
|
21
|
-
# TODO
|
22
|
-
end
|
23
|
-
|
24
|
-
def redactor
|
25
|
-
# TODO
|
26
|
-
end
|
27
|
-
|
28
|
-
def moderator
|
29
|
-
# TODO
|
30
|
-
end
|
31
|
-
|
32
|
-
def admin
|
33
|
-
can :manage, :all
|
34
|
-
can :manage, :all, :context => :manage
|
35
|
-
|
36
|
-
# User cannot destroy self account
|
37
|
-
cannot :destroy, User, :id => @user.id, :context => :manage
|
38
|
-
end
|
39
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: assets
|
4
|
-
#
|
5
|
-
# id :integer(4) not null, primary key
|
6
|
-
# data_file_name :string(255) not null
|
7
|
-
# data_content_type :string(255)
|
8
|
-
# data_file_size :integer(4)
|
9
|
-
# assetable_id :integer(4) not null
|
10
|
-
# assetable_type :string(25) not null
|
11
|
-
# type :string(25)
|
12
|
-
# guid :string(10)
|
13
|
-
# locale :integer(1) default(0)
|
14
|
-
# user_id :integer(4)
|
15
|
-
# created_at :datetime
|
16
|
-
# updated_at :datetime
|
17
|
-
# duration :float default(0.0)
|
18
|
-
# resolution_id :integer(1) default(0)
|
19
|
-
#
|
20
|
-
# Indexes
|
21
|
-
#
|
22
|
-
# index_assets_on_assetable_type_and_type_and_assetable_id (assetable_type,type,assetable_id)
|
23
|
-
# index_assets_on_assetable_type_and_assetable_id (assetable_type,assetable_id)
|
24
|
-
# index_assets_on_user_id (user_id)
|
25
|
-
#
|
26
|
-
|
27
|
-
class AttachmentFile < Asset
|
28
|
-
sunrise_uploader AttachmentFileUploader
|
29
|
-
|
30
|
-
validates_filesize_of :data, :maximum => 100.megabytes.to_i
|
31
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: assets
|
4
|
-
#
|
5
|
-
# id :integer(4) not null, primary key
|
6
|
-
# data_file_name :string(255) not null
|
7
|
-
# data_content_type :string(255)
|
8
|
-
# data_file_size :integer(4)
|
9
|
-
# assetable_id :integer(4) not null
|
10
|
-
# assetable_type :string(25) not null
|
11
|
-
# type :string(25)
|
12
|
-
# guid :string(10)
|
13
|
-
# locale :integer(1) default(0)
|
14
|
-
# user_id :integer(4)
|
15
|
-
# created_at :datetime
|
16
|
-
# updated_at :datetime
|
17
|
-
# duration :float default(0.0)
|
18
|
-
# resolution_id :integer(1) default(0)
|
19
|
-
#
|
20
|
-
# Indexes
|
21
|
-
#
|
22
|
-
# index_assets_on_assetable_type_and_type_and_assetable_id (assetable_type,type,assetable_id)
|
23
|
-
# index_assets_on_assetable_type_and_assetable_id (assetable_type,assetable_id)
|
24
|
-
# index_assets_on_user_id (user_id)
|
25
|
-
#
|
26
|
-
|
27
|
-
class Avatar < Asset
|
28
|
-
sunrise_uploader AvatarUploader
|
29
|
-
|
30
|
-
validates :data_content_type, :inclusion => {:in => Sunrise::Utils::IMAGE_TYPES }
|
31
|
-
validates_integrity_of :data
|
32
|
-
validates_filesize_of :data, :maximum => 1.megabytes.to_i
|
33
|
-
|
34
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: assets
|
4
|
-
#
|
5
|
-
# id :integer(4) not null, primary key
|
6
|
-
# data_file_name :string(255) not null
|
7
|
-
# data_content_type :string(255)
|
8
|
-
# data_file_size :integer(4)
|
9
|
-
# assetable_id :integer(4) not null
|
10
|
-
# assetable_type :string(25) not null
|
11
|
-
# type :string(25)
|
12
|
-
# guid :string(10)
|
13
|
-
# locale :integer(1) default(0)
|
14
|
-
# user_id :integer(4)
|
15
|
-
# created_at :datetime
|
16
|
-
# updated_at :datetime
|
17
|
-
#
|
18
|
-
# Indexes
|
19
|
-
#
|
20
|
-
# index_assets_on_assetable_type_and_type_and_assetable_id (assetable_type,type,assetable_id)
|
21
|
-
# index_assets_on_assetable_type_and_assetable_id (assetable_type,assetable_id)
|
22
|
-
# index_assets_on_user_id (user_id)
|
23
|
-
#
|
24
|
-
|
25
|
-
class Picture < Asset
|
26
|
-
sunrise_uploader PictureUploader
|
27
|
-
|
28
|
-
validates :data_content_type, :inclusion => {:in => Sunrise::Utils::IMAGE_TYPES }
|
29
|
-
validates_integrity_of :data
|
30
|
-
validates_filesize_of :data, :maximum => 2.megabytes.to_i
|
31
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: roles
|
4
|
-
#
|
5
|
-
# id :integer(4) not null, primary key
|
6
|
-
# role_type :integer(1) default(0)
|
7
|
-
# user_id :integer(4) not null
|
8
|
-
# created_at :datetime
|
9
|
-
# updated_at :datetime
|
10
|
-
#
|
11
|
-
# Indexes
|
12
|
-
#
|
13
|
-
# fk_user (user_id)
|
14
|
-
#
|
15
|
-
|
16
|
-
class Role < ActiveRecord::Base
|
17
|
-
include Sunrise::Models::Role
|
18
|
-
|
19
|
-
attr_accessible :role_type
|
20
|
-
end
|
@@ -1,8 +0,0 @@
|
|
1
|
-
class RoleType < Sunrise::Models::RoleType
|
2
|
-
define_enum do |builder|
|
3
|
-
builder.member :default, :object => new("default")
|
4
|
-
builder.member :redactor, :object => new("redactor")
|
5
|
-
builder.member :moderator, :object => new("moderator")
|
6
|
-
builder.member :admin, :object => new("admin")
|
7
|
-
end
|
8
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class Structure < ActiveRecord::Base
|
2
|
-
include Sunrise::Models::Structure
|
3
|
-
|
4
|
-
has_slug :prepend_id => false
|
5
|
-
|
6
|
-
attr_accessible :title, :kind, :position, :parent_id, :redirect_url,
|
7
|
-
:position_type, :slug, :parent, :structure_type,
|
8
|
-
:header_attributes, :is_visible
|
9
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
class StructureType < Sunrise::Models::StructureType
|
2
|
-
define_enum do |builder|
|
3
|
-
builder.member :page, :object => new("page")
|
4
|
-
builder.member :posts, :object => new("posts")
|
5
|
-
builder.member :main, :object => new("main")
|
6
|
-
builder.member :redirect, :object => new("redirect")
|
7
|
-
builder.member :group, :object => new("group")
|
8
|
-
end
|
9
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: users
|
4
|
-
#
|
5
|
-
# id :integer(4) not null, primary key
|
6
|
-
# name :string(150)
|
7
|
-
# login :string(20) not null
|
8
|
-
# email :string(255) default(""), not null
|
9
|
-
# encrypted_password :string(128) default(""), not null
|
10
|
-
# password_salt :string(255) default(""), not null
|
11
|
-
# reset_password_token :string(255)
|
12
|
-
# remember_token :string(255)
|
13
|
-
# remember_created_at :datetime
|
14
|
-
# sign_in_count :integer(4) default(0)
|
15
|
-
# current_sign_in_at :datetime
|
16
|
-
# last_sign_in_at :datetime
|
17
|
-
# current_sign_in_ip :string(255)
|
18
|
-
# last_sign_in_ip :string(255)
|
19
|
-
# confirmation_token :string(255)
|
20
|
-
# confirmed_at :datetime
|
21
|
-
# confirmation_sent_at :datetime
|
22
|
-
# failed_attempts :integer(4) default(0)
|
23
|
-
# locked_at :datetime
|
24
|
-
# created_at :datetime
|
25
|
-
# updated_at :datetime
|
26
|
-
#
|
27
|
-
# Indexes
|
28
|
-
#
|
29
|
-
# index_users_on_login (login) UNIQUE
|
30
|
-
# index_users_on_email (email) UNIQUE
|
31
|
-
# index_users_on_reset_password_token (reset_password_token) UNIQUE
|
32
|
-
# index_users_on_confirmation_token (confirmation_token) UNIQUE
|
33
|
-
#
|
34
|
-
|
35
|
-
class User < ActiveRecord::Base
|
36
|
-
include Sunrise::Models::User
|
37
|
-
|
38
|
-
# Include default devise modules.
|
39
|
-
devise :database_authenticatable, :confirmable, :lockable, :timeoutable,
|
40
|
-
:recoverable, :rememberable, :trackable, :validatable,
|
41
|
-
:encryptable, :encryptor => :sha512
|
42
|
-
|
43
|
-
# Setup accessible (or protected) attributes for your model
|
44
|
-
attr_accessible :name, :email, :password, :password_confirmation, :remember_me
|
45
|
-
|
46
|
-
fileuploads :avatar
|
47
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class PictureUploader < Sunrise::CarrierWave::BaseUploader
|
2
|
-
|
3
|
-
process :strip
|
4
|
-
process :quality => 90
|
5
|
-
|
6
|
-
version :thumb do
|
7
|
-
process :resize_to_fill => [100, 100]
|
8
|
-
end
|
9
|
-
|
10
|
-
version :content do
|
11
|
-
process :resize_to_fit => [575, 500]
|
12
|
-
end
|
13
|
-
|
14
|
-
def extension_white_list
|
15
|
-
%w(jpg jpeg gif png)
|
16
|
-
end
|
17
|
-
end
|