stay_commerce 0.1.13 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8ab666ef6621d55e7d2aac249f86d0ea9e2c0ccb902bda7de026a5013181372
4
- data.tar.gz: 432b2ded3073a63f4757e7721dec5c9e21203f3a51377382f23eb5a503650d52
3
+ metadata.gz: 21d65148be51476482fe86e79472e2e0bf311f49f9def7ee1be0d94cc908484e
4
+ data.tar.gz: d930047ffebe22e514475ee2a965c840ec7961265d2e3dd48126ac27551b01ef
5
5
  SHA512:
6
- metadata.gz: d046d3c8f75dc3e92614d66d991770d3d03a606458aec4c81fc3a3a9108fc1d2c5f8e45aea562cc8d62b50d55b8f9325949a16451daf41683ef59e33f20a0014
7
- data.tar.gz: aa34ce806d5e6f5300f7386f359dcc57d25e1920a869b2181e327710480cd88007846930e378dc2e77256e2b528dd784ddbf1c5b46a545c368c92c8b3853e66c
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 price images details location amenities features calendar].include?(step)
107
+ %w[description images details location].include?(step)
116
108
  end
117
109
  end
118
110
  end
@@ -7,7 +7,5 @@ module Stay
7
7
 
8
8
  has_many :room_amenities, class_name: "Stay::RoomAmenity"
9
9
  has_many :rooms, through: :room_amenities, class_name: "Stay::Room"
10
-
11
- validates :name, presence: true, uniqueness: { case_sensitive: false }
12
10
  end
13
11
  end
@@ -6,6 +6,5 @@ module Stay
6
6
  has_many :rooms, through: :room_features, class_name: "Stay::Room"
7
7
 
8
8
  enum :feature_type, { property: 0, room: 1 }
9
- validates :name, presence: true, uniqueness: { case_sensitive: false }
10
9
  end
11
10
  end
@@ -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,4 +1,7 @@
1
1
  class CreditCardSerializer < ActiveModel::Serializer
2
2
  attributes :id, :month, :year, :cc_number, :cc_type, :name, :user
3
3
  belongs_to :user
4
+ # def user
5
+ # UserSerializer.new(object.user)
6
+ # end
4
7
  end
@@ -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
 
@@ -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 %></td>
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 (mandatory)', class: "form-label" %>
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 (mandatory)', class: "form-label" %>
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 (mandatory)', class: "form-label" %>
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 :guest_number, '*Guest No (mandatory)', class: "form-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 :university_nearby, class: "form-label" %>
88
- <%= f.text_field :university_nearby, value: property.university_nearby, class: "form-control" %>
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">
@@ -13,35 +13,11 @@
13
13
  <div class="row">
14
14
  <div class="col-md-6">
15
15
  <div class="field">
16
- <%= f.label :property_size, class: "form-label" %>
17
- <%= f.text_field :property_size, class: 'form-control' %>
18
- </div>
19
- </div>
20
-
21
- <div class="col-md-6">
22
- <div class="field">
23
- <%= f.label :Rooms, class: "form-label" %>
24
- <%= f.number_field :total_rooms, class: 'form-control' %>
25
- </div>
26
- </div>
27
- </div>
28
-
29
- <div class="row">
30
- <div class="col-md-6">
31
- <div class="field">
32
- <%= f.label :bedrooms, class: "form-label mt-4" %>
33
- <%= f.number_field :total_bedrooms, class: 'form-control' %>
34
- </div>
35
- </div>
36
-
37
- <div class="col-md-6">
38
- <div class="field">
39
- <%= f.label :bathrooms, class: "form-label mt-4" %>
40
- <%= f.number_field :total_bathrooms, class: 'form-control' %>
16
+ <%= f.label :property_size, '*Property Size',class: "form-label" %>
17
+ <%= f.text_field :property_size,required: true, class: 'form-control' %>
41
18
  </div>
42
19
  </div>
43
20
  </div>
44
-
45
21
  <div class="row">
46
22
  <div class="col-md-12">
47
23
  <%= f.label :additional_rules, class: "form-label mt-4" %>
@@ -60,49 +60,17 @@
60
60
  </div>
61
61
 
62
62
  <div class="row">
