From 8c29083e5a4f8720adec2f2370991ee83d2d44c0 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Thu, 1 Feb 2024 12:10:36 +0530 Subject: [PATCH 01/29] specify a `lang` attribute --- app/views/layouts/application.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d6cbf041..5915616b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,5 +1,5 @@ - + <%= content_for(:title) || "FMB" %> From 77a202e665d2b9347660e727b7bc4af6fe10300e Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Thu, 1 Feb 2024 12:18:12 +0530 Subject: [PATCH 02/29] specify character encoding --- app/views/layouts/application.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 5915616b..234f0061 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -2,6 +2,7 @@ <%= content_for(:title) || "FMB" %> + <%= csrf_meta_tags %> <%= csp_meta_tag %> From b4159636f7850db002b9aba1dcca798a5180f56f Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Thu, 1 Feb 2024 13:01:34 +0530 Subject: [PATCH 03/29] use semantic markup in navigation bar --- .../shared/navbar/_admin_dropdown.html.erb | 6 +++--- .../shared/navbar/_member_dropdown.html.erb | 6 +++--- app/views/shared/navbar/_navbar.html.erb | 17 ++++++++--------- .../shared/navbar/_resources_dropdown.html.erb | 4 ++-- .../shared/navbar/_statistics_dropdown.html.erb | 4 ++-- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/app/views/shared/navbar/_admin_dropdown.html.erb b/app/views/shared/navbar/_admin_dropdown.html.erb index 218456d7..0b355816 100644 --- a/app/views/shared/navbar/_admin_dropdown.html.erb +++ b/app/views/shared/navbar/_admin_dropdown.html.erb @@ -1,11 +1,11 @@ diff --git a/app/views/shared/navbar/_member_dropdown.html.erb b/app/views/shared/navbar/_member_dropdown.html.erb index b12db662..c42e1e1e 100644 --- a/app/views/shared/navbar/_member_dropdown.html.erb +++ b/app/views/shared/navbar/_member_dropdown.html.erb @@ -1,9 +1,9 @@ diff --git a/app/views/shared/navbar/_navbar.html.erb b/app/views/shared/navbar/_navbar.html.erb index d063a2b9..1f11f5d8 100644 --- a/app/views/shared/navbar/_navbar.html.erb +++ b/app/views/shared/navbar/_navbar.html.erb @@ -1,7 +1,6 @@ -
+
-
+ diff --git a/app/views/shared/navbar/_resources_dropdown.html.erb b/app/views/shared/navbar/_resources_dropdown.html.erb index e72bfc76..30a1cb8b 100644 --- a/app/views/shared/navbar/_resources_dropdown.html.erb +++ b/app/views/shared/navbar/_resources_dropdown.html.erb @@ -1,9 +1,9 @@ diff --git a/app/views/shared/navbar/_statistics_dropdown.html.erb b/app/views/shared/navbar/_statistics_dropdown.html.erb index dd93ddf8..9ecbca49 100644 --- a/app/views/shared/navbar/_statistics_dropdown.html.erb +++ b/app/views/shared/navbar/_statistics_dropdown.html.erb @@ -1,8 +1,8 @@ From 962b36517058e17fef4a864321841a16bb28fa60 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Fri, 2 Feb 2024 01:52:02 +0530 Subject: [PATCH 04/29] update local `url_helper` to `url` --- app/views/transactions/_form.html.erb | 2 +- app/views/transactions/edit.html.erb | 2 +- app/views/transactions/new.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/transactions/_form.html.erb b/app/views/transactions/_form.html.erb index 2c9c8518..1aeef13a 100644 --- a/app/views/transactions/_form.html.erb +++ b/app/views/transactions/_form.html.erb @@ -1,5 +1,5 @@
- <%= simple_form_for @transaction, url: url_helper do |f| %> + <%= simple_form_for @transaction, url: do |f| %> <%= f.error_notification %> <%= f.input :recipe_no %> <%= f.input :amount, hint: "Amount shouldn't be greater than: ₹#{total_balance}" %> diff --git a/app/views/transactions/edit.html.erb b/app/views/transactions/edit.html.erb index e067d7f9..f9a3ca24 100644 --- a/app/views/transactions/edit.html.erb +++ b/app/views/transactions/edit.html.erb @@ -4,4 +4,4 @@

Edit Transaction

-<%= render "form", url_helper: transaction_path, total_balance: %> +<%= render "form", url: transaction_path, total_balance: %> diff --git a/app/views/transactions/new.html.erb b/app/views/transactions/new.html.erb index 824a71fd..68f60c76 100644 --- a/app/views/transactions/new.html.erb +++ b/app/views/transactions/new.html.erb @@ -4,4 +4,4 @@

New Transaction

-<%= render "form", url_helper: thaali_transactions_path, total_balance: %> +<%= render "form", url: thaali_transactions_path, total_balance: %> From 28bb34ffb5c8dba2eabd02ed6742c7ca33437d23 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Fri, 2 Feb 2024 01:53:47 +0530 Subject: [PATCH 05/29] add custom color to `table-bg` variable --- app/assets/stylesheets/abstracts/_variables.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/stylesheets/abstracts/_variables.scss b/app/assets/stylesheets/abstracts/_variables.scss index 8be65798..ca45cdd7 100644 --- a/app/assets/stylesheets/abstracts/_variables.scss +++ b/app/assets/stylesheets/abstracts/_variables.scss @@ -7,3 +7,6 @@ $input-focus-border-color: $secondary; $input-border-width: 2px; $form-check-input-checked-bg-color: $success; $form-check-input-checked-border-color: $success; + +// * Table defaults +$table-bg: $secondary; From 64a817db64d94db5a06a99fe2c8719475e68dc74 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Fri, 2 Feb 2024 02:34:21 +0530 Subject: [PATCH 06/29] use semantic markup --- app/assets/stylesheets/_components.scss | 2 +- app/views/errors/internal_server.html.erb | 8 +-- app/views/errors/not_found.html.erb | 6 +- app/views/pages/home.html.erb | 19 ++--- app/views/sabeels/_form.html.erb | 4 +- app/views/sabeels/_sabeel.html.erb | 31 ++++---- app/views/sabeels/_sabeels.html.erb | 8 +-- app/views/sabeels/_thaalis.html.erb | 56 ++++++++------- app/views/sabeels/_theader.html.erb | 16 ++--- app/views/sabeels/active.html.erb | 4 +- app/views/sabeels/show.html.erb | 28 +++----- app/views/sessions/_form.html.erb | 4 +- app/views/sessions/new.html.erb | 4 +- app/views/shared/_actions.html.erb | 16 ++--- app/views/shared/_contact.html.erb | 12 ++-- app/views/shared/_destroy_modal.html.erb | 28 ++++---- app/views/shared/_flash_messages.html.erb | 4 +- app/views/shared/_footer.html.erb | 10 +-- app/views/shared/_results.html.erb | 6 +- app/views/shared/_search.html.erb | 4 +- app/views/statistics/sabeels.html.erb | 22 +++--- app/views/statistics/thaalis.html.erb | 38 +++++----- app/views/thaalis/_form.html.erb | 5 +- app/views/thaalis/_thaali.html.erb | 24 +++---- app/views/thaalis/_thaalis.html.erb | 12 ++-- app/views/thaalis/_theader.html.erb | 22 +++--- app/views/thaalis/all.html.erb | 2 +- app/views/thaalis/complete.html.erb | 2 +- app/views/thaalis/pending.html.erb | 2 +- app/views/thaalis/show.html.erb | 46 ++++++------ app/views/transactions/_form.html.erb | 4 +- app/views/transactions/_theader.html.erb | 20 +++--- app/views/transactions/_transaction.html.erb | 71 ++++++++----------- app/views/transactions/_transactions.html.erb | 12 ++-- app/views/transactions/show.html.erb | 6 +- app/views/users/_form.html.erb | 5 +- app/views/users/_theader.html.erb | 14 ++-- app/views/users/_user.html.erb | 23 +++--- app/views/users/_users.html.erb | 11 ++- app/views/users/edit.html.erb | 1 - app/views/users/index.html.erb | 8 +-- app/views/users/show.html.erb | 20 +++--- spec/features/sabeels/index_spec.rb | 8 +-- spec/features/statistics/sabeels_spec.rb | 10 +-- spec/features/statistics/thaalis_spec.rb | 12 ++-- spec/features/thaalis/all_spec.rb | 4 +- spec/features/transactions/all_spec.rb | 4 +- 47 files changed, 334 insertions(+), 344 deletions(-) diff --git a/app/assets/stylesheets/_components.scss b/app/assets/stylesheets/_components.scss index 86f50186..65dd307a 100644 --- a/app/assets/stylesheets/_components.scss +++ b/app/assets/stylesheets/_components.scss @@ -31,6 +31,6 @@ mark { background-color: $lighter !important; } -#contact ul { +#contact menu { margin-left: -3.5rem !important; } diff --git a/app/views/errors/internal_server.html.erb b/app/views/errors/internal_server.html.erb index ed6a730e..6d2c66d5 100644 --- a/app/views/errors/internal_server.html.erb +++ b/app/views/errors/internal_server.html.erb @@ -1,5 +1,5 @@ -
-

500

+
+

500

-

The server encountered an unexpected error!

-
+ The server encountered an unexpected error! + diff --git a/app/views/errors/not_found.html.erb b/app/views/errors/not_found.html.erb index b7d90719..34937403 100644 --- a/app/views/errors/not_found.html.erb +++ b/app/views/errors/not_found.html.erb @@ -1,5 +1,5 @@ -
+

404

-

The page you're looking for doesn't exist!

-
+ The page you're looking for doesn't exist! + diff --git a/app/views/pages/home.html.erb b/app/views/pages/home.html.erb index 1205154a..30ae1716 100644 --- a/app/views/pages/home.html.erb +++ b/app/views/pages/home.html.erb @@ -1,12 +1,13 @@ -
-
+
+
<%= image_tag("logos/fmb.png", alt: "FMB logo", id: "home__header-logo") %> -
- -
-
Thaali tracking, simplified
-

Manage your thaalis & transactions effortlessly with real-time statistics

+ +
+
+
Thaali tracking, simplified
+

Manage your thaalis & transactions effortlessly with real-time statistics

