stay_commerce 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/stay/admin/properties_controller.rb +1 -9
- data/app/controllers/stay/admin/rooms_controller.rb +2 -2
- data/app/controllers/stay/api/v1/amenities_controller.rb +38 -6
- data/app/controllers/stay/api/v1/features_controller.rb +32 -6
- data/app/controllers/stay/api/v1/property_categories_controller.rb +43 -5
- data/app/controllers/stay/api/v1/property_types_controller.rb +32 -9
- data/app/controllers/stay/users/registrations_controller.rb +7 -0
- data/app/controllers/stay/users/sessions_controller.rb +7 -0
- data/app/helpers/stay/application_helper.rb +44 -14
- data/app/models/stay/amenity.rb +0 -2
- data/app/models/stay/feature.rb +0 -1
- data/app/models/stay/property.rb +1 -1
- data/app/models/stay/room_type.rb +3 -2
- data/app/serializers/feature_serializer.rb +3 -0
- data/app/serializers/property_listing_serializer.rb +1 -1
- data/app/serializers/property_serializer.rb +1 -1
- data/app/serializers/room_serializer.rb +2 -2
- data/app/views/stay/admin/amenities/index.html.erb +2 -2
- data/app/views/stay/admin/features/index.html.erb +2 -2
- data/app/views/stay/admin/properties/_description.html.erb +12 -53
- data/app/views/stay/admin/properties/_details.html.erb +2 -26
- data/app/views/stay/admin/properties/_form.html.erb +2 -34
- data/app/views/stay/admin/properties/_location.html.erb +6 -6
- data/app/views/stay/admin/properties/_sidebar.html.erb +7 -7
- data/app/views/stay/admin/properties/index.html.erb +56 -60
- data/app/views/stay/admin/properties/show.html.erb +0 -78
- data/app/views/stay/admin/rooms/_form.html.erb +42 -34
- data/app/views/stay/admin/rooms/index.html.erb +59 -60
- data/app/views/stay/admin/rooms/show.html.erb +15 -5
- data/app/views/stay/admin/users/show.html.erb +6 -3
- data/lib/stay/version.rb +1 -2
- metadata +3 -3
- data/app/serializers/property_feature_serializer.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21d65148be51476482fe86e79472e2e0bf311f49f9def7ee1be0d94cc908484e
|
4
|
+
data.tar.gz: d930047ffebe22e514475ee2a965c840ec7961265d2e3dd48126ac27551b01ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4edf72e5d17bd18491b58f3b84b945ea297c01c7a0eb85e309a6899ed69a99cd92f96f81b121d387f22082fed143fe08ccc505fd9210849293f43fde2b5a405
|
7
|
+
data.tar.gz: 5fa10e530142899cffc424179a44001aabd2eb4e6897c836a76537b1c3323540005ba646212c74f9867f6c10740329396eedfa389fa19da0689018f96599294f
|
@@ -93,26 +93,18 @@ module Stay
|
|
93
93
|
def determine_next_step(current_step)
|
94
94
|
case current_step
|
95
95
|
when "description"
|
96
|
-
"price"
|
97
|
-
when "price"
|
98
96
|
"images"
|
99
97
|
when "images"
|
100
98
|
"details"
|
101
99
|
when "details"
|
102
100
|
"location"
|
103
|
-
when "location"
|
104
|
-
"amenities"
|
105
|
-
when "amenities"
|
106
|
-
"features"
|
107
|
-
when "features"
|
108
|
-
"calendar"
|
109
101
|
else
|
110
102
|
"description"
|
111
103
|
end
|
112
104
|
end
|
113
105
|
|
114
106
|
def valid_step?(step)
|
115
|
-
%w[description
|
107
|
+
%w[description images details location].include?(step)
|
116
108
|
end
|
117
109
|
end
|
118
110
|
end
|
@@ -5,7 +5,7 @@ module Stay
|
|
5
5
|
before_action :set_room, only: %i[show edit update destroy]
|
6
6
|
|
7
7
|
def index
|
8
|
-
@rooms = @property.rooms
|
8
|
+
@rooms = @property.rooms.page(params[:page]).per(10)
|
9
9
|
end
|
10
10
|
|
11
11
|
def show
|
@@ -51,7 +51,7 @@ module Stay
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def room_params
|
54
|
-
params.require(:room).permit(:property_id, :max_guests, :price_per_month, :room_type_id, :booking_start, :booking_end, :description,
|
54
|
+
params.require(:room).permit(:property_id, :max_guests, :price_per_month, :room_type_id, :booking_start, :booking_end, :description, :name,
|
55
55
|
:size, :bed_type_id, :status, amenity_ids: [], feature_ids: [], room_images: [],
|
56
56
|
room_amenities_attributes: [ :id, :amenity_id, :_destroy ],
|
57
57
|
room_features_attributes: [ :id, :name, :feature_id, :_destroy ],
|
@@ -1,13 +1,45 @@
|
|
1
1
|
class Stay::Api::V1::AmenitiesController < ApplicationController
|
2
|
-
before_action :authenticate_devise_api_token!
|
3
|
-
|
4
2
|
def property
|
5
|
-
amenities = Stay::Amenity.
|
6
|
-
|
3
|
+
amenities = Stay::Amenity.property
|
4
|
+
|
5
|
+
if amenities.exists?
|
6
|
+
render json: {
|
7
|
+
success: true,
|
8
|
+
data: ActiveModelSerializers::SerializableResource.new(amenities, each_serializer: AmenitySerializer)
|
9
|
+
}, status: :ok
|
10
|
+
else
|
11
|
+
render json: {
|
12
|
+
success: false,
|
13
|
+
message: "No property amenities found"
|
14
|
+
}, status: :not_found
|
15
|
+
end
|
16
|
+
rescue => e
|
17
|
+
render json: {
|
18
|
+
success: false,
|
19
|
+
error: "Failed to fetch property amenities",
|
20
|
+
message: e.message
|
21
|
+
}, status: :internal_server_error
|
7
22
|
end
|
8
23
|
|
9
24
|
def room
|
10
|
-
amenities = Stay::Amenity.
|
11
|
-
|
25
|
+
amenities = Stay::Amenity.room
|
26
|
+
|
27
|
+
if amenities.exists?
|
28
|
+
render json: {
|
29
|
+
success: true,
|
30
|
+
data: ActiveModelSerializers::SerializableResource.new(amenities, each_serializer: AmenitySerializer)
|
31
|
+
}, status: :ok
|
32
|
+
else
|
33
|
+
render json: {
|
34
|
+
success: false,
|
35
|
+
message: "No room amenities found"
|
36
|
+
}, status: :not_found
|
37
|
+
end
|
38
|
+
rescue => e
|
39
|
+
render json: {
|
40
|
+
success: false,
|
41
|
+
error: "Failed to fetch room amenities",
|
42
|
+
message: e.message
|
43
|
+
}, status: :internal_server_error
|
12
44
|
end
|
13
45
|
end
|
@@ -3,19 +3,45 @@ class Stay::Api::V1::FeaturesController < Stay::BaseApiController
|
|
3
3
|
|
4
4
|
def property
|
5
5
|
features = Stay::Feature.property
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
if features.exists?
|
8
|
+
render json: {
|
9
|
+
success: true,
|
10
|
+
data: ActiveModelSerializers::SerializableResource.new(features, each_serializer: FeatureSerializer)
|
11
|
+
}, status: :ok
|
8
12
|
else
|
9
|
-
render json: {
|
13
|
+
render json: {
|
14
|
+
success: false,
|
15
|
+
message: "No property features found"
|
16
|
+
}, status: :not_found
|
10
17
|
end
|
18
|
+
rescue => e
|
19
|
+
render json: {
|
20
|
+
success: false,
|
21
|
+
error: "Failed to fetch property features",
|
22
|
+
message: e.message
|
23
|
+
}, status: :internal_server_error
|
11
24
|
end
|
12
25
|
|
13
26
|
def room
|
14
27
|
features = Stay::Feature.room
|
15
|
-
|
16
|
-
|
28
|
+
|
29
|
+
if features.exists?
|
30
|
+
render json: {
|
31
|
+
success: true,
|
32
|
+
data: ActiveModelSerializers::SerializableResource.new(features, each_serializer: FeatureSerializer)
|
33
|
+
}, status: :ok
|
17
34
|
else
|
18
|
-
render json: {
|
35
|
+
render json: {
|
36
|
+
success: false,
|
37
|
+
message: "No room features found"
|
38
|
+
}, status: :not_found
|
19
39
|
end
|
40
|
+
rescue => e
|
41
|
+
render json: {
|
42
|
+
success: false,
|
43
|
+
error: "Failed to fetch room features",
|
44
|
+
message: e.message
|
45
|
+
}, status: :internal_server_error
|
20
46
|
end
|
21
47
|
end
|
@@ -2,13 +2,51 @@ class Stay::Api::V1::PropertyCategoriesController < Stay::BaseApiController
|
|
2
2
|
before_action :authenticate_devise_api_token!
|
3
3
|
|
4
4
|
def index
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
categories = Stay::PropertyCategory.all
|
6
|
+
|
7
|
+
if categories.exists?
|
8
|
+
serialized_data = ActiveModelSerializers::SerializableResource.new(categories, each_serializer: PropertyCategorySerializer)
|
9
|
+
render json: {
|
10
|
+
data: serialized_data,
|
11
|
+
message: "Property categories found",
|
12
|
+
success: true
|
13
|
+
}, status: :ok
|
14
|
+
else
|
15
|
+
render json: {
|
16
|
+
data: [],
|
17
|
+
message: "No property categories found",
|
18
|
+
success: false
|
19
|
+
}, status: :not_found
|
20
|
+
end
|
21
|
+
rescue => e
|
22
|
+
render json: {
|
23
|
+
error: "Failed to fetch property categories",
|
24
|
+
message: e.message,
|
25
|
+
success: false
|
26
|
+
}, status: :internal_server_error
|
8
27
|
end
|
9
28
|
|
10
29
|
def show
|
11
|
-
|
12
|
-
|
30
|
+
category = Stay::PropertyCategory.find_by(id: params[:id])
|
31
|
+
|
32
|
+
if category.present?
|
33
|
+
render json: {
|
34
|
+
data: PropertyCategorySerializer.new(category),
|
35
|
+
message: "Property category found",
|
36
|
+
success: true
|
37
|
+
}, status: :ok
|
38
|
+
else
|
39
|
+
render json: {
|
40
|
+
data: {},
|
41
|
+
message: "Property category not found",
|
42
|
+
success: false
|
43
|
+
}, status: :not_found
|
44
|
+
end
|
45
|
+
rescue => e
|
46
|
+
render json: {
|
47
|
+
error: "Failed to fetch property category",
|
48
|
+
message: e.message,
|
49
|
+
success: false
|
50
|
+
}, status: :internal_server_error
|
13
51
|
end
|
14
52
|
end
|
@@ -3,13 +3,13 @@ class Stay::Api::V1::PropertyTypesController < Stay::BaseApiController
|
|
3
3
|
|
4
4
|
def index
|
5
5
|
property_types = Stay::PropertyType.all
|
6
|
-
|
7
|
-
if property_types.
|
6
|
+
|
7
|
+
if property_types.exists?
|
8
8
|
serialized_data = ActiveModelSerializers::SerializableResource.new(property_types, each_serializer: PropertyTypeSerializer)
|
9
|
-
|
9
|
+
|
10
10
|
render json: {
|
11
11
|
data: serialized_data,
|
12
|
-
message: "
|
12
|
+
message: "Property types found",
|
13
13
|
success: true
|
14
14
|
}, status: :ok
|
15
15
|
else
|
@@ -17,14 +17,37 @@ class Stay::Api::V1::PropertyTypesController < Stay::BaseApiController
|
|
17
17
|
data: [],
|
18
18
|
message: "No property types found",
|
19
19
|
success: false
|
20
|
-
}, status: :
|
20
|
+
}, status: :not_found
|
21
21
|
end
|
22
|
+
rescue => e
|
23
|
+
render json: {
|
24
|
+
error: "Failed to fetch property types",
|
25
|
+
message: e.message,
|
26
|
+
success: false
|
27
|
+
}, status: :internal_server_error
|
22
28
|
end
|
23
|
-
|
24
29
|
|
25
30
|
def show
|
26
|
-
|
27
|
-
|
28
|
-
|
31
|
+
type = Stay::PropertyType.find_by(id: params[:id])
|
32
|
+
|
33
|
+
if type.present?
|
34
|
+
render json: {
|
35
|
+
data: PropertyTypeSerializer.new(type),
|
36
|
+
message: "Property type found",
|
37
|
+
success: true
|
38
|
+
}, status: :ok
|
39
|
+
else
|
40
|
+
render json: {
|
41
|
+
data: {},
|
42
|
+
message: "Property type not found",
|
43
|
+
success: false
|
44
|
+
}, status: :not_found
|
45
|
+
end
|
46
|
+
rescue => e
|
47
|
+
render json: {
|
48
|
+
error: "Failed to fetch property type",
|
49
|
+
message: e.message,
|
50
|
+
success: false
|
51
|
+
}, status: :internal_server_error
|
29
52
|
end
|
30
53
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Stay::Users::RegistrationsController < Devise::RegistrationsController
|
4
|
+
before_action :redirects
|
5
|
+
|
4
6
|
# before_action :configure_sign_up_params, only: [:create]
|
5
7
|
# before_action :configure_account_update_params, only: [:update]
|
6
8
|
|
@@ -59,4 +61,9 @@ class Stay::Users::RegistrationsController < Devise::RegistrationsController
|
|
59
61
|
# def after_inactive_sign_up_path_for(resource)
|
60
62
|
# super(resource)
|
61
63
|
# end
|
64
|
+
private
|
65
|
+
|
66
|
+
def redirects
|
67
|
+
redirect_to "/admin/login"
|
68
|
+
end
|
62
69
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Stay::Users::SessionsController < Devise::SessionsController
|
4
|
+
before_action :redirects
|
4
5
|
# before_action :configure_sign_in_params, only: [:create]
|
5
6
|
|
6
7
|
# GET /resource/sign_in
|
@@ -24,4 +25,10 @@ class Stay::Users::SessionsController < Devise::SessionsController
|
|
24
25
|
# def configure_sign_in_params
|
25
26
|
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
|
26
27
|
# end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def redirects
|
32
|
+
redirect_to "/admin/login"
|
33
|
+
end
|
27
34
|
end
|
@@ -3,8 +3,38 @@ module Stay
|
|
3
3
|
include CurrencyHelper
|
4
4
|
ICON_SIZE = 14
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
def badge_class(state)
|
7
|
+
case state
|
8
|
+
when "approved"
|
9
|
+
"green"
|
10
|
+
when "rejected"
|
11
|
+
"red"
|
12
|
+
when "accepted"
|
13
|
+
"orange"
|
14
|
+
when "confirmed"
|
15
|
+
"green"
|
16
|
+
when "booking_request"
|
17
|
+
"orange"
|
18
|
+
when "invoice_sent"
|
19
|
+
"orange"
|
20
|
+
when "canceled"
|
21
|
+
"red"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def icon_class(state)
|
26
|
+
case state
|
27
|
+
when "approved"
|
28
|
+
"icon-check-circle"
|
29
|
+
when "rejected"
|
30
|
+
"icon-times-circle"
|
31
|
+
else
|
32
|
+
"icon-exclamation-circle"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def svg_icon(name:, classes: "", width:, height:)
|
37
|
+
if name.ends_with?(".svg")
|
8
38
|
icon_name = File.basename(name, File.extname(name))
|
9
39
|
inline_svg_tag "#{icon_name}.svg", class: "icon-#{icon_name} #{classes}", size: "#{width}px*#{height}px"
|
10
40
|
else
|
@@ -14,8 +44,8 @@ module Stay
|
|
14
44
|
|
15
45
|
def active_badge(condition, options = {})
|
16
46
|
label = options[:label]
|
17
|
-
label ||= condition ? I18n.t(
|
18
|
-
css_class = condition ?
|
47
|
+
label ||= condition ? I18n.t("admin.say_yes") : I18n.t("admin.say_no")
|
48
|
+
css_class = condition ? "badge-active" : "badge-inactive"
|
19
49
|
|
20
50
|
content_tag(:small, class: "badge badge-pill #{css_class}") do
|
21
51
|
label
|
@@ -25,16 +55,16 @@ module Stay
|
|
25
55
|
def link_to_with_icon(icon_name, text, url, options = {})
|
26
56
|
options[:class] = (options[:class].to_s + " icon-link with-tip action-#{icon_name}").strip
|
27
57
|
options[:title] = text if options[:no_text]
|
28
|
-
text = options[:no_text] ?
|
58
|
+
text = options[:no_text] ? "" : content_tag(:span, text)
|
29
59
|
options.delete(:no_text)
|
30
60
|
options[:width] ||= ICON_SIZE
|
31
61
|
options[:height] ||= ICON_SIZE
|
32
62
|
if icon_name
|
33
|
-
icon = if icon_name.ends_with?(
|
63
|
+
icon = if icon_name.ends_with?(".svg")
|
34
64
|
svg_icon(name: icon_name, classes: "#{'mr-2' unless text.empty?} icon icon-#{icon_name}", width: options[:width], height: options[:height])
|
35
|
-
|
36
|
-
content_tag(:span,
|
37
|
-
|
65
|
+
else
|
66
|
+
content_tag(:span, "", class: "#{'mr-2' unless text.empty?} icon icon-#{icon_name}")
|
67
|
+
end
|
38
68
|
text = "#{icon} #{text}"
|
39
69
|
end
|
40
70
|
link_to(text.html_safe, url, options)
|
@@ -43,17 +73,17 @@ module Stay
|
|
43
73
|
def button_to_with_icon(icon_name, text, url, options = {})
|
44
74
|
options[:class] = (options[:class].to_s + " icon-link with-tip action-#{icon_name}").strip
|
45
75
|
options[:title] = text if options[:no_text]
|
46
|
-
text = options[:no_text] ?
|
76
|
+
text = options[:no_text] ? "" : content_tag(:span, text)
|
47
77
|
options.delete(:no_text)
|
48
78
|
options[:width] ||= ICON_SIZE
|
49
79
|
options[:height] ||= ICON_SIZE
|
50
80
|
|
51
81
|
if icon_name
|
52
|
-
icon = if icon_name.ends_with?(
|
82
|
+
icon = if icon_name.ends_with?(".svg")
|
53
83
|
svg_icon(name: icon_name, classes: "#{'mr-2' unless text.empty?} icon icon-#{icon_name}", width: options[:width], height: options[:height])
|
54
|
-
|
55
|
-
content_tag(:span,
|
56
|
-
|
84
|
+
else
|
85
|
+
content_tag(:span, "", class: "#{'mr-2' unless text.empty?} icon icon-#{icon_name}")
|
86
|
+
end
|
57
87
|
text = "#{icon} #{text}".html_safe
|
58
88
|
end
|
59
89
|
|
data/app/models/stay/amenity.rb
CHANGED
data/app/models/stay/feature.rb
CHANGED
data/app/models/stay/property.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
module Stay
|
2
2
|
class Property < ApplicationRecord
|
3
|
+
STATUSES = %w[active inactive].freeze
|
3
4
|
ACTIVE_STATUS = "active".freeze
|
4
5
|
APPROVED = "approved".freeze
|
5
6
|
PROPERTY = "property".freeze
|
@@ -58,7 +59,6 @@ module Stay
|
|
58
59
|
|
59
60
|
after_restore :restore_associated_rooms
|
60
61
|
after_restore :restore_active_storage_files
|
61
|
-
after_create :create_default_room
|
62
62
|
after_update :update_prices
|
63
63
|
after_create :create_store_property
|
64
64
|
geocoded_by :combine_address
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module Stay
|
2
2
|
class RoomType < ApplicationRecord
|
3
|
-
has_many :rooms, class_name: "Stay::Room"
|
3
|
+
has_many :rooms, class_name: "Stay::Room", dependent: :destroy
|
4
4
|
|
5
|
-
validates :name, presence: true, uniqueness: { case_sensitive: false },
|
5
|
+
validates :name, presence: true, uniqueness: { case_sensitive: false },
|
6
|
+
format: { without: /_/, message: "must not contain underscores" }
|
6
7
|
end
|
7
8
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class PropertyListingSerializer < ActiveModel::Serializer
|
2
2
|
attributes :id, :title, :price_per_month, :place_images, :total_rooms,
|
3
3
|
:availability_end, :availability_start, :extra_guest, :latitude,
|
4
|
-
:longitude, :address, :city, :state, :country, :active, :property_state
|
4
|
+
:longitude, :address, :city, :state, :country, :active, :property_state, :slug
|
5
5
|
|
6
6
|
belongs_to :property_category, Serializer: :PropertyCategorySerializer
|
7
7
|
belongs_to :property_type, Serializer: :PropertyTypeSerializer
|
@@ -16,7 +16,7 @@ class PropertySerializer < ActiveModel::Serializer
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def features
|
19
|
-
ActiveModelSerializers::SerializableResource.new(object.property_type_features, each_serializer:
|
19
|
+
ActiveModelSerializers::SerializableResource.new(object.property_type_features, each_serializer: FeatureSerializer)
|
20
20
|
end
|
21
21
|
|
22
22
|
def is_shared_property
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class RoomSerializer < ActiveModel::Serializer
|
2
|
-
attributes :id, :max_guests, :price_per_month, :status, :booked_dates,
|
2
|
+
attributes :id, :name,:max_guests, :price_per_month, :status, :booked_dates,
|
3
3
|
:booking_start, :booking_end, :description,
|
4
4
|
:size, :bed_type, :room_type, :amenities, :features, :room_images
|
5
5
|
|
@@ -16,7 +16,7 @@ class RoomSerializer < ActiveModel::Serializer
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def features
|
19
|
-
ActiveModelSerializers::SerializableResource.new(object.features.distinct, each_serializer:
|
19
|
+
ActiveModelSerializers::SerializableResource.new(object.features.distinct, each_serializer: FeatureSerializer)
|
20
20
|
end
|
21
21
|
|
22
22
|
def room_images
|
@@ -33,8 +33,8 @@
|
|
33
33
|
<% @amenities.each_with_index do |amenity, index| %>
|
34
34
|
<tr>
|
35
35
|
<td><%= index + 1%></td>
|
36
|
-
<td><%= amenity.name %></td>
|
37
|
-
<th scope="col"><%= amenity.amenity_type%></th>
|
36
|
+
<td><%= amenity.name&.humanize %></td>
|
37
|
+
<th scope="col"><%= amenity.amenity_type&.humanize%></th>
|
38
38
|
<td class="text-end d-flex justify-content-center">
|
39
39
|
<%= link_to edit_admin_amenity_path(amenity), class: 'btn d-inline-flex btn-sm btn-neutral mx-1' do %>
|
40
40
|
<i class="bi bi-pencil"></i>
|
@@ -33,8 +33,8 @@
|
|
33
33
|
<% @features.each_with_index do |feature, index| %>
|
34
34
|
<tr>
|
35
35
|
<td><%= index + 1%></td>
|
36
|
-
<td><%= feature.name
|
37
|
-
<td><%= feature.feature_type %></td>
|
36
|
+
<td><%= feature.name&.humanize %></td>
|
37
|
+
<td><%= feature.feature_type&.humanize %></td>
|
38
38
|
<td class="text-end d-flex justify-content-center">
|
39
39
|
<%= link_to edit_admin_feature_path(feature), class: 'btn d-inline-flex btn-sm btn-neutral mx-1' do %>
|
40
40
|
<i class="bi bi-pencil"></i>
|
@@ -13,15 +13,15 @@
|
|
13
13
|
<div class="row">
|
14
14
|
<div class="col-md-6">
|
15
15
|
<div class="field">
|
16
|
-
<%= f.label :title, '*Title
|
16
|
+
<%= f.label :title, '*Title', class: "form-label" %>
|
17
17
|
<%= f.text_field :title, required: true, class: 'form-control' %>
|
18
18
|
</div>
|
19
19
|
</div>
|
20
20
|
|
21
21
|
<div class="col-md-6">
|
22
22
|
<div class="field">
|
23
|
-
<%= f.label :description, 'Description', class: "form-label" %>
|
24
|
-
<%= f.text_area :description, class: 'form-control' %>
|
23
|
+
<%= f.label :description, '*Description', class: "form-label" %>
|
24
|
+
<%= f.text_area :description,required: true, class: 'form-control' %>
|
25
25
|
</div>
|
26
26
|
</div>
|
27
27
|
</div>
|
@@ -29,14 +29,14 @@
|
|
29
29
|
<div class="row">
|
30
30
|
<div class="col-md-6">
|
31
31
|
<div class="field">
|
32
|
-
<%= f.label :property_category, '*Category
|
32
|
+
<%= f.label :property_category, '*Category', class: "form-label" %>
|
33
33
|
<%= f.select :property_category_id, Stay::PropertyCategory.all.collect { |pc| [pc.name, pc.id] }, { include_blank: 'None' }, required: true, class: 'form-control custom-select-box', selected: @property.property_category&.name %>
|
34
34
|
</div>
|
35
35
|
</div>
|
36
36
|
<div class="col-md-6">
|
37
37
|
<div class="field">
|
38
|
-
<%= f.label :property_type, class:"form-label" %>
|
39
|
-
<%= f.select :property_type_id, Stay::PropertyType.all.collect { |rt| [rt.name, rt.id] }, { include_blank: 'Select Property Type' }, class: 'form-control custom-select-box', selected: @property.property_category&.name %>
|
38
|
+
<%= f.label :property_type, '*Type', class:"form-label" %>
|
39
|
+
<%= f.select :property_type_id, Stay::PropertyType.all.collect { |rt| [rt.name, rt.id] }, { include_blank: 'Select Property Type' },required: true, class: 'form-control custom-select-box', selected: @property.property_category&.name %>
|
40
40
|
</div>
|
41
41
|
</div>
|
42
42
|
</div>
|
@@ -44,15 +44,15 @@
|
|
44
44
|
<div class="row">
|
45
45
|
<div class="col-md-6">
|
46
46
|
<div class="field">
|
47
|
-
<%= f.label :city, '*City
|
47
|
+
<%= f.label :city, '*City', class: "form-label" %>
|
48
48
|
<%= f.text_field :city, value: property.city, required: true, class: "form-control" %>
|
49
49
|
</div>
|
50
50
|
</div>
|
51
51
|
|
52
52
|
<div class="col-md-6">
|
53
53
|
<div class="field">
|
54
|
-
<%= f.label :address, 'Address', class: "form-label" %>
|
55
|
-
<%= f.text_field :address, value: property.address, class: 'form-control' %>
|
54
|
+
<%= f.label :address, '*Address', class: "form-label" %>
|
55
|
+
<%= f.text_field :address, value: property.address, required: true, class: 'form-control' %>
|
56
56
|
</div>
|
57
57
|
</div>
|
58
58
|
</div>
|
@@ -60,60 +60,19 @@
|
|
60
60
|
<div class="row">
|
61
61
|
<div class="col-md-6">
|
62
62
|
<div class="field">
|
63
|
-
<%= f.label :
|
64
|
-
<%= f.number_field :guest_number, value: property.guest_number, required: true, min: 0, class: "form-control" %>
|
65
|
-
</div>
|
66
|
-
</div>
|
67
|
-
|
68
|
-
<div class="col-md-6">
|
69
|
-
<div class="field">
|
70
|
-
<%= f.label :country, class: "form-label" %>
|
63
|
+
<%= f.label :country, '*Country',class: "form-label" %>
|
71
64
|
<%= f.text_field :country, value: property.country, required: true, class: "form-control" %>
|
72
65
|
<%#= f.select :country_id, options_from_collection_for_select(Stay::Country.all, :id, :name, property.country_id), { include_blank: 'Select Country' }, id: 'country_select', class: 'form-control custom-select-box' %>
|
73
66
|
</div>
|
74
67
|
</div>
|
75
|
-
</div>
|
76
|
-
|
77
|
-
<div class="row">
|
78
|
-
<div class="col-md-6">
|
79
|
-
<div class="field">
|
80
|
-
<%= f.label :bedroom_description, class: "form-label" %>
|
81
|
-
<%= f.text_field :bedroom_description, value: property.bedroom_description, class: "form-control" %>
|
82
|
-
</div>
|
83
|
-
</div>
|
84
|
-
|
85
68
|
<div class="col-md-6">
|
86
69
|
<div class="field">
|
87
|
-
<%= f.label :
|
88
|
-
<%= f.
|
70
|
+
<%= f.label :status, class: "form-label" %>
|
71
|
+
<%= f.select :status, Stay::Property::STATUSES.map { |status| [status.humanize, status] }, {}, class: 'form-control custom-select-box' %>
|
89
72
|
</div>
|
90
73
|
</div>
|
91
74
|
</div>
|
92
|
-
<div class="row">
|
93
|
-
<div class="col-md-6">
|
94
|
-
<div class="field">
|
95
|
-
<%= f.label :about_neighbourhoods, class: "form-label" %>
|
96
|
-
<%= f.text_field :about_neighbourhoods, value: property.about_neighbourhoods, class: "form-control" %>
|
97
|
-
</div>
|
98
|
-
</div>
|
99
|
-
|
100
|
-
<div class="col-md-6">
|
101
|
-
<div class="field">
|
102
|
-
<%= f.check_box :active %>
|
103
|
-
<%= f.label :active, class:"form-label mt-8" %>
|
104
|
-
</div>
|
105
|
-
</div>
|
106
75
|
|
107
|
-
</div>
|
108
|
-
|
109
|
-
<div class="row">
|
110
|
-
<div class="col-md-6">
|
111
|
-
<div class="field">
|
112
|
-
<%= f.check_box :instant_booking %>
|
113
|
-
<%= f.label :instant_booking, "Allow instant booking", class:"form-label" %>
|
114
|
-
</div>
|
115
|
-
</div>
|
116
|
-
</div>
|
117
76
|
|
118
77
|
<div class="row">
|
119
78
|
<div class="col-md-12">
|