63
- <div class="col-md-6">
64
- <div class="field">
65
- <%= f.label :guest_no, class: "form-label" %>
66
- <%= f.number_field :guest_number, required: true, class: "form-control" %>
67
- </div>
68
- </div>
69
-
70
63
  <div class="col-md-6">
71
64
  <div class="field">
72
65
  <%= f.label :country, class: "form-label" %>
73
66
  <%= f.text_field :country, value: property.country, required: true, class: "form-control" %>
74
- <%#= 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' %>
75
- </div>
76
- </div>
77
- </div>
78
-
79
- <div class="row">
80
- <div class="col-md-6">
81
- <div class="field">
82
- <%= f.label :minimum_months_of_booking, class:"form-label" %>
83
- <%= f.text_field :minimum_months_of_booking, class: 'form-control', required: true %>
84
- </div>
85
- </div>
86
- <div class="col-md-6">
87
- <div class="field">
88
- <%= f.label :price_per_month, class:"form-label" %>
89
- <%= f.text_field :price_per_month, class: 'form-control', required: true %>
90
- </div>
91
- </div>
92
- </div>
93
-
94
- <div class="row">
95
- <div class="col-md-6">
96
- <div class="field">
97
- <%= f.check_box :active %>
98
- <%= f.label :active, class:"form-label mt-8" %>
99
67
  </div>
100
68
  </div>
101
69
 
102
70
  <div class="col-md-6">
103
71
  <div class="field">
104
- <%= f.check_box :instant_booking %>
105
- <%= f.label :instant_booking, class:"form-label mt-8" %>
72
+ <%= f.label :status, class: "form-label" %>
73
+ <%= f.select :status, Stay::Property::STATUSES.map { |status| [status.humanize, status] }, {}, class: 'form-control custom-select-box' %>
106
74
  </div>
107
75
  </div>
108
76
  </div>
@@ -13,15 +13,15 @@
13
13
  <div class="row">
14
14
  <div class="col-md-6">
15
15
  <div class="field">
16
- <%= f.label :address, class:"form-label" %>
17
- <%= f.text_field :address, class: 'form-control' %>
16
+ <%= f.label :address,'*Address', class:"form-label" %>
17
+ <%= f.text_field :address, 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 :zipcode, class: "form-label" %>
24
- <%= f.number_field :zipcode, class: "form-control" %>
23
+ <%= f.label :zipcode,'*Zipcode', class: "form-label" %>
24
+ <%= f.number_field :zipcode,required: true, class: "form-control" %>
25
25
  </div>
26
26
  </div>
27
27
  </div>
@@ -29,7 +29,7 @@
29
29
  <div class="row">
30
30
  <div class="col-md-6">
31
31
  <div class="field">
32
- <%= f.label :country, class: "form-label" %>
32
+ <%= f.label :country, '*Country', class: "form-label" %>
33
33
  <%= f.text_field :country, value: property.country, required: true, class: "form-control" %>
34
34
  <%#= f.select :country_id, options_from_collection_for_select(Stay::Country.all, :id, :name, property.country_id), { include_blank: 'Select Country' }, id: 'country_select custom-select-box', class: 'form-control custom-select-box' %>
35
35
  </div>
@@ -37,7 +37,7 @@
37
37
 
38
38
  <div class="col-md-6">
39
39
  <div class="field">
40
- <%= f.label :state, class: "form-label" %>
40
+ <%= f.label :state, '*State', class: "form-label" %>
41
41
  <%= f.text_field :state, value: property.state, required: true, class: "form-control" %>
42
42
  <%#= f.select :state_id, Stay::State.where(country_id: f.object.country_id).pluck(:name, :id),{ prompt: 'Select State', selected: f.object.state_id }, class: 'form-control custom-select-box', id: 'state_select' %>
43
43
  </div>
@@ -4,11 +4,11 @@
4
4
  <i class="bi bi-pencil"></i> Description
5
5
  <% end %>
6
6
  </li>
7
- <li class="nav-item">
8
- <%= link_to edit_admin_property_path(@property, step: 'price'), class: "nav-link #{'active' if @step == 'price'}" do %>
7
+ <!-- <li class="nav-item">
8
+ <% link_to edit_admin_property_path(@property, step: 'price'), class: "nav-link #{'active' if @step == 'price'}" do %>
9
9
  <i class="bi bi-cash"></i> Price