+
<%= link_to "Free demo", login_path, id: "home__body_cta", class: "btn rounded-pill border border-0 fs-4 px-5 py-2" %> -
-
+ + diff --git a/app/views/sabeels/_form.html.erb b/app/views/sabeels/_form.html.erb index eadd65fd..1e9177ea 100644 --- a/app/views/sabeels/_form.html.erb +++ b/app/views/sabeels/_form.html.erb @@ -1,4 +1,4 @@ -
+
<%= simple_form_for @sabeel do |f| %> <%= f.error_notification %> <%= f.input :its %> @@ -9,4 +9,4 @@ <%= f.input :email %> <%= f.button :submit, action_name: %> <% end %> -
+ diff --git a/app/views/sabeels/_sabeel.html.erb b/app/views/sabeels/_sabeel.html.erb index 3096db94..afac3830 100644 --- a/app/views/sabeels/_sabeel.html.erb +++ b/app/views/sabeels/_sabeel.html.erb @@ -1,36 +1,37 @@ -
- -
-
+
+ + +
+

<%= @sabeel.its %> -

-
+ +
-
+ <% fa_gen(@sabeel.name, "fa-user", space: true) %> -
+
-
+
<% fa_gen(@sabeel.address, "fa-location-pin", space: true) %> -
+
-
+ <%= phone_to @sabeel.mobile, class: "link-warning link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover" %> -
+
-
+ <%= link_to_if @sabeel.email.present?, @sabeel.email, "mailto:#{@sabeel.email}", class: "link-warning link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover" do %> -

No email address provided

+ No email address provided <% end %>
-
+ diff --git a/app/views/sabeels/_sabeels.html.erb b/app/views/sabeels/_sabeels.html.erb index e58cd1c0..51a91495 100644 --- a/app/views/sabeels/_sabeels.html.erb +++ b/app/views/sabeels/_sabeels.html.erb @@ -1,10 +1,10 @@ <% @sabeels.each do |sabeel| %> <%= link_to(sabeel, id: dom_id(sabeel), class: "row py-2 link-underline link-underline-opacity-0") do %> -
+ <%= highlight(sabeel.name, params.dig(:q, :slug_or_name_cont)) %> -
-
+ +
<%= sabeel.apartment.titleize %> -
+ <% end %> <% end %> diff --git a/app/views/sabeels/_thaalis.html.erb b/app/views/sabeels/_thaalis.html.erb index 9df94e27..c5e96398 100644 --- a/app/views/sabeels/_thaalis.html.erb +++ b/app/views/sabeels/_thaalis.html.erb @@ -1,27 +1,31 @@ -
-
- Year -
-
- Total -
-
- Balance -
-
+
+

Total number of Thaalis: <%= @thaalis.size %>

-
- <% @thaalis.each do |thaali| %> - <%= link_to(thaali, id: "thaali_#{thaali.year}", class: "row py-2 link-underline link-underline-opacity-0") do %> -
- <%= thaali.year %> -
-
- <%= add_rupees_symbol_to thaali.total %> -
-
"> - <%= add_rupees_symbol_to thaali.balance %> -
- <% end %> - <% end %> -
+
+ + + + + + + + +
YearTotalBalance
+ +
+ <% @thaalis.each do |thaali| %> + <%= link_to(thaali, id: "thaali_#{thaali.year}", class: "row py-2 link-underline link-underline-opacity-0") do %> + + <%= thaali.year %> + + + <%= add_rupees_symbol_to thaali.total %> + + "> + <%= add_rupees_symbol_to thaali.balance %> + + <% end %> + <% end %> +
+
+
diff --git a/app/views/sabeels/_theader.html.erb b/app/views/sabeels/_theader.html.erb index 9534fce0..e601840c 100644 --- a/app/views/sabeels/_theader.html.erb +++ b/app/views/sabeels/_theader.html.erb @@ -1,8 +1,8 @@ -
-
- Name -
-
- Apartment -
-
+ + + + + + + +
NameApartment
diff --git a/app/views/sabeels/active.html.erb b/app/views/sabeels/active.html.erb index 632703ab..b65ac630 100644 --- a/app/views/sabeels/active.html.erb +++ b/app/views/sabeels/active.html.erb @@ -4,9 +4,9 @@

Active Sabeels: <%= @apt.titleize %>

<%# * Generate PDF %> -
+
+ <%# * show all sabeels %> <%= render "shared/results", model: "sabeels", url: sabeels_active_path(format: :turbo_stream) %> diff --git a/app/views/sabeels/show.html.erb b/app/views/sabeels/show.html.erb index 3df8df42..f595220e 100644 --- a/app/views/sabeels/show.html.erb +++ b/app/views/sabeels/show.html.erb @@ -3,23 +3,17 @@ <%= render @sabeel %> <%# * action buttons %> -<%= render "shared/actions", instance: @sabeel %> +<% unless current_user.is?("viewer") %> +
+ <%= render "shared/actions", instance: @sabeel %> -<%# * Thaalis %> -<% unless @sabeel.taking_thaali? || current_user.is?("viewer") %> -
- <%= link_to "New Thaali", new_sabeel_thaali_path(@sabeel), method: :get, class: "btn btn-success" %> -
+ <%# * Thaalis %> + <% unless @sabeel.taking_thaali? %> + + <% end %> +
<% end %> -<% if @thaalis.present? %> -
-

- Total number of Thaalis: <%= @thaalis.size %> -

- -
- <%= render "thaalis" %> -
-
-<% end %> +<%= render "thaalis" if @thaalis.present? %> diff --git a/app/views/sessions/_form.html.erb b/app/views/sessions/_form.html.erb index 185e0c8f..120f53a2 100644 --- a/app/views/sessions/_form.html.erb +++ b/app/views/sessions/_form.html.erb @@ -1,4 +1,4 @@ -
+
<%= simple_form_for :sessions, url: signup_path do |f| %> <%= f.input :its, label: "ITS", hint: "Guest ITS: 12345678" %> @@ -7,4 +7,4 @@ <%= f.button :submit, value: "Login", data: {turbo_submits_with: "Logging in..."} %> <% end %>
-
+ diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 3bd0387a..d683f31a 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,9 +1,9 @@ <% content_for :title, "Login" %> <%# * Heading %> -
+
<%= image_tag("logos/fmb.png", alt: "FMB logo", id: "home__header-logo") %> -
+ <%# * Login Form %> <%= render "form" %> diff --git a/app/views/shared/_actions.html.erb b/app/views/shared/_actions.html.erb index 6ae1993e..1cec51eb 100644 --- a/app/views/shared/_actions.html.erb +++ b/app/views/shared/_actions.html.erb @@ -1,13 +1,11 @@ -<% unless current_user.is?("viewer") %> -
- <%= link_to "Edit", {controller: params[:controller], action: "edit"}, class: "btn btn-info" %> +
+ + <%# * destroy Modal %> <%= render "shared/destroy_modal", instance: %> -<% end %> + diff --git a/app/views/shared/_contact.html.erb b/app/views/shared/_contact.html.erb index e06f762a..088e757f 100644 --- a/app/views/shared/_contact.html.erb +++ b/app/views/shared/_contact.html.erb @@ -1,14 +1,14 @@ - + diff --git a/app/views/shared/_destroy_modal.html.erb b/app/views/shared/_destroy_modal.html.erb index 74ec2a2c..9fd8b322 100644 --- a/app/views/shared/_destroy_modal.html.erb +++ b/app/views/shared/_destroy_modal.html.erb @@ -1,20 +1,22 @@ - + diff --git a/app/views/shared/_flash_messages.html.erb b/app/views/shared/_flash_messages.html.erb index d8e9c93f..a2acd7a5 100644 --- a/app/views/shared/_flash_messages.html.erb +++ b/app/views/shared/_flash_messages.html.erb @@ -1,5 +1,5 @@ -
+
+ diff --git a/app/views/shared/_footer.html.erb b/app/views/shared/_footer.html.erb index d8789076..0b8b60b5 100644 --- a/app/views/shared/_footer.html.erb +++ b/app/views/shared/_footer.html.erb @@ -1,20 +1,20 @@ diff --git a/app/views/shared/_results.html.erb b/app/views/shared/_results.html.erb index c67bf090..cb9b0b2f 100644 --- a/app/views/shared/_results.html.erb +++ b/app/views/shared/_results.html.erb @@ -1,7 +1,7 @@ -
+
<%= turbo_frame_tag :results, target: "_top" do %> <%= render "theader" %> -
+
<%= turbo_frame_tag :pagination, loading: :lazy, src: url %> <% end %> -
+ diff --git a/app/views/shared/_search.html.erb b/app/views/shared/_search.html.erb index b7803a91..c78d8726 100644 --- a/app/views/shared/_search.html.erb +++ b/app/views/shared/_search.html.erb @@ -1,8 +1,8 @@ - + diff --git a/app/views/statistics/sabeels.html.erb b/app/views/statistics/sabeels.html.erb index f977c27d..37da94a4 100644 --- a/app/views/statistics/sabeels.html.erb +++ b/app/views/statistics/sabeels.html.erb @@ -1,32 +1,30 @@ <% content_for :title, "Sabeel Statistics" %> <%# * Heading %> -

Sabeel Statistics: <%= CURR_YR %>

+

Sabeel Statistics: <%= CURR_YR %>

<%# * No. of Sabeels %> -

Total number of Sabeels: <%= Sabeel.count %>

+

Total number of Sabeels: <%= Sabeel.count %>

<%# * Content %> <% @apts.each do |apartment, values| %> -
+

<%= apartment.to_s.titleize %>

-
+
+
-

Small: <%= values[:small] %>

-

Medium: <%= values[:medium] %>

-

Large: <%= values[:large] %>

+

Small: <%= values[:small] %>

+

Medium: <%= values[:medium] %>

+

Large: <%= values[:large] %>

-

- Total Sabeels: <%= values[:total_sabeels] %> -

+ Total Sabeels: <%= values[:total_sabeels] %>
-
+ <% end %> diff --git a/app/views/statistics/thaalis.html.erb b/app/views/statistics/thaalis.html.erb index 46a65c0e..1587476e 100644 --- a/app/views/statistics/thaalis.html.erb +++ b/app/views/statistics/thaalis.html.erb @@ -5,33 +5,33 @@ <%# * Content %> <% @years.each do |year, values| %> -
+

<%= year %>

-
-

- Total: - <%= add_rupees_symbol_to values[:total] %> -

-

- Balance: - <%= add_rupees_symbol_to values[:balance] %> -

-
+

+ + Total: + <%= add_rupees_symbol_to values[:total] %> + + + Balance: + <%= add_rupees_symbol_to values[:balance] %> + +

-
+
+
-

Small: <%= values[:small] %>

-

Medium: <%= values[:medium] %>

-

Large: <%= values[:large] %>

+

Small: <%= values[:small] %>

+

Medium: <%= values[:medium] %>

+

Large: <%= values[:large] %>

