sbdevcore 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/28DaysLater.ttf +0 -0
- data/app/assets/images/ajax-loader.gif +0 -0
- data/app/assets/javascripts/jquery.tools.min.js +16 -108
- data/app/assets/javascripts/rails.validations.custom.js +5 -0
- data/app/assets/javascripts/sbdev-ajax.js +14 -0
- data/app/assets/javascripts/sbdevcore-tools.js +24 -37
- data/app/assets/javascripts/sbdevcore.js +8 -3
- data/app/assets/javascripts/tiny_mce_config.js +2 -0
- data/app/assets/stylesheets/_bar_nav.scss +6 -4
- data/app/assets/stylesheets/_buttons.scss +16 -10
- data/app/assets/stylesheets/_forms.scss +51 -0
- data/app/assets/stylesheets/_mixins.scss +40 -15
- data/app/assets/stylesheets/_overlay.scss +4 -7
- data/app/assets/stylesheets/_sbdev_core.scss +55 -19
- data/app/assets/stylesheets/_yui_base.scss +142 -0
- data/app/controllers/contacts_controller.rb +2 -36
- data/app/controllers/downloadables_controller.rb +6 -46
- data/app/controllers/galleries_controller.rb +4 -49
- data/app/controllers/indices_controller.rb +2 -45
- data/app/controllers/photos_controller.rb +4 -48
- data/app/controllers/sbdev_core_controller.rb +40 -0
- data/app/controllers/texts_controller.rb +3 -46
- data/app/controllers/videos_controller.rb +4 -45
- data/app/models/contact.rb +5 -1
- data/app/models/downloadable.rb +3 -1
- data/app/models/index.rb +4 -1
- data/app/models/photo.rb +3 -1
- data/app/models/video.rb +2 -0
- data/app/views/admins/mailer/confirmation_instructions.html.haml +4 -0
- data/app/views/admins/mailer/reset_password_instructions.html.haml +6 -0
- data/app/views/admins/mailer/unlock_instructions.html.haml +5 -0
- data/app/views/admins/passwords/edit.html.haml +8 -0
- data/app/views/admins/passwords/new.html.haml +6 -0
- data/app/views/admins/sessions/new.html.haml +8 -0
- data/app/views/admins/shared/_links.haml +19 -0
- data/app/views/application/_header.html.haml +1 -0
- data/app/views/application/_secondary_nav.html.haml +3 -0
- data/app/views/contacts/_form.html.haml +5 -0
- data/app/views/contacts/edit.html.haml +6 -0
- data/app/views/contacts/index.html.haml +21 -0
- data/app/views/contacts/new.html.haml +2 -0
- data/app/views/contacts/show.html.haml +24 -0
- data/app/views/downloadables/_form.html.haml +6 -0
- data/app/views/downloadables/_show.html.haml +7 -0
- data/app/views/downloadables/edit.html.haml +3 -0
- data/app/views/downloadables/new.html.haml +4 -0
- data/app/views/galleries/_form.html.haml +22 -0
- data/app/views/galleries/edit.html.haml +10 -0
- data/app/views/galleries/index.html.haml +9 -0
- data/app/views/galleries/new.html.haml +3 -0
- data/app/views/galleries/show.html.haml +9 -0
- data/app/views/indices/_form.html.haml +43 -0
- data/app/views/indices/_show.html.haml +17 -0
- data/app/views/indices/edit.html.haml +3 -0
- data/app/views/indices/index.html.haml +17 -0
- data/app/views/layouts/application.html.haml +16 -1
- data/app/views/layouts/bar_nav.html.haml +7 -14
- data/app/views/layouts/sbdev_core.html.haml +39 -0
- data/app/views/layouts/tab_nav.html.haml +9 -14
- data/app/views/mailer/message.haml +4 -0
- data/app/views/photos/_form.html.haml +10 -0
- data/app/views/photos/_show.html.haml +7 -0
- data/app/views/photos/edit.html.haml +3 -0
- data/app/views/photos/index.html.haml +21 -0
- data/app/views/photos/new.html.haml +4 -0
- data/app/views/photos/show.html.haml +4 -0
- data/app/views/sbdev_core/index.html.haml +1 -0
- data/app/views/sbdev_core/show.html.haml +4 -0
- data/app/views/sbdev_core/show.js.haml +1 -0
- data/app/views/shared/_asset_show.html.haml +1 -0
- data/app/views/shared/_devise_links.haml +15 -0
- data/app/views/shared/_gallery.html.haml +14 -0
- data/app/views/shared/_prioritizable_fields.html.haml +5 -0
- data/app/views/texts/_form.html.haml +3 -0
- data/app/views/texts/_show.html.haml +6 -0
- data/app/views/texts/edit.html.haml +3 -0
- data/app/views/texts/new.html.haml +4 -0
- data/app/views/texts/show.html.haml +8 -0
- data/app/views/videos/_form.html.haml +7 -0
- data/app/views/videos/_show.html.haml +12 -0
- data/app/views/videos/edit.html.haml +3 -0
- data/app/views/videos/index.html.haml +11 -0
- data/app/views/videos/new.html.haml +4 -0
- data/app/views/videos/show.html.haml +9 -0
- data/app/views/videos/show.js.haml +4 -0
- data/config/initializers/client_side_validations.rb +14 -0
- data/config/initializers/custom_validators.rb +15 -0
- data/config/initializers/load_app_config.rb +2 -0
- data/config/initializers/simple_form.rb +93 -0
- data/config/locales/en.yml +4 -1
- data/db/migrate/20110811000613_create_indices.rb +3 -0
- data/db/seeds.rb +23 -57
- data/lib/generators/sbdevcore/install_generator.rb +0 -2
- data/lib/generators/sbdevcore/templates/application.scss +1 -0
- data/lib/generators/sbdevcore/templates/application/_404.html.haml +2 -0
- data/lib/generators/sbdevcore/templates/application/_footer.html.haml +2 -1
- data/lib/generators/sbdevcore/templates/application/_inline_nav.html.haml +3 -0
- data/lib/generators/sbdevcore/templates/application/_nav.html.haml +1 -1
- data/lib/generators/sbdevcore/templates/config/initializers/mailer_setup.rb +2 -2
- data/lib/generators/sbdevcore/templates/config/initializers/simple_form.rb +93 -0
- data/lib/generators/sbdevcore/templates/new_contact.html.haml +4 -0
- data/lib/sbdevcore.rb +25 -2
- data/lib/sbdevcore/engine.rb +13 -34
- data/lib/sbdevcore/version.rb +1 -1
- data/lib/tasks/sbdevcore.rake +1 -1
- data/public/404.html +2 -2
- data/sbdevcore.gemspec +7 -2
- metadata +296 -156
- data/app/assets/stylesheets/_js_errors.scss +0 -26
- data/app/controllers/core_controller.rb +0 -5
- data/app/controllers/sbdevcore/application_controller_extensions.rb +0 -13
- data/app/controllers/statics_controller.rb +0 -6
- data/app/models/asset.rb +0 -27
- data/app/views/admins/confirmations/new.html.erb +0 -12
- data/app/views/admins/mailer/confirmation_instructions.html.erb +0 -5
- data/app/views/admins/mailer/reset_password_instructions.html.erb +0 -8
- data/app/views/admins/mailer/unlock_instructions.html.erb +0 -7
- data/app/views/admins/passwords/edit.html.erb +0 -16
- data/app/views/admins/passwords/new.html.erb +0 -12
- data/app/views/admins/registrations/edit.html.erb +0 -25
- data/app/views/admins/registrations/new.html.erb +0 -18
- data/app/views/admins/sessions/new.html.erb +0 -17
- data/app/views/admins/unlocks/new.html.erb +0 -12
- data/app/views/contacts/_form.html.erb +0 -18
- data/app/views/contacts/edit.html.erb +0 -8
- data/app/views/contacts/index.html.erb +0 -27
- data/app/views/contacts/new.html.erb +0 -4
- data/app/views/contacts/show.html.erb +0 -32
- data/app/views/downloadables/_form.html.erb +0 -17
- data/app/views/downloadables/_show.html.erb +0 -8
- data/app/views/downloadables/edit.html.erb +0 -4
- data/app/views/downloadables/new.html.erb +0 -6
- data/app/views/galleries/_form.html.erb +0 -33
- data/app/views/galleries/edit.html.erb +0 -13
- data/app/views/galleries/index.html.erb +0 -16
- data/app/views/galleries/new.html.erb +0 -8
- data/app/views/galleries/show.html.erb +0 -17
- data/app/views/indices/_form.html.erb +0 -60
- data/app/views/indices/_show.html.erb +0 -22
- data/app/views/indices/edit.html.erb +0 -12
- data/app/views/indices/index.html.erb +0 -23
- data/app/views/indices/new.html.erb +0 -8
- data/app/views/indices/show.html.erb +0 -4
- data/app/views/indices/show.js.erb +0 -1
- data/app/views/photos/_form.html.erb +0 -27
- data/app/views/photos/_show.html.erb +0 -14
- data/app/views/photos/edit.html.erb +0 -4
- data/app/views/photos/index.html.erb +0 -27
- data/app/views/photos/new.html.erb +0 -6
- data/app/views/photos/overlay.html.erb +0 -1
- data/app/views/photos/show.html.erb +0 -5
- data/app/views/shared/_asset_show.html.erb +0 -1
- data/app/views/shared/_gallery.html.erb +0 -21
- data/app/views/shared/_prioritizable_fields.html.erb +0 -10
- data/app/views/shared/course_type_index.html.erb +0 -16
- data/app/views/texts/_form.html.erb +0 -9
- data/app/views/texts/_new.html.erb +0 -6
- data/app/views/texts/_show.html.erb +0 -9
- data/app/views/texts/edit.html.erb +0 -4
- data/app/views/texts/new.html.erb +0 -6
- data/app/views/texts/show.html.erb +0 -9
- data/app/views/videos/_form.html.erb +0 -17
- data/app/views/videos/_show.html.erb +0 -16
- data/app/views/videos/edit.html.erb +0 -4
- data/app/views/videos/index.html.erb +0 -17
- data/app/views/videos/new.html.erb +0 -6
- data/app/views/videos/show.html.erb +0 -12
- data/lib/generators/sbdevcore/templates/application/_404.html.erb +0 -2
- data/lib/generators/sbdevcore/templates/application/_inline_nav.html.erb +0 -7
- data/lib/generators/sbdevcore/templates/config/tiny_mce.yml +0 -46
- data/lib/generators/sbdevcore/templates/new_contact.html.erb +0 -4
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/plugins/.gitkeep +0 -0
@@ -1,46 +1,3 @@
|
|
1
|
-
class IndicesController <
|
2
|
-
before_filter :authenticate_admin!, :
|
3
|
-
|
4
|
-
def index
|
5
|
-
@indices = Index.all
|
6
|
-
end
|
7
|
-
|
8
|
-
def show
|
9
|
-
@index = Index.find(params[:id])
|
10
|
-
end
|
11
|
-
|
12
|
-
def new
|
13
|
-
@index = Index.new
|
14
|
-
end
|
15
|
-
|
16
|
-
def create
|
17
|
-
@index = Index.new(params[:index])
|
18
|
-
if @index.save
|
19
|
-
flash[:notice] = "Successfully created index."
|
20
|
-
redirect_to :back
|
21
|
-
else
|
22
|
-
render :action => 'new'
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def edit
|
27
|
-
@index = Index.find(params[:id])
|
28
|
-
end
|
29
|
-
|
30
|
-
def update
|
31
|
-
@index = Index.find(params[:id])
|
32
|
-
if @index.update_attributes(params[:index])
|
33
|
-
flash[:notice] = "Successfully updated index."
|
34
|
-
redirect_to :back
|
35
|
-
else
|
36
|
-
render :action => 'edit'
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def destroy
|
41
|
-
@index = Index.find(params[:id])
|
42
|
-
@index.destroy
|
43
|
-
flash[:notice] = "Successfully destroyed index."
|
44
|
-
redirect_to indices_url
|
45
|
-
end
|
1
|
+
class IndicesController < SbdevCoreController
|
2
|
+
before_filter :authenticate_admin!, :only => [:index]
|
46
3
|
end
|
@@ -1,49 +1,5 @@
|
|
1
|
-
class PhotosController <
|
2
|
-
before_filter :authenticate_admin!, :except =>
|
3
|
-
|
4
|
-
|
5
|
-
end
|
6
|
-
|
7
|
-
def show
|
8
|
-
@photo = Photo.find(params[:id])
|
9
|
-
render :layout => false
|
10
|
-
end
|
11
|
-
|
12
|
-
def new
|
13
|
-
@index = Index.find(params[:index_id])
|
14
|
-
@photo = @index.photos.build(:priority => ((@index.assets.first.lowest_priority + 1) rescue 0))
|
15
|
-
render :layout => false
|
16
|
-
end
|
17
|
-
|
18
|
-
def create
|
19
|
-
@photo = Photo.new(params[:photo])
|
20
|
-
if @photo.save
|
21
|
-
flash[:notice] = "Successfully created photo."
|
22
|
-
redirect_to :back
|
23
|
-
else
|
24
|
-
render :action => 'new'
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def edit
|
29
|
-
@photo = Photo.find(params[:id])
|
30
|
-
render :layout => false
|
31
|
-
end
|
32
|
-
|
33
|
-
def update
|
34
|
-
@photo = Photo.find(params[:id])
|
35
|
-
if @photo.update_attributes(params[:photo])
|
36
|
-
flash[:notice] = "Successfully updated photo."
|
37
|
-
redirect_to :back
|
38
|
-
else
|
39
|
-
render :action => 'edit'
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def destroy
|
44
|
-
@photo = Photo.find(params[:id])
|
45
|
-
@photo.destroy
|
46
|
-
flash[:notice] = "Successfully destroyed photo."
|
47
|
-
redirect_to :back
|
48
|
-
end
|
1
|
+
class PhotosController < SbdevCoreController
|
2
|
+
before_filter :authenticate_admin!, :except => :show
|
3
|
+
skip_before_filter :get_index
|
4
|
+
belongs_to :index, :optional => true
|
49
5
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
class SbdevCoreController < InheritedResources::Base
|
2
|
+
protect_from_forgery
|
3
|
+
|
4
|
+
respond_to :html
|
5
|
+
|
6
|
+
before_filter :authenticate_admin!, :except => [:show, :index]
|
7
|
+
before_filter :get_index, :only => [:index]
|
8
|
+
|
9
|
+
layout "application"
|
10
|
+
|
11
|
+
def show
|
12
|
+
show!(:layout => !request.xhr?)
|
13
|
+
end
|
14
|
+
|
15
|
+
def new
|
16
|
+
new!(:layout => !request.xhr?)
|
17
|
+
end
|
18
|
+
|
19
|
+
def create
|
20
|
+
create!{ request.referer }
|
21
|
+
end
|
22
|
+
|
23
|
+
def edit
|
24
|
+
edit!(:layout => !request.xhr?)
|
25
|
+
end
|
26
|
+
|
27
|
+
def update
|
28
|
+
update!{ request.referer }
|
29
|
+
end
|
30
|
+
|
31
|
+
def destroy
|
32
|
+
destroy!{ request.referer }
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def get_index
|
38
|
+
@index = Index.find_by_name(controller_name)
|
39
|
+
end
|
40
|
+
end
|
@@ -1,48 +1,5 @@
|
|
1
|
-
class TextsController <
|
1
|
+
class TextsController < SbdevCoreController
|
2
2
|
before_filter :authenticate_admin!
|
3
|
-
|
4
|
-
|
5
|
-
end
|
6
|
-
|
7
|
-
def show
|
8
|
-
@text = Text.find(params[:id])
|
9
|
-
end
|
10
|
-
|
11
|
-
def new
|
12
|
-
@index = Index.find(params[:index_id])
|
13
|
-
@text = @index.texts.build(:priority => ((@index.texts.first.lowest_priority + 1) rescue 0))
|
14
|
-
render :layout => false
|
15
|
-
end
|
16
|
-
|
17
|
-
def create
|
18
|
-
@text = @owner.texts.build(params[:text])
|
19
|
-
if @owner.save
|
20
|
-
flash[:notice] = "Successfully created text."
|
21
|
-
redirect_to :back
|
22
|
-
else
|
23
|
-
render :action => 'new'
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def edit
|
28
|
-
@text = Text.find(params[:id])
|
29
|
-
render :layout => false
|
30
|
-
end
|
31
|
-
|
32
|
-
def update
|
33
|
-
@text = Text.find(params[:id])
|
34
|
-
if @text.update_attributes(params[:text])
|
35
|
-
flash[:notice] = "Successfully updated text."
|
36
|
-
redirect_to :back
|
37
|
-
else
|
38
|
-
render :action => 'edit'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def destroy
|
43
|
-
@text = Text.find(params[:id])
|
44
|
-
@text.destroy
|
45
|
-
flash[:notice] = "Successfully destroyed text."
|
46
|
-
redirect_to :back
|
47
|
-
end
|
3
|
+
skip_before_filter :get_index
|
4
|
+
belongs_to :index, :optional => true
|
48
5
|
end
|
@@ -1,46 +1,5 @@
|
|
1
|
-
class VideosController <
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
def show
|
7
|
-
@video = Video.find(params[:id])
|
8
|
-
end
|
9
|
-
|
10
|
-
def new
|
11
|
-
@index = Index.find(params[:index_id])
|
12
|
-
@video = @index.videos.build(:priority => ((@index.assets.first.lowest_priority + 1) rescue 0))
|
13
|
-
render :layout => false
|
14
|
-
end
|
15
|
-
|
16
|
-
def create
|
17
|
-
@video = Video.new(params[:video])
|
18
|
-
if @video.save
|
19
|
-
flash[:notice] = "Successfully created video."
|
20
|
-
redirect_to @video
|
21
|
-
else
|
22
|
-
render :action => 'new'
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def edit
|
27
|
-
@video = Video.find(params[:id])
|
28
|
-
end
|
29
|
-
|
30
|
-
def update
|
31
|
-
@video = Video.find(params[:id])
|
32
|
-
if @video.update_attributes(params[:video])
|
33
|
-
flash[:notice] = "Successfully updated video."
|
34
|
-
redirect_to :back
|
35
|
-
else
|
36
|
-
render :action => 'edit'
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def destroy
|
41
|
-
@video = Video.find(params[:id])
|
42
|
-
@video.destroy
|
43
|
-
flash[:notice] = "Successfully destroyed video."
|
44
|
-
redirect_to :back
|
45
|
-
end
|
1
|
+
class VideosController < SbdevCoreController
|
2
|
+
before_filter :authenticate_admin!
|
3
|
+
skip_before_filter :get_index
|
4
|
+
belongs_to :index, :optional => true
|
46
5
|
end
|
data/app/models/contact.rb
CHANGED
data/app/models/downloadable.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
class Downloadable < ActiveRecord::Base
|
2
2
|
belongs_to :index
|
3
|
-
attr_accessible :name, :description, :asset, :asset_file_name, :asset_content_type, :asset_file_size
|
3
|
+
attr_accessible :name, :description, :asset, :asset_file_name, :asset_content_type, :asset_file_size
|
4
|
+
|
5
|
+
validates_presence_of :name, :asset
|
4
6
|
|
5
7
|
include ActsAsPrioritizable
|
6
8
|
acts_as_prioritizable("index", "assets")
|
data/app/models/index.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
class Index < ActiveRecord::Base
|
2
|
-
attr_accessible :name, :page_title, :keywords, :page_description, :texts_attributes, :photos_attributes, :videos_attributes, :downloadables_attributes, :gallery_attributes
|
2
|
+
attr_accessible :name, :title, :page_title, :keywords, :page_description, :texts_attributes, :photos_attributes, :videos_attributes, :downloadables_attributes, :gallery_attributes
|
3
3
|
|
4
4
|
has_many :indices, :as => :owner, :dependent => :destroy
|
5
5
|
belongs_to :owner, :polymorphic => true
|
6
6
|
|
7
|
+
extend FriendlyId
|
8
|
+
friendly_id :name, :use => :slugged
|
9
|
+
|
7
10
|
has_one :gallery, :dependent => :destroy
|
8
11
|
|
9
12
|
has_many :texts, :dependent => :destroy
|
data/app/models/photo.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
class Photo < ActiveRecord::Base
|
2
2
|
belongs_to :index
|
3
|
-
attr_accessible :name, :description, :asset, :asset_file_name, :asset_content_type, :asset_file_size, :
|
3
|
+
attr_accessible :name, :description, :asset, :asset_file_name, :asset_content_type, :asset_file_size, :klass
|
4
|
+
|
5
|
+
validates_presence_of :name, :asset
|
4
6
|
|
5
7
|
include ActsAsPrioritizable
|
6
8
|
acts_as_prioritizable("index", "assets")
|
data/app/models/video.rb
CHANGED
@@ -0,0 +1,6 @@
|
|
1
|
+
%p
|
2
|
+
Hello #{@resource.email}!
|
3
|
+
%p Someone has requested a link to change your password, and you can do this through the link below.
|
4
|
+
%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)
|
5
|
+
%p If you didn't request this, please ignore this email.
|
6
|
+
%p Your password won't change until you access the link above and create a new one.
|
@@ -0,0 +1,5 @@
|
|
1
|
+
%p
|
2
|
+
Hello #{@resource.email}!
|
3
|
+
%p Your account has been locked due to an excessive amount of unsuccessful sign in attempts.
|
4
|
+
%p Click the link below to unlock your account:
|
5
|
+
%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token)
|
@@ -0,0 +1,8 @@
|
|
1
|
+
%h2 Change your password
|
2
|
+
= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f|
|
3
|
+
= devise_error_messages!
|
4
|
+
= f.hidden_field :reset_password_token
|
5
|
+
= f.input :password, :label => "New password"
|
6
|
+
= f.input :password_confirmation, :as => :password, :label => "Confirm new password"
|
7
|
+
= f.button :submit, "Change my password"
|
8
|
+
= render :partial => "devise/shared/links"
|
@@ -0,0 +1,6 @@
|
|
1
|
+
%h2 Forgot your password?
|
2
|
+
= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f|
|
3
|
+
= devise_error_messages!
|
4
|
+
= f.input :email
|
5
|
+
= f.button :submit, "Send me reset password instructions"
|
6
|
+
= render :partial => "devise/shared/links"
|
@@ -0,0 +1,8 @@
|
|
1
|
+
%h2 Sign in
|
2
|
+
= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), :validate => true) do |f|
|
3
|
+
= f.input :username
|
4
|
+
= f.input :password
|
5
|
+
- if devise_mapping.rememberable?
|
6
|
+
= f.input :remember_me, :as => :boolean
|
7
|
+
= f.button :submit, "Sign in"
|
8
|
+
= render :partial => "devise/shared/links"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
- if controller_name != 'sessions'
|
2
|
+
= link_to "Sign in", new_session_path(resource_name)
|
3
|
+
%br/
|
4
|
+
- if devise_mapping.registerable? && controller_name != 'registrations'
|
5
|
+
= link_to "Sign up", new_registration_path(resource_name)
|
6
|
+
%br/
|
7
|
+
- if devise_mapping.recoverable? && controller_name != 'passwords'
|
8
|
+
= link_to "Forgot your password?", new_password_path(resource_name)
|
9
|
+
%br/
|
10
|
+
- if devise_mapping.confirmable? && controller_name != 'confirmations'
|
11
|
+
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
|
12
|
+
%br/
|
13
|
+
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
|
14
|
+
= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
|
15
|
+
%br/
|
16
|
+
- if devise_mapping.omniauthable?
|
17
|
+
- resource_class.omniauth_providers.each do |provider|
|
18
|
+
= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider)
|
19
|
+
%br/
|
@@ -0,0 +1 @@
|
|
1
|
+
%h1=APP_CONFIG[:app_name]
|
@@ -0,0 +1,5 @@
|
|
1
|
+
= simple_form_for @contact, :validate => true do |f|
|
2
|
+
= f.input :name, :label => "What's your name?"
|
3
|
+
= f.input :email, :label => "and email address?"
|
4
|
+
= f.input :message, :label => "Your message.", :input_html => { :cols => 48, :rows => 5 }
|
5
|
+
= f.button :submit, "Send Message"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
- title "Contacts"
|
2
|
+
%table
|
3
|
+
%tr
|
4
|
+
%th Name
|
5
|
+
%th From
|
6
|
+
%th Arrival Date
|
7
|
+
%th Departure Date
|
8
|
+
%th Email
|
9
|
+
%th Message
|
10
|
+
- for contact in @contacts
|
11
|
+
%tr
|
12
|
+
%td= h contact.name
|
13
|
+
%td= h contact.from
|
14
|
+
%td= h contact.arrival_date
|
15
|
+
%td= h contact.departure_date
|
16
|
+
%td= h contact.email
|
17
|
+
%td= h contact.message
|
18
|
+
%td= link_to "Show", contact
|
19
|
+
%td= link_to "Edit", edit_contact_path(contact)
|
20
|
+
%td= link_to "Destroy", contact, :confirm => 'Are you sure?', :method => :delete
|
21
|
+
%p= link_to "New Contact", new_contact_path
|
@@ -0,0 +1,24 @@
|
|
1
|
+
- title "Contact"
|
2
|
+
%p
|
3
|
+
%strong Name:
|
4
|
+
= h @contact.name
|
5
|
+
%p
|
6
|
+
%strong From:
|
7
|
+
= h @contact.from
|
8
|
+
%p
|
9
|
+
%strong Arrival Date:
|
10
|
+
= h @contact.arrival_date
|
11
|
+
%p
|
12
|
+
%strong Departure Date:
|
13
|
+
= h @contact.departure_date
|
14
|
+
%p
|
15
|
+
%strong Email:
|
16
|
+
= h @contact.email
|
17
|
+
%p
|
18
|
+
%strong Message:
|
19
|
+
= h @contact.message
|
20
|
+
%p
|
21
|
+
= link_to "Edit", edit_contact_path(@contact)
|
22
|
+
|
|
23
|
+
\#{link_to "Destroy", @contact, :confirm => 'Are you sure?', :method => :delete} |
|
24
|
+
\#{link_to "View All", contacts_path}
|