10
10
  <% end %>
11
- </li>
11
+ </li> -->
12
12
  <li class="nav-item">
13
13
  <%= link_to edit_admin_property_path(@property, step: 'images'), class: "nav-link #{'active' if @step == 'images'}" do %>
14
14
  <i class="bi bi-image"></i> Images
@@ -24,7 +24,7 @@
24
24
  <i class="bi bi-geo-alt"></i> Location
25
25
  <% end %>
26
26
  </li>
27
- <li class="nav-item">
27
+ <!-- <li class="nav-item">
28
28
  <%= link_to edit_admin_property_path(@property, step: 'amenities'), class: "nav-link #{'active' if @step == 'amenities'}" do %>
29
29
  <i class="bi bi-check-square"></i> Amenities
30
30
  <% end %>
@@ -33,12 +33,12 @@
33
33
  <%= link_to edit_admin_property_path(@property, step: 'features'), class: "nav-link #{'active' if @step == 'features'}" do %>
34
34
  <i class="bi bi-star"></i> Features
35
35
  <% end %>
36
- </li>
37
- <li class="nav-item">
36
+ </li> -->
37
+ <!-- <li class="nav-item">
38
38
  <%= link_to edit_admin_property_path(@property, step: 'calendar'), class: "nav-link #{'active' if @step == 'calendar'}" do %>
39
39
  <i class="bi bi-calendar"></i> Calendar
40
40
  <% end %>
41
- </li>
41
+ </li> -->
42
42
  <li class="nav-item">
43
43
  <%= link_to admin_property_rooms_path(@property), class: 'nav-link' do %>
44
44
  <i class="bi bi-house-fill"></i> Rooms
@@ -41,8 +41,6 @@
41
41
  <tr>
42
42
  <th scope="col">Sr.No</th>
43
43
  <th scope="col">Title</th>
44
- <th scope="col">Availability Start</th>
45
- <th scope="col">Availability End</th>
46
44
  <th scope="col">Status</th>
47
45
  <th scope="col">Action</th>
48
46
  </tr>
@@ -52,8 +50,6 @@
52
50
  <tr>
53
51
  <td><%= index + 1 %></td>
54
52
  <td><%= property.title %></td>
55
- <td><%= property.availability_start && property.availability_start.strftime("%b %d, %Y") %></td>
56
- <td><%= property.availability_end && property.availability_end.strftime("%b %d, %Y") %></td>
57
53
  <td style = "color: <%= badge_class(property.property_state) %>">
58
54
  <%= property.property_state.humanize %>
59
55
  <span class="badge badge-lg badge-dot">
@@ -17,33 +17,10 @@
17
17
  <p class="form-label"><strong>address:</strong><span class="property-data"><%= @property.address %></span></p>
18
18
  <p class="form-label"><strong>guest_no.:</strong><span class="property-data"><%= @property.guest_number%></span></p>
19
19
  <p class="form-label"><strong>country:</strong><span class="property-data"><%= @property.country %></span></p>
20
- <p class="form-label"><strong>Bedroom Description:</strong><span class="property-data"><%= @property.bedroom_description %></span></p>
21
- <p class="form-label"><strong>University Nearby:</strong><span class="property-data"><%= @property.university_nearby %></span></p>
22
- <p class="form-label"><strong>About Neighbourhoods:</strong><span class="property-data"><%= @property.about_neighbourhoods %></span></p>
23
20
  <p class="form-label"><strong>active: </strong><input type="checkbox" class="form-check-input" <%= @property.active ? 'checked' : '' %> disabled></p>
24
21
  </div>
25
22
  </div>
26
23
  <hr>