-
+ <%= link_to "Total Thaalis: #{values[:count]}", thaalis_all_path(year), class: "fw-bold text-success fs-5" %> -
-
+ + <% end %> diff --git a/app/views/thaalis/_form.html.erb b/app/views/thaalis/_form.html.erb index 7fab3c2c..9b1044be 100644 --- a/app/views/thaalis/_form.html.erb +++ b/app/views/thaalis/_form.html.erb @@ -1,11 +1,10 @@ -
+
<%= simple_form_for @thaali, url: path do |f| %> <%= f.error_notification %> - <%= f.input :year, disabled: true %> <%= f.input :number %> <%= f.input :size, collection: Thaali.sizes.invert.to_a, as: :radio_buttons %> <%= f.input :total, disabled: action_name == "edit" %> <%= f.button :submit, action_name: %> <% end %> -
+ diff --git a/app/views/thaalis/_thaali.html.erb b/app/views/thaalis/_thaali.html.erb index 88b73c02..d7eaa38e 100644 --- a/app/views/thaalis/_thaali.html.erb +++ b/app/views/thaalis/_thaali.html.erb @@ -1,30 +1,30 @@ -
+
 
-
+
-
+ <%= "#{@thaali.number} (#{thaali.year})" %> -
+
-
+ <%= @thaali.size.capitalize %> -
+
-
+ <%= link_to @thaali.sabeel_its, @thaali.sabeel, class: "fw-bold link-warning link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover" %> -
+
-
+ <%= add_rupees_symbol_to @thaali.total %> -
+
-
-
+ + diff --git a/app/views/thaalis/_thaalis.html.erb b/app/views/thaalis/_thaalis.html.erb index 799037cb..9e048b70 100644 --- a/app/views/thaalis/_thaalis.html.erb +++ b/app/views/thaalis/_thaalis.html.erb @@ -1,13 +1,13 @@ <% @thaalis.each do |thaali| %> <%= link_to(thaali, id: dom_id(thaali), class: "row py-2 link-underline link-underline-opacity-0") do %> -
+ <%= highlight(thaali.number.to_s, params.dig(:q, :number_eq)) %> -
-
+ + <%= thaali.sabeel_name %> -
-
"> + + "> <%= add_rupees_symbol_to thaali.balance %> -
+ <% end %> <% end %> diff --git a/app/views/thaalis/_theader.html.erb b/app/views/thaalis/_theader.html.erb index 98419f2b..c4ec1905 100644 --- a/app/views/thaalis/_theader.html.erb +++ b/app/views/thaalis/_theader.html.erb @@ -1,11 +1,11 @@ -
-
- <%= @q.present? ? sort_link(@q, :number, "Thaali", default_order: :desc) : "Thaali" %> -
-
- Name -
-
- Balance -
-
+ + + + + + + + +
+ <%= @q.present? ? sort_link(@q, :number, "Thaali", default_order: :desc) : "Thaali" %> + NameBalance
diff --git a/app/views/thaalis/all.html.erb b/app/views/thaalis/all.html.erb index a3f38936..cc0b91c0 100644 --- a/app/views/thaalis/all.html.erb +++ b/app/views/thaalis/all.html.erb @@ -1,7 +1,7 @@ <% content_for :title, "Thaalis in #{@year}" %> <%# * Heading %> -

Thaalis in <%= @year %>

+

Thaalis in <%= @year %>

<%# * search %> <%= render "shared/search", attr_name: "Thaali no.", url: thaalis_all_path(@year), search: :number_eq %> diff --git a/app/views/thaalis/complete.html.erb b/app/views/thaalis/complete.html.erb index 6cf6aa84..1f3b1847 100644 --- a/app/views/thaalis/complete.html.erb +++ b/app/views/thaalis/complete.html.erb @@ -1,7 +1,7 @@ <% content_for :title, "Completed Takhmeens in #{@year}" %> <%# * Heading %> -

Completed Takhmeens in <%= @year %>

+

Completed Takhmeens in <%= @year %>

<%# * show all Completed Takhmeens %> <%= render "shared/results", model: "thaalis", url: thaalis_complete_path(format: :turbo_stream) %> diff --git a/app/views/thaalis/pending.html.erb b/app/views/thaalis/pending.html.erb index c2221d89..eaa1335a 100644 --- a/app/views/thaalis/pending.html.erb +++ b/app/views/thaalis/pending.html.erb @@ -1,7 +1,7 @@ <% content_for :title, "Pending Takhmeens in #{@year}" %> <%# * Heading %> -

Pending Takhmeens in <%= @year %>

+

Pending Takhmeens in <%= @year %>

<%# * show all Pending Takhmeens %> <%= render "shared/results", model: "thaalis", url: thaalis_pending_path(format: :turbo_stream) %> diff --git a/app/views/thaalis/show.html.erb b/app/views/thaalis/show.html.erb index a8da3b04..dd9ebe76 100644 --- a/app/views/thaalis/show.html.erb +++ b/app/views/thaalis/show.html.erb @@ -3,46 +3,52 @@ <%= render @thaali %> <%# * action buttons %> -<%= render "shared/actions", instance: @thaali %> +<% unless current_user.is?("viewer") %> +
+ <%= render "shared/actions", instance: @thaali %> -
+ <% unless @thaali.dues_cleared? %> + + <% end %> +
+<% end %> + +
<% if @thaali.dues_cleared? %> -
+   Takhmeen Complete -
+ <% else %> -
+ <%= add_rupees_symbol_to @thaali.paid %> -
+ -
+ <%= add_rupees_symbol_to @thaali.balance %> -
+ <% end %>
-
+ <%# * Transactions %> -<% unless @thaali.dues_cleared? || current_user.is?("viewer") %> -
- <%= link_to "New Transaction", new_thaali_transaction_path(@thaali), method: :get, class: "btn btn-success" %> -
-<% end %> - -
+

- Total number of Transactions: <%= @transactions.size %> + Total number of Transactions: <%= @transactions.length %>

<% if @transactions.any? %> -
+
<%= render "transactions/theader" %> -
<%= render "transactions/transactions" %>
-
+
+ <%= render "transactions/transactions" %> +
+
<% end %>
diff --git a/app/views/transactions/_form.html.erb b/app/views/transactions/_form.html.erb index 1aeef13a..371bd6aa 100644 --- a/app/views/transactions/_form.html.erb +++ b/app/views/transactions/_form.html.erb @@ -1,4 +1,4 @@ -
+
<%= simple_form_for @transaction, url: do |f| %> <%= f.error_notification %> <%= f.input :recipe_no %> @@ -7,4 +7,4 @@ <%= f.input :date, order: %i[day month year] %> <%= f.button :submit, action_name: %> <% end %> -
+ diff --git a/app/views/transactions/_theader.html.erb b/app/views/transactions/_theader.html.erb index 50721f4f..c2607240 100644 --- a/app/views/transactions/_theader.html.erb +++ b/app/views/transactions/_theader.html.erb @@ -1,11 +1,9 @@ -
-
- Recipe -
-
- Amount -
-
- Billed -
-
+ + + + + + + + +
RecipeAmountBilled
diff --git a/app/views/transactions/_transaction.html.erb b/app/views/transactions/_transaction.html.erb index 90f88079..cc6e38ac 100644 --- a/app/views/transactions/_transaction.html.erb +++ b/app/views/transactions/_transaction.html.erb @@ -1,50 +1,37 @@ -
-
+
+

Dawoodi Bohra Jamaat

<%= @transaction.recipe_no %>

-
+ -
-
-
A/c Faiz Al Mawaid Burhaniyah
-
-
-
<%= link_to("#{@transaction.thaali_number} (#{@transaction.thaali_year})", @transaction.thaali, class: "link-primary link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover") %>
-
-
- -
-
- <%= link_to @transaction.sabeel.name, @transaction.sabeel, class: "fst-italic fw-bold link-warning link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover" %> -  from - <%= @transaction.sabeel.address %> -
-
+
+
+
A/c Faiz Al Mawaid Burhaniyah
+
+
+
<%= link_to("#{@transaction.thaali_number} (#{@transaction.thaali_year})", @transaction.thaali, class: "link-primary link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover") %>
+
+
+ -
-
- has voluntarily contributed an amount - <%= add_rupees_symbol_to(@transaction.amount, delimiter: true) %> -
-
- -
-
- or rupees - <%= @transaction.amount.humanize %> -
-
- -
-
- via - <%= @transaction.mode.capitalize %> - on - <%= "#{@transaction.date.to_fs(:long)}." %> -
-
-
+

+ <%= link_to @transaction.sabeel.name, @transaction.sabeel, class: "fst-italic fw-bold link-warning link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover" %> +  from + <%= @transaction.sabeel.address %> +
+ has voluntarily contributed an amount + <%= add_rupees_symbol_to(@transaction.amount, delimiter: true) %> +
+ or rupees + <%= @transaction.amount.humanize %> +
+ via + <%= @transaction.mode.capitalize %> + on + <%= "#{@transaction.date.to_fs(:long)}." %> +

+ diff --git a/app/views/transactions/_transactions.html.erb b/app/views/transactions/_transactions.html.erb index c3b286e4..7106b844 100644 --- a/app/views/transactions/_transactions.html.erb +++ b/app/views/transactions/_transactions.html.erb @@ -1,13 +1,13 @@ <% @transactions.each do |transaction| %> <%= link_to(transaction, id: dom_id(transaction), class: "row py-2 link-underline link-underline-opacity-0") do %> -
+ <%= highlight(transaction.recipe_no.to_s, params.dig(:q, :slug_start)) %> -
-
+ + <%= add_rupees_symbol_to transaction.amount %> -
-
+ + <%= time_ago_in_words(transaction.date) %> -
+ <% end %> <% end %> diff --git a/app/views/transactions/show.html.erb b/app/views/transactions/show.html.erb index 1ec8dab4..42cde0f8 100644 --- a/app/views/transactions/show.html.erb +++ b/app/views/transactions/show.html.erb @@ -3,4 +3,8 @@ <%= render @transaction %> <%# * action buttons %> -<%= render "shared/actions", instance: @transaction %> +<% unless current_user.is?("viewer") %> +
+ <%= render "shared/actions", instance: @transaction %> +
+<% end %> diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 82a833ba..090482c4 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -1,4 +1,4 @@ -
+
<%= simple_form_for @user do |f| %> <%= f.error_notification %> <%= f.input :its %> @@ -6,7 +6,6 @@ <%= f.input :role_ids, collection: roles, as: :radio_buttons %> <%= f.input :password, input_html: {autocomplete: "off"} %> <%= f.input :password_confirmation %> - <%= f.button :submit, action_name: %> <% end %> -
+ diff --git a/app/views/users/_theader.html.erb b/app/views/users/_theader.html.erb index dbb12cc2..0283fb15 100644 --- a/app/views/users/_theader.html.erb +++ b/app/views/users/_theader.html.erb @@ -1,8 +1,6 @@ -
-
- Name -
-
- Role -
-
+ + + + + +
NameRole
diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index fef5c61c..c8e99bed 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb @@ -1,20 +1,21 @@ -
- -
-
+
+ + +
+