27
- <div class="step-price mt-5">
28
- <h3 class="font-semibold mb-3">Price</h3>
29
- <div class="row">
30
- <p class="form-label"><strong>Price per Night:</strong><span class="property-data"><%= @property.price_per_month %></span></p>
31
- <p class="form-label"><strong>minimum_months_of_booking:</strong><span class="property-data"><%= @property.minimum_months_of_booking %></span></p>
32
- <p class="form-label"><strong>security_deposit:</strong><span class="property-data"><%= @property.security_deposit %></span></p>
33
- <p class="form-label"><strong>extra_guest:</strong><span class="property-data"><%= @property.extra_guest %></span></p>
34
- <div class="form-label d-flex flex-wrap property-custom">
35
- <% Stay::Tax.all.each do |tax| %>
36
- <div class="property-tax mb-2">
37
- <p class="form-label"><strong><%= tax.name %>:</strong></p>
38
- <span class="property-data">
39
- <%= @property.property_taxes.find_by(tax_id: tax.id)&.value || 0 %>
40
- </span>
41
- </div>
42
- <% end %>
43
- </div>
44
- <p class="form-label"><strong>allow_extra_guest: </strong><input type="checkbox" class="form-check-input"<%= @property.allow_extra_guest ? 'checked' : '' %> disabled></p>
45
- </div>
46
- </div>
47
24
  <hr>
48
25
  <!-- Images Step -->
49
26
  <div class="step-images mt-5">
@@ -58,9 +35,6 @@
58
35
  <h3 class="font-semibold mb-3">Details</h3>
59
36
  <div class="row">
60
37
  <p class="form-label"><strong>Property Size:</strong><span class="property-data"><%= @property.property_size %></span></p>
61
- <p class="form-label"><strong>Rooms:</strong><span class="property-data"><%= @property.total_rooms %></span></p>
62
- <p class="form-label"><strong>Bedrooms:</strong><span class="property-data"><%= @property.total_bedrooms %></span></p>
63
- <p class="form-label"><strong>Bathrooms:</strong><span class="property-data"><%= @property.total_bathrooms %></span></p>
64
38
  <div class="field">
65
39
  <p class="form-label"><strong>Additional Rules:</strong></p>
66
40
  <% if @property.additional_rules.present? %>
@@ -71,24 +45,6 @@
71
45
  <p class="property-data">No additional rules specified.</p>
72
46
  <% end %>
73
47
  </div>
74
- <div class="field">
75
- <p class="form-label"><strong>Property House Rules:</strong></p>
76
- <% if @property.property_house_rules.present? %>
77
- <% @property.property_house_rules.each do |house_rule| %>
78
- <span class="property-data">
79
- <strong><%= house_rule.house_rule.name %></strong>
80
- <%= radio_button_tag "house_rule_#{house_rule.house_rule_id}", "allow", house_rule.value == "allow", disabled: true %>
81
- <%= label_tag "house_rule_#{house_rule.house_rule_id}", "Allow", class: 'radio-button-label' %>
82
- <%= radio_button_tag "house_rule_#{house_rule.house_rule_id}", "do_not_allow", house_rule.value == "do_not_allow", disabled: true %>
83
- <%= label_tag "house_rule_#{house_rule.house_rule_id}", "Do Not Allow", class: 'radio-button-label' %>
84
- <%= radio_button_tag "house_rule_#{house_rule.house_rule_id}", "charge", house_rule.value == "charge", disabled: true %>
85
- <%= label_tag "house_rule_#{house_rule.house_rule_id}", "Charge", class: 'radio-button-label' %>
86
- </span>
87
- <% end %>
88
- <% else %>
89
- <p class="property-data">No additional rules specified.</p>
90
- <% end %>
91
- </div>
92
48
  </div>
93
49
  </div>
94
50
  <hr>
@@ -103,40 +59,6 @@
103
59
  </div>
104
60
  </div>
105
61
  <hr>
106
- <!-- Amenities Step -->
107
- <div class="step-features mt-5">
108
- <h3 class="font-semibold mb-3">Amenities</h3>
109
- <% if @property.amenities.any? %>
110
- <% @property.amenities.each do |amenity| %>
111
- <input type="checkbox" class="form-check-input" id="feature<%= amenity.id %>" checked disabled>
112
- <label class="form-check-label" for="amenity<%= amenity.id %>"><%= amenity.name %></label>
113
- <% end %>
114
- <% else %>
115
- <p>No amenities selected.</p>
116
- <% end %>
117
- </div>
118
- <hr>
119
- <!-- Features Step -->
120
- <div class="step-features mt-5">
121
- <h3 class="font-semibold mb-3">Features</h3>
122
- <% if @property.features.any? %>
123
- <% @property.features.each do |feature| %>
124
- <input type="checkbox" class="form-check-input" id="feature<%= feature.id %>" checked disabled>
125
- <label class="form-check-label" for="feature<%= feature.id %>"><%= feature.name %></label>
126
- <% end %>
127
- <% else %>
128
- <p>No features selected.</p>
129
- <% end %>
130
- </div>
131
- <hr>
132
- <!-- Calendar Step -->
133
- <div class="step-calendar mt-5">
134
- <h3 class="font-semibold mb-3">Calendar</h3>
135
- <div class="row">
136
- <p class="form-label"><strong>Availability Start:</strong><span class="property-data"><%= @property.availability_start %></span></p>
137
- <p class="form-label"><strong>Availability End:</strong><span class="property-data"><%= @property.availability_end %></span></p>
138
- </div>
139
- </div>
140
62
  <!-- Actions -->
141
63
  <div class="d-flex mt-4 p-4 justify-content-center">
142
64
  <%= button_to 'Approve', approve_admin_property_path(@property), method: :put, class: 'btn btn-warning me-3',disabled: @property.approved? || @property.rejected? %>
@@ -11,19 +11,16 @@
11
11
  <% end %>
12
12
 
13
13
  <div class="row">
14
- <div class="col-md-6">
14
+ <div class="col-md-6">
15
15
  <div class="field">
16
- <%= f.label :max_guests, class:"form-label" %>
17
- <%= f.number_field :max_guests, class: 'form-control' %>
16
+ <%= f.label :name, class:"form-label" %>
17
+ <%= f.text_field :name, class: 'form-control', required: true %>
18
18
  </div>
19
19
  </div>
20
20
  <div class="col-md-6">
21
21
  <div class="field">
22
- <%= f.label :price_per_month, class: "form-label" %>
23
- <div class="input-group">
24
- <span class="input-group-text"><%= currency_symbol(current_currency) %></span>
25
- <%= f.number_field :price_per_month, class: "form-control" %>
26
- </div>
22
+ <%= f.label :max_guests,class:"form-label" %>
23
+ <%= f.number_field :max_guests, required: true, class: 'form-control' %>
27
24
  </div>
28
25
  </div>
29
26
  </div>
@@ -32,14 +29,25 @@
32
29
  <div class="col-md-6">
33
30
  <div class="field">
34
31
  <%= f.label :room_type, class:"form-label" %>
35
- <%= f.select :room_type_id, Stay::RoomType.all.collect { |rt| [rt.name, rt.id] }, { include_blank: 'Select Room Type' }, class: 'form-control custom-select-box' %>
32
+ <%= f.select :room_type_id, Stay::RoomType.all.collect { |rt| [rt.name, rt.id] }, { include_blank: 'Select Room Type' }, required: true,class: 'form-control custom-select-box' %>
36
33
  </div>
37
34
  </div>
38
-
39
35
  <div class="col-md-6">
36
+ <div class="field">
37
+ <%= f.label :price_per_month, '*price', class: "form-label" %>
38
+ <div class="input-group">
39
+ <span class="input-group-text"><%= currency_symbol(current_currency) %></span>
40
+ <%= f.number_field :price_per_month, required: true, class: "form-control" %>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+
46
+ <div class=row>
47
+ <div class="col-md-12">
40
48
  <div class="field">
41
49
  <%= f.label :description, class:"form-label" %>
42
- <%= f.text_field :description, class: 'form-control' %>
50
+ <%= f.text_area :description, required: true, class: 'form-control' %>
43
51
  </div>
44
52
  </div>
45
53
  </div>
@@ -48,14 +56,14 @@
48
56
  <div class="col-md-6">
49
57
  <div class="field">
50
58
  <%= f.label :size, class: "form-label" %>
51
- <%= f.text_field :size, class: 'form-control' %>
59
+ <%= f.text_field :size, required: true, class: 'form-control' %>
52
60
  </div>
53
61
  </div>
54
62
 
55
63
  <div class="col-md-6">
56
64
  <div class="field">