<%= @user.its %> -

-
+ +
-
+ <% fa_gen(@user.name, "fa-user", space: true) %> -
+
-
+ <% fa_gen(@user.role.capitalize, "fa-eye", space: true) %> -
+
-
+ diff --git a/app/views/users/_users.html.erb b/app/views/users/_users.html.erb index 1aa4d0a2..5d09fc7f 100644 --- a/app/views/users/_users.html.erb +++ b/app/views/users/_users.html.erb @@ -1,12 +1,11 @@ -
+
<% @users.each do | user | %> <%= link_to(user, id: dom_id(user), class: "row py-3 link-underline link-underline-opacity-0") do %> -
- <%= user.name %> -
-
+ <%= user.name %> + + <%= user.roles_name.first.capitalize %> -
+ <% end %> <% end %>
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 3af89552..4f6d8247 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -8,7 +8,6 @@ <%= f.error_notification %> <%= f.input :password, input_html: {autocomplete: "off"} %> <%= f.input :password_confirmation, input_html: {autocomplete: "off"} %> - <%= f.button :submit, value: "Update Password", action_name: %> <% end %>
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 348bfca2..558629a7 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -4,11 +4,11 @@

All Users

<%# * show all users %> -
- <% if @users.any? %> +<% if @users.any? %> +
<%= render "theader" %> <%= render "users" %> <% else %> <%= render "shared/no_results" %> - <% end %> -
+ +<% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 572a9bf9..be50c65f 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -3,13 +3,15 @@ <%= render @user %> <%# * action buttons %> -
- <%= link_to "Edit", edit_user_path(@user), class: "btn btn-info" if current_user == @user %> - - - - <%# * destroy Modal %> - <%= render "shared/destroy_modal", instance: @user %> +
+ <% if current_user == @user %> + <%= render "shared/actions", instance: @user %> + <% else %> + + <% end %>
diff --git a/spec/features/sabeels/index_spec.rb b/spec/features/sabeels/index_spec.rb index b54b7e95..865d852f 100644 --- a/spec/features/sabeels/index_spec.rb +++ b/spec/features/sabeels/index_spec.rb @@ -27,15 +27,15 @@ context "with ITS" do before { fill_in "q_slug_or_name_cont", with: first.its } - it { within("div#sabeels") { expect(page).to have_content(first.name) } } - it { within("div#sabeels") { expect(page).not_to have_content(last.name) } } + it { within("section#sabeels") { expect(page).to have_content(first.name) } } + it { within("section#sabeels") { expect(page).not_to have_content(last.name) } } end context "with name" do before { fill_in "q_slug_or_name_cont", with: last.name } - it { within("div#sabeels") { expect(page).to have_content(last.name) } } - it { within("div#sabeels") { expect(page).not_to have_content(first.name) } } + it { within("section#sabeels") { expect(page).to have_content(last.name) } } + it { within("section#sabeels") { expect(page).not_to have_content(first.name) } } end end end diff --git a/spec/features/statistics/sabeels_spec.rb b/spec/features/statistics/sabeels_spec.rb index af886499..2b46c433 100644 --- a/spec/features/statistics/sabeels_spec.rb +++ b/spec/features/statistics/sabeels_spec.rb @@ -22,14 +22,14 @@ it { expect(page).to have_css("h3", text: "Burhani") } it "Active" do - within("div#burhani") do + within("section#burhani") do count = active_burhani_sabeels.count expect(page).to have_selector(:link_or_button, "Active: #{count}") end end it "Inactive" do - within("div#burhani") do + within("section#burhani") do count = Sabeel.burhani.count - active_burhani_sabeels.count expect(page).to have_selector(:link_or_button, "Inactive: #{count}") end @@ -37,21 +37,21 @@ describe "size count for" do it "small" do - within("div#burhani") do + within("section#burhani") do count = active_burhani_sabeels.with_thaali_size("small").count expect(page).to have_content("Small: #{count}") end end it "medium" do - within("div#burhani") do + within("section#burhani") do count = active_burhani_sabeels.with_thaali_size("medium").count expect(page).to have_content("Medium: #{count}") end end it "large" do - within("div#burhani") do + within("section#burhani") do count = active_burhani_sabeels.with_thaali_size("large").count expect(page).to have_content("Large: #{count}") end diff --git a/spec/features/statistics/thaalis_spec.rb b/spec/features/statistics/thaalis_spec.rb index 283bd381..e6535546 100644 --- a/spec/features/statistics/thaalis_spec.rb +++ b/spec/features/statistics/thaalis_spec.rb @@ -18,41 +18,41 @@ # * All user types describe "shows statistic details of all thaalis for current year" do it "Total" do - within("div##{CURR_YR}") do + within("section##{CURR_YR}") do total = thaalis.sum(:total) expect(page).to have_content(number_to_human(total, precision: 1, round_mode: :down, significant: false, format: "%n%u", units: {thousand: "K", million: "M"})) end end it "Balance" do - within("div##{CURR_YR}") do + within("section##{CURR_YR}") do balance = thaalis.sum(&:balance) expect(page).to have_content(number_to_human(balance, precision: 1, round_mode: :down, significant: false, format: "%n%u", units: {thousand: "K", million: "M"})) end end it "Complete" do - within("div##{CURR_YR}") do + within("section##{CURR_YR}") do expect(page).to have_selector(:link_or_button, "Complete: #{Thaali.dues_cleared_in(CURR_YR).length}") end end it "Pending" do - within("div##{CURR_YR}") do + within("section##{CURR_YR}") do expect(page).to have_selector(:link_or_button, "Pending: #{Thaali.dues_unpaid_for(CURR_YR).length}") end end it "each size" do - within("div##{CURR_YR}") do + within("section##{CURR_YR}") do Thaali::SIZES.each { |k, v| expect(page).to have_content("#{v}: #{thaalis.send(k).count}") } end end it "total active thaalis count" do - within("div##{CURR_YR}") do + within("section##{CURR_YR}") do expect(page).to have_selector(:link_or_button, "Total Thaalis: #{thaalis.count}") end diff --git a/spec/features/thaalis/all_spec.rb b/spec/features/thaalis/all_spec.rb index 8ea005fa..c04a6522 100644 --- a/spec/features/thaalis/all_spec.rb +++ b/spec/features/thaalis/all_spec.rb @@ -27,8 +27,8 @@ before { fill_in "q_number_eq", with: thaali_number } - it { within("div#thaalis") { expect(page).to have_content(thaali_number) } } - it { within("div#thaalis") { expect(page).not_to have_content(Thaali.last.number) } } + it { within("section#thaalis") { expect(page).to have_content(thaali_number) } } + it { within("section#thaalis") { expect(page).not_to have_content(Thaali.last.number) } } end end end diff --git a/spec/features/transactions/all_spec.rb b/spec/features/transactions/all_spec.rb index 9e2082f9..572d306a 100644 --- a/spec/features/transactions/all_spec.rb +++ b/spec/features/transactions/all_spec.rb @@ -24,8 +24,8 @@ before { fill_in "q_slug_start", with: recipe } - it { within("div#transactions") { expect(page).to have_content(recipe) } } - it { within("div#transactions") { expect(page).not_to have_content(transactions.last.recipe_no) } } + it { within("section#transactions") { expect(page).to have_content(recipe) } } + it { within("section#transactions") { expect(page).not_to have_content(transactions.last.recipe_no) } } end end end From e429150c7998307f0e2777f7656536aff1a2cf4a Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Fri, 2 Feb 2024 10:55:34 +0530 Subject: [PATCH 07/29] remove `mt-6` class as its no longer used --- app/assets/stylesheets/base/_utilities.scss | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 app/assets/stylesheets/base/_utilities.scss diff --git a/app/assets/stylesheets/base/_utilities.scss b/app/assets/stylesheets/base/_utilities.scss deleted file mode 100644 index 11c044cc..00000000 --- a/app/assets/stylesheets/base/_utilities.scss +++ /dev/null @@ -1,3 +0,0 @@ -.mt-6 { - margin-top: 4rem !important; -} From afe6396fc7fa4c10a0e93c3e77dbf83155f6c09a Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Fri, 2 Feb 2024 10:55:34 +0530 Subject: [PATCH 08/29] remove `mt-6` class as its no longer used --- app/assets/stylesheets/application.bootstrap.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/stylesheets/application.bootstrap.scss b/app/assets/stylesheets/application.bootstrap.scss index bb3ae39c..1e21e9bd 100644 --- a/app/assets/stylesheets/application.bootstrap.scss +++ b/app/assets/stylesheets/application.bootstrap.scss @@ -11,7 +11,6 @@ @import "bootstrap/scss/bootstrap"; // base @import "base/base"; -@import "base/utilities"; @import "base/animations"; // layouts @import "layouts/flash"; From 80df20ca93b987ad07f7c920a5452b3e52ae8be6 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Sat, 3 Feb 2024 10:51:05 +0530 Subject: [PATCH 09/29] =?UTF-8?q?=F0=9F=94=A7=20fix=20submit=20button=20st?= =?UTF-8?q?yles=20for=20mobile=20devices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/initializers/simple_form_bootstrap.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb index 1528ea9e..8d76c67d 100644 --- a/config/initializers/simple_form_bootstrap.rb +++ b/config/initializers/simple_form_bootstrap.rb @@ -15,7 +15,7 @@ # Use this setup block to configure all options available in SimpleForm. SimpleForm.setup do |config| # Default class for buttons - config.button_class = "d-block btn btn-secondary col-6 mx-auto mt-5 fs-5 rounded-4" + config.button_class = "d-block btn btn-secondary col-lg-5 col-md-6 mx-auto mt-5 fs-5 rounded-4" # Define the default class of the input wrapper of the boolean input. config.boolean_label_class = "form-check-label" From 3f02b2a62f39815d3a6d0ef83cd0e0068b1d2329 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Sat, 3 Feb 2024 11:53:37 +0530 Subject: [PATCH 10/29] remove `col-sm-10` class --- app/views/thaalis/_form.html.erb | 2 +- app/views/transactions/_form.html.erb | 2 +- app/views/users/_form.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/thaalis/_form.html.erb b/app/views/thaalis/_form.html.erb index 9b1044be..1e69d506 100644 --- a/app/views/thaalis/_form.html.erb +++ b/app/views/thaalis/_form.html.erb @@ -1,4 +1,4 @@ -
+
<%= simple_form_for @thaali, url: path do |f| %> <%= f.error_notification %> <%= f.input :year, disabled: true %> diff --git a/app/views/transactions/_form.html.erb b/app/views/transactions/_form.html.erb index 371bd6aa..af9faff1 100644 --- a/app/views/transactions/_form.html.erb +++ b/app/views/transactions/_form.html.erb @@ -1,4 +1,4 @@ -
+
<%= simple_form_for @transaction, url: do |f| %> <%= f.error_notification %> <%= f.input :recipe_no %> diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index 090482c4..45fc635a 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -1,4 +1,4 @@ -
+
<%= simple_form_for @user do |f| %> <%= f.error_notification %> <%= f.input :its %> From abc6636434ac99dbbf8a54d5b2dea796067172bb Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Sat, 3 Feb 2024 12:43:08 +0530 Subject: [PATCH 11/29] use semantic html in forms --- config/initializers/simple_form_bootstrap.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb index 8d76c67d..28a2d7ff 100644 --- a/config/initializers/simple_form_bootstrap.rb +++ b/config/initializers/simple_form_bootstrap.rb @@ -46,8 +46,8 @@ config.input_field_valid_class = "is-valid" # * 3 wrappers being used - # horizontal form default_wrapper - config.wrappers :horizontal_form, tag: "div", class: "form-group row", error_class: "form-group-invalid", valid_class: "form-group-valid" do |b| + # horizontal form default_wrapper used in all forms + config.wrappers :horizontal_form, tag: "p", class: "form-group row", error_class: "form-group-invalid", valid_class: "form-group-valid" do |b| b.use :html5 b.use :placeholder b.optional :maxlength @@ -56,22 +56,22 @@ b.optional :min_max b.optional :readonly b.use :label, class: "col-md-4 fw-medium fs-5 mt-4 text-success" - b.wrapper :grid_wrapper, tag: "div", class: "col-md-8 mt-md-4" do |ba| + b.wrapper :grid_wrapper, tag: "span", class: "col-md-8 mt-md-4" do |ba| ba.use :input, class: "form-control rounded-3 fst-italic focus-ring focus-ring-secondary", error_class: "is-invalid border-danger-subtle", valid_class: "is-valid text-success" ba.use :hint, wrap_with: {tag: "small", class: "text-success fst-italic mb-0"} - ba.use :full_error, wrap_with: {tag: "div", class: "invalid-feedback fw-medium"} + ba.use :full_error, wrap_with: {tag: "strong", class: "invalid-feedback fw-medium"} end end # horizontal input for inline radio buttons and check boxes - config.wrappers :horizontal_collection_inline, item_wrapper_class: "form-check form-check-inline", item_label_class: "form-check-label fst-italic fw-medium text-secondary", tag: "div", class: "form-group row", error_class: "form-group-invalid", valid_class: "form-group-valid" do |b| + config.wrappers :horizontal_collection_inline, class: "form-group row mb-3", error_class: "form-group-invalid", valid_class: "form-group-valid", tag: "div", item_wrapper_class: "form-check form-check-inline", item_label_class: "form-check-label fst-italic fw-medium text-secondary", item_wrapper_tag: "p" do |b| b.use :html5 b.optional :readonly b.use :label, class: "col-md-4 fw-medium fs-5 mt-4 text-success" b.wrapper :grid_wrapper, tag: "div", class: "col-md-8 mt-md-4" do |ba| ba.use :input, class: "form-check-input border border-2 border-secondary focus-ring focus-ring-secondary", error_class: "is-invalid", valid_class: "is-valid" ba.use :hint, wrap_with: {tag: "small", class: "text-success fst-italic mb-0"} - ba.use :full_error, wrap_with: {tag: "div", class: "invalid-feedback d-block fw-medium"} + ba.use :full_error, wrap_with: {tag: "strong", class: "invalid-feedback d-block fw-medium"} end end From e70db2b3e61467192207b1ee0aa0716e4be922af Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Sat, 3 Feb 2024 12:48:45 +0530 Subject: [PATCH 12/29] use `html` date-picker & `horizontal_form` wrapper for date fields --- app/views/transactions/_form.html.erb | 2 +- config/initializers/simple_form_bootstrap.rb | 26 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/views/transactions/_form.html.erb b/app/views/transactions/_form.html.erb index af9faff1..1dd1e944 100644 --- a/app/views/transactions/_form.html.erb +++ b/app/views/transactions/_form.html.erb @@ -4,7 +4,7 @@ <%= f.input :recipe_no %> <%= f.input :amount, hint: "Amount shouldn't be greater than: ₹#{total_balance}" %> <%= f.input :mode, collection: Transaction.modes.invert.to_a, as: :radio_buttons %> - <%= f.input :date, order: %i[day month year] %> + <%= f.input :date, as: :date, order: %i[day month year], html5: true, input_html: { value: @transaction.date || Date.today } %> <%= f.button :submit, action_name: %> <% end %>
diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb index 28a2d7ff..41a1f6d1 100644 --- a/config/initializers/simple_form_bootstrap.rb +++ b/config/initializers/simple_form_bootstrap.rb @@ -75,18 +75,6 @@ end end - # vertical multi select - config.wrappers :vertical_multi_select, tag: "div", class: "form-group mb-3", error_class: "form-group-invalid", valid_class: "form-group-valid" do |b| - b.use :html5 - b.optional :readonly - b.use :label, class: "fw-medium fs-5 mt-4 text-success" - b.wrapper tag: "div", class: "d-flex flex-row justify-content-between align-items-center" do |ba| - ba.use :input, class: "form-select rounded-3 mx-1 mt-2 fst-italic focus-ring focus-ring-secondary", error_class: "is-invalid border-danger-subtle", valid_class: "is-valid text-success" - end - b.use :hint, wrap_with: {tag: "small", class: "text-success fst-italic mb-0"} - b.use :full_error, wrap_with: {tag: "div", class: "invalid-feedback d-block fw-medium"} - end - # ---------------------------------------------------------------------------------------------- # # vertical forms @@ -167,6 +155,18 @@ b.use :hint, wrap_with: {tag: "small", class: "form-text text-muted"} end + # vertical multi select + config.wrappers :vertical_multi_select, tag: "div", class: "form-group mb-3", error_class: "form-group-invalid", valid_class: "form-group-valid" do |b| + b.use :html5 + b.optional :readonly + b.use :label, class: "fw-medium fs-5 mt-4 text-success" + b.wrapper tag: "div", class: "d-flex flex-row justify-content-between align-items-center" do |ba| + ba.use :input, class: "form-select rounded-3 mx-1 mt-2 fst-italic focus-ring focus-ring-secondary", error_class: "is-invalid border-danger-subtle", valid_class: "is-valid text-success" + end + b.use :hint, wrap_with: {tag: "small", class: "text-success fst-italic mb-0"} + b.use :full_error, wrap_with: {tag: "div", class: "invalid-feedback d-block fw-medium"} + end + # horizontal forms # # horizontal input for boolean @@ -425,7 +425,7 @@ # type as key and the wrapper that will be used for all inputs with specified type. config.wrapper_mappings = { radio_buttons: :horizontal_collection_inline, - date: :vertical_multi_select, + date: :horizontal_form, boolean: :vertical_boolean, check_boxes: :vertical_collection, datetime: :vertical_multi_select, From 86deb72cf56fee946af44f1e0dacacf9f028e8b7 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Sat, 3 Feb 2024 18:27:49 +0530 Subject: [PATCH 13/29] add `fieldset` & `legend` wrapper tags to radio-button elements --- config/initializers/simple_form_bootstrap.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb index 41a1f6d1..775b0f9f 100644 --- a/config/initializers/simple_form_bootstrap.rb +++ b/config/initializers/simple_form_bootstrap.rb @@ -64,10 +64,12 @@ end # horizontal input for inline radio buttons and check boxes - config.wrappers :horizontal_collection_inline, class: "form-group row mb-3", error_class: "form-group-invalid", valid_class: "form-group-valid", tag: "div", item_wrapper_class: "form-check form-check-inline", item_label_class: "form-check-label fst-italic fw-medium text-secondary", item_wrapper_tag: "p" do |b| + config.wrappers :horizontal_collection_inline, class: "form-group row mb-3", error_class: "form-group-invalid", valid_class: "form-group-valid", tag: "fieldset", item_wrapper_class: "form-check form-check-inline", item_label_class: "form-check-label fst-italic fw-medium text-secondary", item_wrapper_tag: "p" do |b| b.use :html5 b.optional :readonly - b.use :label, class: "col-md-4 fw-medium fs-5 mt-4 text-success" + b.wrapper :legend_tag, tag: "legend", class: "col-md-4 fw-medium fs-5 mt-4 text-success" do |ba| + ba.use :label_text + end b.wrapper :grid_wrapper, tag: "div", class: "col-md-8 mt-md-4" do |ba| ba.use :input, class: "form-check-input border border-2 border-secondary focus-ring focus-ring-secondary", error_class: "is-invalid", valid_class: "is-valid" ba.use :hint, wrap_with: {tag: "small", class: "text-success fst-italic mb-0"} From 990d957bc3eb301c72a2ba7c4544ec065e643757 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Mon, 5 Feb 2024 10:18:51 +0530 Subject: [PATCH 14/29] new color for calendar icon in the `date` field --- app/assets/stylesheets/layouts/_form.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/assets/stylesheets/layouts/_form.scss b/app/assets/stylesheets/layouts/_form.scss index f3dbed57..66209e82 100644 --- a/app/assets/stylesheets/layouts/_form.scss +++ b/app/assets/stylesheets/layouts/_form.scss @@ -1,3 +1,8 @@ #form-login { height: 70dvh !important; } + +input[type="date"]::-webkit-calendar-picker-indicator { + background-image: url('data:image/svg+xml;utf8,'); + cursor: pointer; +} From e85ae3e15c6ffc957632ac08ed5302c4b527cee9 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Mon, 5 Feb 2024 10:26:00 +0530 Subject: [PATCH 15/29] move css rules to its respective layouts --- app/assets/stylesheets/base/_base.scss | 23 --------------------- app/assets/stylesheets/layouts/_form.scss | 14 +++++++++++++ app/assets/stylesheets/layouts/_search.scss | 9 ++++++++ 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/assets/stylesheets/base/_base.scss b/app/assets/stylesheets/base/_base.scss index a7cde620..dfb8c062 100644 --- a/app/assets/stylesheets/base/_base.scss +++ b/app/assets/stylesheets/base/_base.scss @@ -3,26 +3,3 @@ body { background-size: cover; background-attachment: fixed; } - -input[type="search"] { - &::-webkit-search-decoration, - &::-webkit-search-cancel-button, - &::-webkit-search-results-button, - &::-webkit-search-results-decoration { - display: none; - } -} - -.form-control { - &::-moz-placeholder { - opacity: 0.85; - } - - &:-ms-input-placeholder { - opacity: 0.85; - } - - &::-webkit-input-placeholder { - opacity: 0.85; - } -} diff --git a/app/assets/stylesheets/layouts/_form.scss b/app/assets/stylesheets/layouts/_form.scss index 66209e82..52ec4fac 100644 --- a/app/assets/stylesheets/layouts/_form.scss +++ b/app/assets/stylesheets/layouts/_form.scss @@ -1,3 +1,17 @@ +.form-control { + &::-moz-placeholder { + opacity: 0.85; + } + + &:-ms-input-placeholder { + opacity: 0.85; + } + + &::-webkit-input-placeholder { + opacity: 0.85; + } +} + #form-login { height: 70dvh !important; } diff --git a/app/assets/stylesheets/layouts/_search.scss b/app/assets/stylesheets/layouts/_search.scss index 693905ce..906a811b 100644 --- a/app/assets/stylesheets/layouts/_search.scss +++ b/app/assets/stylesheets/layouts/_search.scss @@ -1,3 +1,12 @@ +input[type="search"] { + &::-webkit-search-decoration, + &::-webkit-search-cancel-button, + &::-webkit-search-results-button, + &::-webkit-search-results-decoration { + display: none; + } +} + #search { input { padding: 0.75rem 1.5rem; From f90a54d9ce718fd858b0769aed68269df09c6fba Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Mon, 5 Feb 2024 11:14:31 +0530 Subject: [PATCH 16/29] refactor `placeholder` styles in form --- app/assets/stylesheets/layouts/_form.scss | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/layouts/_form.scss b/app/assets/stylesheets/layouts/_form.scss index 52ec4fac..202774d2 100644 --- a/app/assets/stylesheets/layouts/_form.scss +++ b/app/assets/stylesheets/layouts/_form.scss @@ -1,14 +1,11 @@ .form-control { - &::-moz-placeholder { - opacity: 0.85; + &::placeholder { + opacity: 0.8; } + /* Fallback for older browsers */ &:-ms-input-placeholder { - opacity: 0.85; - } - - &::-webkit-input-placeholder { - opacity: 0.85; + opacity: 0.8; } } From 6d686fb4265e50c06530cca5d560a04178d1df59 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Mon, 5 Feb 2024 11:28:02 +0530 Subject: [PATCH 17/29] merge search rules into one declaration block --- app/assets/stylesheets/layouts/_search.scss | 44 ++++++++++----------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/app/assets/stylesheets/layouts/_search.scss b/app/assets/stylesheets/layouts/_search.scss index 906a811b..72ee4047 100644 --- a/app/assets/stylesheets/layouts/_search.scss +++ b/app/assets/stylesheets/layouts/_search.scss @@ -5,34 +5,30 @@ input[type="search"] { &::-webkit-search-results-decoration { display: none; } -} -#search { - input { - padding: 0.75rem 1.5rem; + padding: 0.75rem 1.5rem; - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1em' fill='%23a4a71e' viewBox='0 0 512 512'%3E%3Cpath d='M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3E%3C/svg%3E"); - background-repeat: no-repeat; - background-size: 18px 18px; - background-position: 94% center; + background-image: url('data:image/svg+xml;utf-8,'); + background-repeat: no-repeat; + background-size: 18px 18px; + background-position: 94% center; - background-color: transparent; - backface-visibility: hidden; + background-color: transparent; + backface-visibility: hidden; - border-radius: 2rem; - transform-style: preserve-3d; - transition: all 300ms ease-in-out; + border-radius: 2rem; + transform-style: preserve-3d; + transition: all 300ms ease-in-out; - &:hover, - &:focus { - background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='1em' fill='%2353900f' viewBox='0 0 512 512'%3E%3Cpath d='M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z'/%3E%3C/svg%3E"); - padding: 0.75rem 0.5rem; - outline: 0; - border: 2px solid transparent; - border-bottom: 2px solid $input-focus-border-color; - border-radius: 0; - box-shadow: none; - background-position: 98% center; - } + &:hover, + &:focus { + background-image: url('data:image/svg+xml;utf-8,'); + padding: 0.75rem 0.5rem; + outline: 0; + border: 2px solid transparent; + border-bottom: 2px solid $input-focus-border-color; + border-radius: 0; + box-shadow: none; + background-position: 98% center; } } From 650dfb89ef49e8d28e884a15d17391f2329117fa Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Mon, 5 Feb 2024 12:02:55 +0530 Subject: [PATCH 18/29] update comments --- app/assets/stylesheets/_components.scss | 2 +- app/assets/stylesheets/layouts/_form.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/_components.scss b/app/assets/stylesheets/_components.scss index 65dd307a..f35c492c 100644 --- a/app/assets/stylesheets/_components.scss +++ b/app/assets/stylesheets/_components.scss @@ -10,7 +10,7 @@ &:hover { background-position: right center; - color: white; /* change the direction of the change here */ + color: white; text-decoration: none; } } diff --git a/app/assets/stylesheets/layouts/_form.scss b/app/assets/stylesheets/layouts/_form.scss index 202774d2..1d3eca84 100644 --- a/app/assets/stylesheets/layouts/_form.scss +++ b/app/assets/stylesheets/layouts/_form.scss @@ -3,7 +3,7 @@ opacity: 0.8; } - /* Fallback for older browsers */ + /* Fallback for older browsers (IE) */ &:-ms-input-placeholder { opacity: 0.8; } From 0337fc2b4fa0cc15a820f07393d4419b26e47a50 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Mon, 5 Feb 2024 12:03:46 +0530 Subject: [PATCH 19/29] remove redundant `!important` style --- app/assets/stylesheets/_components.scss | 8 ++++---- app/assets/stylesheets/base/_typography.scss | 2 +- app/assets/stylesheets/layouts/_form.scss | 2 +- app/assets/stylesheets/layouts/_show.scss | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/_components.scss b/app/assets/stylesheets/_components.scss index f35c492c..a297458b 100644 --- a/app/assets/stylesheets/_components.scss +++ b/app/assets/stylesheets/_components.scss @@ -26,11 +26,11 @@ } mark { - padding: 0 !important; - color: $success !important; - background-color: $lighter !important; + padding: 0; + color: $success; + background-color: $lighter; } #contact menu { - margin-left: -3.5rem !important; + margin-left: -3.5rem; } diff --git a/app/assets/stylesheets/base/_typography.scss b/app/assets/stylesheets/base/_typography.scss index 24f24c4d..5acbe2f3 100644 --- a/app/assets/stylesheets/base/_typography.scss +++ b/app/assets/stylesheets/base/_typography.scss @@ -14,5 +14,5 @@ $font-weight-base: 300; } .fs-bigger { - font-size: 15dvh !important; + font-size: 15dvh; } diff --git a/app/assets/stylesheets/layouts/_form.scss b/app/assets/stylesheets/layouts/_form.scss index 1d3eca84..f7254b6b 100644 --- a/app/assets/stylesheets/layouts/_form.scss +++ b/app/assets/stylesheets/layouts/_form.scss @@ -10,7 +10,7 @@ } #form-login { - height: 70dvh !important; + height: 70dvh; } input[type="date"]::-webkit-calendar-picker-indicator { diff --git a/app/assets/stylesheets/layouts/_show.scss b/app/assets/stylesheets/layouts/_show.scss index 27bead38..e794e429 100644 --- a/app/assets/stylesheets/layouts/_show.scss +++ b/app/assets/stylesheets/layouts/_show.scss @@ -19,7 +19,7 @@ width: 5.5rem; height: 9px; margin: auto; - margin-top: 5rem !important; + margin-top: 7rem; top: -25px; position: relative; From e35047d81297f7557225d1670691cf79aa004751 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Tue, 6 Feb 2024 15:41:00 +0530 Subject: [PATCH 20/29] remove redundant `fst-italic` class from `em` tags --- app/views/errors/internal_server.html.erb | 2 +- app/views/errors/not_found.html.erb | 2 +- app/views/transactions/_transaction.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/errors/internal_server.html.erb b/app/views/errors/internal_server.html.erb index 6d2c66d5..7b75972e 100644 --- a/app/views/errors/internal_server.html.erb +++ b/app/views/errors/internal_server.html.erb @@ -1,5 +1,5 @@

500

- The server encountered an unexpected error! + The server encountered an unexpected error!
diff --git a/app/views/errors/not_found.html.erb b/app/views/errors/not_found.html.erb index 34937403..31ebb7cc 100644 --- a/app/views/errors/not_found.html.erb +++ b/app/views/errors/not_found.html.erb @@ -1,5 +1,5 @@

404

- The page you're looking for doesn't exist! + The page you're looking for doesn't exist!
diff --git a/app/views/transactions/_transaction.html.erb b/app/views/transactions/_transaction.html.erb index cc6e38ac..8e387ff4 100644 --- a/app/views/transactions/_transaction.html.erb +++ b/app/views/transactions/_transaction.html.erb @@ -27,7 +27,7 @@ <%= add_rupees_symbol_to(@transaction.amount, delimiter: true) %>
or rupees - <%= @transaction.amount.humanize %> + <%= @transaction.amount.humanize %>
via <%= @transaction.mode.capitalize %> From 20f70e75f013fa443d8ba8e9818cfa7b1fc20dc1 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Tue, 6 Feb 2024 15:48:32 +0530 Subject: [PATCH 21/29] add bootstrap classes --- app/views/sabeels/_thaalis.html.erb | 6 +++--- app/views/thaalis/show.html.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/sabeels/_thaalis.html.erb b/app/views/sabeels/_thaalis.html.erb index c5e96398..da81e7bb 100644 --- a/app/views/sabeels/_thaalis.html.erb +++ b/app/views/sabeels/_thaalis.html.erb @@ -1,5 +1,5 @@
-

Total number of Thaalis: <%= @thaalis.size %>

+

Total number of Thaalis: <%= @thaalis.size %>

@@ -18,10 +18,10 @@ <%= thaali.year %> - + <%= add_rupees_symbol_to thaali.total %> - "> + "> <%= add_rupees_symbol_to thaali.balance %> <% end %> diff --git a/app/views/thaalis/show.html.erb b/app/views/thaalis/show.html.erb index dd9ebe76..0bf62e08 100644 --- a/app/views/thaalis/show.html.erb +++ b/app/views/thaalis/show.html.erb @@ -40,7 +40,7 @@ <%# * Transactions %>

- Total number of Transactions: <%= @transactions.length %> + Total number of Transactions: <%= @transactions.size %>

<% if @transactions.any? %> From ef854bc2859c0e927be724a6bf64ad7c6d5d90fc Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Tue, 6 Feb 2024 16:54:55 +0530 Subject: [PATCH 22/29] fix transparent bg on focus --- app/assets/stylesheets/layouts/_search.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/layouts/_search.scss b/app/assets/stylesheets/layouts/_search.scss index 72ee4047..bfc9bb9e 100644 --- a/app/assets/stylesheets/layouts/_search.scss +++ b/app/assets/stylesheets/layouts/_search.scss @@ -30,5 +30,6 @@ input[type="search"] { border-radius: 0; box-shadow: none; background-position: 98% center; + background-color: transparent; } } From 7735b24dd1946f102502aaef87ca0ce4bbea753d Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Tue, 6 Feb 2024 17:14:58 +0530 Subject: [PATCH 23/29] add border --- app/views/statistics/thaalis.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/statistics/thaalis.html.erb b/app/views/statistics/thaalis.html.erb index 1587476e..b0a278c3 100644 --- a/app/views/statistics/thaalis.html.erb +++ b/app/views/statistics/thaalis.html.erb @@ -5,7 +5,7 @@ <%# * Content %> <% @years.each do |year, values| %> -
+

<%= year %>

From 776fb55a59fa4ddb1ea06087a42ad44455ad2dcd Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Tue, 6 Feb 2024 17:53:19 +0530 Subject: [PATCH 24/29] remove duplicate closing `header` tag --- app/views/transactions/_transaction.html.erb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/views/transactions/_transaction.html.erb b/app/views/transactions/_transaction.html.erb index 8e387ff4..eff2f2fb 100644 --- a/app/views/transactions/_transaction.html.erb +++ b/app/views/transactions/_transaction.html.erb @@ -1,4 +1,4 @@ -

+

Dawoodi Bohra Jamaat

@@ -8,14 +8,13 @@
-
-
-
A/c Faiz Al Mawaid Burhaniyah
-
-
-
<%= link_to("#{@transaction.thaali_number} (#{@transaction.thaali_year})", @transaction.thaali, class: "link-primary link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover") %>
-
-
+
+
+
A/c Faiz Al Mawaid Burhaniyah
+
+
+
<%= link_to("#{@transaction.thaali_number} (#{@transaction.thaali_year})", @transaction.thaali, class: "link-primary link-offset-2 link-underline-opacity-50 link-underline-opacity-100-hover") %>
+

From c0b19e67c4a2f736d75f9eca999c0b65a98e13d2 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Tue, 6 Feb 2024 18:05:44 +0530 Subject: [PATCH 25/29] move heading `h2` tag inside `header` element --- app/assets/stylesheets/_components.scss | 4 ++ app/views/layouts/application.html.erb | 12 +++- app/views/sabeels/_sabeel.html.erb | 2 +- app/views/sabeels/active.html.erb | 6 +- app/views/sabeels/edit.html.erb | 5 +- app/views/sabeels/inactive.html.erb | 4 +- app/views/sabeels/index.html.erb | 4 +- app/views/sabeels/new.html.erb | 4 +- app/views/sabeels/show.html.erb | 4 ++ app/views/shared/navbar/_navbar.html.erb | 70 ++++++++++++------------ app/views/statistics/sabeels.html.erb | 6 +- app/views/statistics/thaalis.html.erb | 4 +- app/views/thaalis/all.html.erb | 4 +- app/views/thaalis/complete.html.erb | 4 +- app/views/thaalis/edit.html.erb | 4 +- app/views/thaalis/new.html.erb | 4 +- app/views/thaalis/pending.html.erb | 4 +- app/views/thaalis/show.html.erb | 4 ++ app/views/transactions/all.html.erb | 4 +- app/views/transactions/edit.html.erb | 4 +- app/views/transactions/new.html.erb | 4 +- app/views/transactions/show.html.erb | 4 ++ app/views/users/_user.html.erb | 2 +- app/views/users/edit.html.erb | 4 +- app/views/users/index.html.erb | 4 +- app/views/users/new.html.erb | 4 +- app/views/users/show.html.erb | 4 ++ 27 files changed, 123 insertions(+), 60 deletions(-) diff --git a/app/assets/stylesheets/_components.scss b/app/assets/stylesheets/_components.scss index a297458b..64c19f0c 100644 --- a/app/assets/stylesheets/_components.scss +++ b/app/assets/stylesheets/_components.scss @@ -15,6 +15,10 @@ } } +header > h2 { + margin: 7rem 0 3rem 0; +} + // styles defined here will take precedence over the in-line styles defined .default-btn { @extend .col-7; diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 234f0061..db4b201c 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - <%= content_for(:title) || "FMB" %> + <%= content_for :title || "FMB" %> <%= csrf_meta_tags %> @@ -13,9 +13,17 @@ - <%= render "shared/navbar/navbar" if current_user.present? %> <%= render "shared/flash_messages" if flash.present? %> + <% if current_user.present? %> +

+ <%= render "shared/navbar/navbar" %> + + <%= content_for :heading %> +
+ <% end %> + +
"> <%= yield %>
diff --git a/app/views/sabeels/_sabeel.html.erb b/app/views/sabeels/_sabeel.html.erb index afac3830..f045d443 100644 --- a/app/views/sabeels/_sabeel.html.erb +++ b/app/views/sabeels/_sabeel.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/sabeels/active.html.erb b/app/views/sabeels/active.html.erb index b65ac630..69b843a1 100644 --- a/app/views/sabeels/active.html.erb +++ b/app/views/sabeels/active.html.erb @@ -1,10 +1,12 @@ <% content_for :title, "Active Sabeels - #{@apt.titleize}" %> <%# * Heading %> -

Active Sabeels: <%= @apt.titleize %>

+<% content_for :heading do %> +

Active Sabeels: <%= @apt.titleize %>

+<% end %> <%# * Generate PDF %> - diff --git a/app/views/statistics/sabeels.html.erb b/app/views/statistics/sabeels.html.erb index 37da94a4..c3ad8a10 100644 --- a/app/views/statistics/sabeels.html.erb +++ b/app/views/statistics/sabeels.html.erb @@ -1,10 +1,12 @@ <% content_for :title, "Sabeel Statistics" %> <%# * Heading %> -

Sabeel Statistics: <%= CURR_YR %>

+<% content_for :heading do %> +

Sabeel Statistics

+<% end %> <%# * No. of Sabeels %> -

Total number of Sabeels: <%= Sabeel.count %>

+

Total number of Sabeels: <%= Sabeel.count %>

<%# * Content %> <% @apts.each do |apartment, values| %> diff --git a/app/views/statistics/thaalis.html.erb b/app/views/statistics/thaalis.html.erb index b0a278c3..d1ffec20 100644 --- a/app/views/statistics/thaalis.html.erb +++ b/app/views/statistics/thaalis.html.erb @@ -1,7 +1,9 @@ <% content_for :title, "Thaali Statistics" %> <%# * Heading %> -

Thaali Statistics

+<% content_for :heading do %> +

Thaali Statistics

+<% end %> <%# * Content %> <% @years.each do |year, values| %> diff --git a/app/views/thaalis/all.html.erb b/app/views/thaalis/all.html.erb index cc0b91c0..a153ce35 100644 --- a/app/views/thaalis/all.html.erb +++ b/app/views/thaalis/all.html.erb @@ -1,7 +1,9 @@ <% content_for :title, "Thaalis in #{@year}" %> <%# * Heading %> -

Thaalis in <%= @year %>

+<% content_for :heading do %> +

Thaalis in <%= @year %>

+<% end %> <%# * search %> <%= render "shared/search", attr_name: "Thaali no.", url: thaalis_all_path(@year), search: :number_eq %> diff --git a/app/views/thaalis/complete.html.erb b/app/views/thaalis/complete.html.erb index 1f3b1847..328597aa 100644 --- a/app/views/thaalis/complete.html.erb +++ b/app/views/thaalis/complete.html.erb @@ -1,7 +1,9 @@ <% content_for :title, "Completed Takhmeens in #{@year}" %> <%# * Heading %> -

Completed Takhmeens in <%= @year %>

+<% content_for :heading do %> +

Completed Takhmeens in <%= @year %>

+<% end %> <%# * show all Completed Takhmeens %> <%= render "shared/results", model: "thaalis", url: thaalis_complete_path(format: :turbo_stream) %> diff --git a/app/views/thaalis/edit.html.erb b/app/views/thaalis/edit.html.erb index 55b6c767..e4c6a76e 100644 --- a/app/views/thaalis/edit.html.erb +++ b/app/views/thaalis/edit.html.erb @@ -1,5 +1,7 @@ <% content_for :title, "Edit Thaali" %> -

Edit Thaali

+<% content_for :heading do %> +

Edit Thaali

+<% end %> <%= render "form", path: thaali_path %> diff --git a/app/views/thaalis/new.html.erb b/app/views/thaalis/new.html.erb index 80878996..70a3ff03 100644 --- a/app/views/thaalis/new.html.erb +++ b/app/views/thaalis/new.html.erb @@ -1,5 +1,7 @@ <% content_for :title, "New Thaali" %> -

New Thaali

+<% content_for :heading do %> +

New Thaali

+<% end %> <%= render "form", path: sabeel_thaalis_path %> diff --git a/app/views/thaalis/pending.html.erb b/app/views/thaalis/pending.html.erb index eaa1335a..7528791c 100644 --- a/app/views/thaalis/pending.html.erb +++ b/app/views/thaalis/pending.html.erb @@ -1,7 +1,9 @@ <% content_for :title, "Pending Takhmeens in #{@year}" %> <%# * Heading %> -

Pending Takhmeens in <%= @year %>

+<% content_for :heading do %> +

Pending Takhmeens in <%= @year %>

+<% end %> <%# * show all Pending Takhmeens %> <%= render "shared/results", model: "thaalis", url: thaalis_pending_path(format: :turbo_stream) %> diff --git a/app/views/thaalis/show.html.erb b/app/views/thaalis/show.html.erb index 0bf62e08..eb1a59cd 100644 --- a/app/views/thaalis/show.html.erb +++ b/app/views/thaalis/show.html.erb @@ -1,5 +1,9 @@ <% content_for :title, "Thaali no. #{@thaali.number}" %> +<% content_for :heading do %> +

Thaali No: <%= @thaali.number %>

+<% end %> + <%= render @thaali %> <%# * action buttons %> diff --git a/app/views/transactions/all.html.erb b/app/views/transactions/all.html.erb index 0fc3b1ca..3aa8fb36 100644 --- a/app/views/transactions/all.html.erb +++ b/app/views/transactions/all.html.erb @@ -1,7 +1,9 @@ <% content_for :title, "Transactions" %> <%# * Heading %> -

Transactions

+<% content_for :heading do %> +

Transactions

+<% end %> <%# * search %> <%= render "shared/search", attr_name: "Recipe no.", url: transactions_all_path, search: :slug_start %> diff --git a/app/views/transactions/edit.html.erb b/app/views/transactions/edit.html.erb index f9a3ca24..4b78f995 100644 --- a/app/views/transactions/edit.html.erb +++ b/app/views/transactions/edit.html.erb @@ -2,6 +2,8 @@ <% content_for :title, "Edit Transaction" %> -

Edit Transaction

+<% content_for :heading do %> +

Edit Transaction

+<% end %> <%= render "form", url: transaction_path, total_balance: %> diff --git a/app/views/transactions/new.html.erb b/app/views/transactions/new.html.erb index 68f60c76..d5d16b8e 100644 --- a/app/views/transactions/new.html.erb +++ b/app/views/transactions/new.html.erb @@ -2,6 +2,8 @@ <% content_for :title, "New Transaction" %> -

New Transaction

+<% content_for :heading do %> +

New Transaction

+<% end %> <%= render "form", url: thaali_transactions_path, total_balance: %> diff --git a/app/views/transactions/show.html.erb b/app/views/transactions/show.html.erb index 42cde0f8..40fd2443 100644 --- a/app/views/transactions/show.html.erb +++ b/app/views/transactions/show.html.erb @@ -1,5 +1,9 @@ <% content_for :title, "Recipe: #{@transaction.recipe_no}" %> +<% content_for :heading do %> +

Recipe: <%= @transaction.recipe_no %>

+<% end %> + <%= render @transaction %> <%# * action buttons %> diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index c8e99bed..fca51b1f 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 4f6d8247..4a38f3a3 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,7 +1,9 @@ <% content_for :title, "Change Password" %> <%# * Heading %> -

Change Password

+<% content_for :heading do %> +

Change Password

+<% end %>
<%= simple_form_for @user do |f| %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 558629a7..53351f2f 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,7 +1,9 @@ <% content_for :title, "Users" %> <%# * Heading %> -

All Users

+<% content_for :heading do %> +

Users

+<% end %> <%# * show all users %> <% if @users.any? %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 2206232e..786ed529 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -3,7 +3,9 @@ <% content_for :title, "New User" %> <%# * Heading %> -

New User

+<% content_for :heading do %> +

New User

+<% end %> <%# * Sign Up form %> <%= render "form", roles: %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index be50c65f..5ed76e65 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -2,6 +2,10 @@ <%= render @user %> +<% content_for :heading do %> +

<%= @user.name %>

+<% end %> + <%# * action buttons %>
<% if current_user == @user %> From 245899d307a726ddf0a1dc1ae3b3108d1c0f55c5 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Tue, 6 Feb 2024 18:06:49 +0530 Subject: [PATCH 26/29] decrease `margin-top` value for `#thaali__handle` --- app/assets/stylesheets/layouts/_show.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/layouts/_show.scss b/app/assets/stylesheets/layouts/_show.scss index e794e429..a9269a34 100644 --- a/app/assets/stylesheets/layouts/_show.scss +++ b/app/assets/stylesheets/layouts/_show.scss @@ -19,7 +19,7 @@ width: 5.5rem; height: 9px; margin: auto; - margin-top: 7rem; + margin-top: 4rem; top: -25px; position: relative; From 2d1d35c1c3de4486d1156e34b454fc0bff38d533 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Tue, 6 Feb 2024 18:14:57 +0530 Subject: [PATCH 27/29] remove redundant `Heading` comment --- app/views/sabeels/active.html.erb | 1 - app/views/sabeels/edit.html.erb | 1 - app/views/sabeels/inactive.html.erb | 1 - app/views/sabeels/index.html.erb | 1 - app/views/sessions/new.html.erb | 1 - app/views/statistics/sabeels.html.erb | 2 +- app/views/statistics/thaalis.html.erb | 2 +- app/views/thaalis/all.html.erb | 1 - app/views/thaalis/complete.html.erb | 1 - app/views/thaalis/pending.html.erb | 1 - app/views/transactions/all.html.erb | 1 - app/views/users/edit.html.erb | 1 - app/views/users/index.html.erb | 1 - app/views/users/new.html.erb | 1 - 14 files changed, 2 insertions(+), 14 deletions(-) diff --git a/app/views/sabeels/active.html.erb b/app/views/sabeels/active.html.erb index 69b843a1..b4e2c902 100644 --- a/app/views/sabeels/active.html.erb +++ b/app/views/sabeels/active.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Active Sabeels - #{@apt.titleize}" %> -<%# * Heading %> <% content_for :heading do %>

Active Sabeels: <%= @apt.titleize %>

<% end %> diff --git a/app/views/sabeels/edit.html.erb b/app/views/sabeels/edit.html.erb index 35172d3e..c9bf476d 100644 --- a/app/views/sabeels/edit.html.erb +++ b/app/views/sabeels/edit.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Edit Sabeel" %> -<%# * Heading %> <% content_for :heading do %>

Edit Sabeel

<% end %> diff --git a/app/views/sabeels/inactive.html.erb b/app/views/sabeels/inactive.html.erb index 5dcc8a8c..5da3c273 100644 --- a/app/views/sabeels/inactive.html.erb +++ b/app/views/sabeels/inactive.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Inactive Sabeels - #{@apt.titleize}" %> -<%# * Heading %> <% content_for :heading do %>

Inactive Sabeels in: <%= @apt.titleize %>

<% end %> diff --git a/app/views/sabeels/index.html.erb b/app/views/sabeels/index.html.erb index 49be1134..306d3d22 100644 --- a/app/views/sabeels/index.html.erb +++ b/app/views/sabeels/index.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Sabeels" %> -<%# * Heading %> <% content_for :heading do %>

Sabeels

<% end %> diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index d683f31a..04f53c67 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Login" %> -<%# * Heading %>
<%= image_tag("logos/fmb.png", alt: "FMB logo", id: "home__header-logo") %>
diff --git a/app/views/statistics/sabeels.html.erb b/app/views/statistics/sabeels.html.erb index c3ad8a10..9ca45962 100644 --- a/app/views/statistics/sabeels.html.erb +++ b/app/views/statistics/sabeels.html.erb @@ -1,6 +1,6 @@ <% content_for :title, "Sabeel Statistics" %> -<%# * Heading %> + <% content_for :heading do %>

Sabeel Statistics

<% end %> diff --git a/app/views/statistics/thaalis.html.erb b/app/views/statistics/thaalis.html.erb index d1ffec20..6fde9463 100644 --- a/app/views/statistics/thaalis.html.erb +++ b/app/views/statistics/thaalis.html.erb @@ -1,6 +1,6 @@ <% content_for :title, "Thaali Statistics" %> -<%# * Heading %> + <% content_for :heading do %>

Thaali Statistics

<% end %> diff --git a/app/views/thaalis/all.html.erb b/app/views/thaalis/all.html.erb index a153ce35..95457eed 100644 --- a/app/views/thaalis/all.html.erb +++ b/app/views/thaalis/all.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Thaalis in #{@year}" %> -<%# * Heading %> <% content_for :heading do %>

Thaalis in <%= @year %>

<% end %> diff --git a/app/views/thaalis/complete.html.erb b/app/views/thaalis/complete.html.erb index 328597aa..7fd46737 100644 --- a/app/views/thaalis/complete.html.erb +++ b/app/views/thaalis/complete.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Completed Takhmeens in #{@year}" %> -<%# * Heading %> <% content_for :heading do %>

Completed Takhmeens in <%= @year %>

<% end %> diff --git a/app/views/thaalis/pending.html.erb b/app/views/thaalis/pending.html.erb index 7528791c..2c05c600 100644 --- a/app/views/thaalis/pending.html.erb +++ b/app/views/thaalis/pending.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Pending Takhmeens in #{@year}" %> -<%# * Heading %> <% content_for :heading do %>

Pending Takhmeens in <%= @year %>

<% end %> diff --git a/app/views/transactions/all.html.erb b/app/views/transactions/all.html.erb index 3aa8fb36..b5506578 100644 --- a/app/views/transactions/all.html.erb +++ b/app/views/transactions/all.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Transactions" %> -<%# * Heading %> <% content_for :heading do %>

Transactions

<% end %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index 4a38f3a3..a116943a 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Change Password" %> -<%# * Heading %> <% content_for :heading do %>

Change Password

<% end %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 53351f2f..883a74e8 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Users" %> -<%# * Heading %> <% content_for :heading do %>

Users

<% end %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 786ed529..5afcaf60 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -2,7 +2,6 @@ <% content_for :title, "New User" %> -<%# * Heading %> <% content_for :heading do %>

New User

<% end %> From 453950e2b291e574a6c16b2d2c972ce4d445bb40 Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Thu, 8 Feb 2024 18:33:00 +0530 Subject: [PATCH 28/29] fix erblint errors --- app/views/layouts/application.html.erb | 1 - app/views/statistics/sabeels.html.erb | 1 - app/views/statistics/thaalis.html.erb | 1 - 3 files changed, 3 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index db4b201c..8d7d6eb6 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -23,7 +23,6 @@
<% end %> -
"> <%= yield %>
diff --git a/app/views/statistics/sabeels.html.erb b/app/views/statistics/sabeels.html.erb index 9ca45962..4ea6688d 100644 --- a/app/views/statistics/sabeels.html.erb +++ b/app/views/statistics/sabeels.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Sabeel Statistics" %> - <% content_for :heading do %>

Sabeel Statistics

<% end %> diff --git a/app/views/statistics/thaalis.html.erb b/app/views/statistics/thaalis.html.erb index 6fde9463..1bef97ee 100644 --- a/app/views/statistics/thaalis.html.erb +++ b/app/views/statistics/thaalis.html.erb @@ -1,6 +1,5 @@ <% content_for :title, "Thaali Statistics" %> - <% content_for :heading do %>

Thaali Statistics

<% end %> From f5a45e2b6b335b2f461517d27acafdae97c54c6e Mon Sep 17 00:00:00 2001 From: Juzer Shakir Date: Thu, 8 Feb 2024 18:33:19 +0530 Subject: [PATCH 29/29] use `Time.zone.today` --- app/views/transactions/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/transactions/_form.html.erb b/app/views/transactions/_form.html.erb index 1dd1e944..dbea6aaa 100644 --- a/app/views/transactions/_form.html.erb +++ b/app/views/transactions/_form.html.erb @@ -4,7 +4,7 @@ <%= f.input :recipe_no %> <%= f.input :amount, hint: "Amount shouldn't be greater than: ₹#{total_balance}" %> <%= f.input :mode, collection: Transaction.modes.invert.to_a, as: :radio_buttons %> - <%= f.input :date, as: :date, order: %i[day month year], html5: true, input_html: { value: @transaction.date || Date.today } %> + <%= f.input :date, as: :date, order: %i[day month year], html5: true, input_html: {value: @transaction.date || Time.zone.today} %> <%= f.button :submit, action_name: %> <% end %>