57
65
  <%= f.label :bed_type, class:"form-label" %>
58
- <%= f.select :bed_type_id, Stay::BedType.all.collect { |type| [type.name, type.id] }, { include_blank: 'Select Bed Type' }, class: 'form-control custom-select-box' %>
66
+ <%= f.select :bed_type_id, Stay::BedType.all.collect { |type| [type.name, type.id] }, { include_blank: 'Select Bed Type' }, required: true,class: 'form-control custom-select-box' %>
59
67
  </div>
60
68
  </div>
61
69
  </div>
@@ -64,18 +72,36 @@
64
72
  <div class="col-md-6">
65
73
  <div class="field">
66
74
  <%= f.label :booking_start, class:"form-label"%>
67
- <%= f.date_field :booking_start, class: 'form-control' %>
75
+ <%= f.date_field :booking_start, required: true, class: 'form-control' %>
68
76
  </div>
69
77
  </div>
70
78
 
71
79
  <div class="col-md-6">
72
80
  <div class="field">
73
81
  <%= f.label :booking_end, class:"form-label" %>
74
- <%= f.date_field :booking_end, class: 'form-control' %>
82
+ <%= f.date_field :booking_end, required: true, class: 'form-control' %>
83
+ </div>
84
+ </div>
85
+ </div>
86
+
87
+ <div class="row">
88
+ <div class="col-md-6">
89
+ <div class="field">
90
+ <%= f.label :room_images, "Upload Images", class:"form-label" %>
91
+ <%= f.file_field :room_images, multiple: true, class:"form-control" %>
92
+ <%= f.hidden_field :room_images, value: room.room_images if room.room_images.attached?%>
93
+ </div>
94
+ </div>
95
+
96
+ <div class="col-md-6">
97
+ <div class="field">
98
+ <%= f.label :status, class: "form-label" %>
99
+ <%= f.select :status, Stay::Room::STATUSES.map { |status| [status.humanize, status] }, {}, class: 'form-control custom-select-box' %>
75
100
  </div>
76
101
  </div>
77
102
  </div>
78
103
 
104
+
79
105
  <div class="row">
80
106
  <div class="col-md-6">
81
107
  <div class="field">
@@ -94,7 +120,7 @@
94
120
 
95
121
  <div class="col-md-6">
96
122
  <div class="field">
97
- <%= f.label :amenity_ids, 'Features', class: 'form-label' %>
123
+ <%= f.label :feature_ids, 'Features', class: 'form-label' %>
98
124
  <%= hidden_field_tag 'room[feature_ids][]', '' %>
99
125
  <div class="custom-checkbox form-control">
100
126
  <% Stay::Feature.where(feature_type: 'room').each do |feature| %>
@@ -108,24 +134,6 @@
108
134
  </div>
109
135
  </div>
110
136
 
111
-
112
- <div class="row">
113
- <div class="col-md-6">
114
- <div class="field">
115
- <%= f.label :room_images, "Upload Images", class:"form-label" %>
116
- <%= f.file_field :room_images, multiple: true, class:"form-control" %>
117
- <%= f.hidden_field :room_images, value: room.room_images if room.room_images.attached?%>
118
- </div>
119
- </div>
120
-
121
- <div class="col-md-6">
122
- <div class="field">
123
- <%= f.label :status, class: "form-label" %>
124
- <%= f.select :status, Stay::Room::STATUSES.map { |status| [status.humanize, status] }, {}, class: 'form-control custom-select-box' %>
125
- </div>
126
- </div>
127
- </div>
128
-
129
137
  <div class="row">
130
138
  <div class="col-md-12">
131
139
  <div class="form-group mt-4">
@@ -1,25 +1,25 @@
1
1
  <div class="card mb-7">
2
- <div class="card-header">
2
+ <div class="card-header">
3
3
  <div class="row align-items-center">
4
4
  <div class="col-sm-6 col-12 mb-4 mb-sm-0">
5
- <!-- Title -->
6
5
  <h1 class="h3 mb-0 ls-tight">Rooms</h1>
7
6
  </div>
8
- <!-- Actions -->
9
- <div class="col-sm-6 col-12 text-sm-end">
10
- <div class="mx-n1">
11
- <%= link_to new_admin_property_room_path(@property), class:"btn d-inline-flex btn-sm btn-primary mx-1" do %>
12
- <span class=" pe-2">
13
- <i class="bi bi-plus"></i>
14
- </span>
15
- <span>Create New</span>
16
- <%end%>
7
+ <div class="col-sm-6 col-12 text-sm-end mb-4">
8
+ <div class="d-inline-flex gap-2">
9
+ <%= link_to new_admin_property_room_path(@property), class: "btn btn-sm btn-primary" do %>
10
+ <span class="pe-2"><i class="bi bi-plus"></i></span>
11
+ <span>Add Room</span>
12
+ <% end %>
13
+ <%= link_to edit_admin_property_path(@property), class: "btn btn-sm btn-secondary" do %>
14
+ <span class="pe-2"><i class="bi bi-arrow-right"></i></span>
15
+ <span>Go to Property</span>
16
+ <% end %>
17
17
  </div>
18
18
  </div>
19
- </div>
19
+ </div>
20
20
  </div>
21
21
  <div class="table-responsive">
22
- <table class="table table-hover table-nowrap">
22
+ <table class="table table-hover table-nowrap text-center align-middle">
23
23
  <thead class="table-light">
24
24
  <tr>
25
25
  <th scope="col">Image</th>
@@ -44,7 +44,7 @@
44
44
  <td><%= room.room_type&.name %></td>
45
45
  <td><%= room.booking_start&.strftime("%b %d, %Y")%></td>
46
46
  <td><%= room.booking_end&.strftime("%b %d, %Y")%></td>
47
- <td><%= room.status%></td>
47
+ <td><%= room.status&.humanize%></td>
48
48
  <td class="text-end d-flex justify-content-end">
49
49
  <%= link_to edit_admin_property_room_path(@property, room), class: 'btn d-inline-flex btn-sm btn-neutral mx-1' do %>
50
50
  <i class="bi bi-pencil">Edit</i>
@@ -6,13 +6,23 @@
6
6
  <h2 class="text-xl font-semibold mb-0">Room Details</h2>
7
7
  </div>
8
8
  <div class="card-body">
9
- <p><strong>Image: </strong><%= image_tag main_app.url_for(@room.room_images.first), size: "60x60" if @room.room_images.attached? %></p>
9
+ <p><strong>Images:</strong></p>
10
+ <% if @room.room_images.attached? %>
11
+ <div class="d-flex flex-wrap gap-2">
12
+ <% @room.room_images.each do |image| %>
13
+ <%= image_tag main_app.url_for(image.url), size: "60x60", class: "img-thumbnail" %>
14
+ <% end %>
15
+ </div>
16
+ <% else %>
17
+ <p class="text-muted">No Images Found</p>
18
+ <% end %>
19
+ <p><strong>Name: </strong><%= @room&.name %></p>
10
20
  <p><strong>Max Guests: </strong><%= @room.max_guests %></p>
11
21
  <p><strong>Price Per Night: </strong><%= currency_symbol(current_currency)%> <%= @room.price_per_month %></p>
12
- <p><strong>Room Type: </strong><%= @room.room_type.name%></p>
13
- <p><strong>Booking Start: </strong><%= @room.booking_start%></p>
14
- <p><strong>Booking End: </strong><%= @room.booking_end%></p>
15
- <p><strong>Status: </strong><%= @room.status%></p>
22
+ <p><strong>Room Type: </strong><%= @room.room_type&.name%></p>
23
+ <p><strong>Booking Start: </strong><%= @room.booking_start&.strftime("%b %d, %Y")%></p>
24
+ <p><strong>Booking End: </strong><%= @room.booking_end&.strftime("%b %d, %Y")%></p>
25
+ <p><strong>Status: </strong><%= @room.status&.humanize%></p>
16
26
 
17
27
  <div class="d-flex mt-4 p-4 justify-content-center">
18
28
  <%= link_to 'Edit', edit_admin_property_room_path(@property, @room), class: 'btn btn-warning me-3' %>
data/lib/stay/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Stay
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stay_commerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - w3villa-vikaspal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-17 00:00:00.000000000 Z
11
+ date: 2025-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails