From 6ac99dce13f8f913c78d9ad8c59cf80d195edc65 Mon Sep 17 00:00:00 2001 From: Liu-Yun-Syuan Date: Fri, 26 Jan 2024 04:06:17 +0800 Subject: [PATCH 01/19] fix user edit layout --- app/views/devise/registrations/edit.html.erb | 143 +++++-------------- config/locales/en.yml | 3 +- config/locales/tw.yml | 3 +- 3 files changed, 37 insertions(+), 112 deletions(-) diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 5462b7b5..367b8df0 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -1,123 +1,46 @@ -
+
+
+

<%= t('devise.edit_user_title') %>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> - <%= render "devise/shared/error_messages", resource: resource %> -
- -
- -
- <%= image_tag(resource.avatar_thumbnail) if resource.avatar.attached? %> -
- -
- -
- -
- -
- - <%= f.submit t('devise.update'), class: "block py-2.5 px-5 word-wrap text-sm text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200 cursor-pointer" %> -
-
- -
- -
- -
-
+
+
+
<%= f.label :name, t('devise.name') %> -
-
- <%= f.text_field :name, autocomplete: "name", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3' %> -
-
- - - -
-
<%= f.label :role, t('devise.role') %> -
-
- <%= f.text_field :role, autocomplete: "role", class: 'bg-gray-50 cursor-not-allowed border border-gray-300 text-gray-900 rounded-lg block p-2.5 mt-3', readonly: true %> -
-
- -
-
- <%= f.label :email, t('devise.email') %> -
-
- <%= f.text_field :email, autocomplete: "email", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3' %> -
-
- -
-
<%= f.label :birthday, t('devise.birthday') %> -
-
- <%= f.date_field :birthday, autocomplete: "birthday", class: 'w-[199px] bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3' %> -
-
- -
- -
- -
-
- <%= f.label :nick_name, t('devise.nick_name') %> -
-
- <%= f.text_field :nick_name, autocomplete: "nick_name", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3' %> -
+ <%= f.text_field :name, autocomplete: "name", class: 'block py-2.5 px-0 w-full text-sm text-gray-500 bg-transparent border-0 border-b-2 border-gray-200 appearance-none focus:outline-none focus:ring-0 focus:border-gray-200 peer' %> + <%= f.text_field :gender, autocomplete: "gender", class: 'block py-2.5 px-0 w-full text-sm text-gray-500 bg-transparent border-0 border-b-2 border-gray-200 appearance-none focus:outline-none focus:ring-0 focus:border-gray-200 peer' %> + <%= f.text_field :role, autocomplete: "role", class: 'block py-2.5 px-0 w-full text-sm text-gray-500 bg-transparent border-0 border-b-2 border-gray-200 appearance-none focus:outline-none focus:ring-0 focus:border-gray-200 peer', readonly: true %> + <%= f.date_field :birthday, autocomplete: "birthday", class: 'block py-2.5 px-0 w-full text-sm text-gray-500 bg-transparent border-0 border-b-2 border-gray-200 appearance-none focus:outline-none focus:ring-0 focus:border-gray-200 peer' %>
- -
-
- <%= f.label :phone, t('devise.phone') %> -
-
- <%= f.text_field :phone, autocomplete: "phone", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3' %> +
+
+ <%= f.label :nick_name, t('devise.nick_name'),class: 'flex-none' %> + <%= f.text_field :nick_name, autocomplete: "nick_name", class: 'bg-gray-50 w-full border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5' %>
-
- - -
-
- <%= f.label :time_zone, t('devise.time_zone') %> +
+ <%= f.label :phone, t('devise.phone'),class: 'flex-none' %> + <%= f.text_field :phone, autocomplete: "phone", class: 'bg-gray-50 flex-auto border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5' %>
-
- <%= f.text_field :time_zone, autocomplete: "time_zone", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3' %> +
+ <%= f.label :email, t('devise.email'),class: 'flex-none' %> + <%= f.text_field :email, autocomplete: "email", class: 'bg-gray-50 flex-auto border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5' %>
- -
-
- <%= f.label :lang, t('devise.lang') %> -
-
- <%= f.text_field :lang, autocomplete: "lang", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3' %> -
-
- - - + <%= render "devise/shared/error_messages", resource: resource %> +
+
+ <%= image_tag(resource.avatar_thumbnail) if resource.avatar.attached? %> +
+ +
+ <%= f.submit t('devise.update'), class: "w-full block py-2.5 px-5 w-full text-sm text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200 cursor-pointer" %>
- -
+
<% end %> +
diff --git a/config/locales/en.yml b/config/locales/en.yml index 2c6108ad..66c7e5d1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -203,7 +203,8 @@ en: not_found_in_database: 'This Account Is Not For This Company or Invalid Password' invalid: 'Invalid Password' registrations: - updated: 'Your account has been updated successfully.' + updated: "Your account has been updated successfully." + edit_user_title: 'Edit Profile' hrs: new_user: 'Add Employee' diff --git a/config/locales/tw.yml b/config/locales/tw.yml index 82e9a756..23532b84 100644 --- a/config/locales/tw.yml +++ b/config/locales/tw.yml @@ -203,7 +203,8 @@ tw: not_found_in_database: '此帳號不存在或密碼錯誤' invalid: '密碼錯誤' registrations: - updated: '更新成功' + updated: "更新成功" + edit_user_title: '設定個人資料' hrs: new_user: '新增員工' From 9a6794ddcd525516ae9c1605e340a3112bdf092e Mon Sep 17 00:00:00 2001 From: Liu-Yun-Syuan Date: Fri, 26 Jan 2024 04:25:27 +0800 Subject: [PATCH 02/19] fix user session new layout --- app/views/devise/sessions/new.html.erb | 40 ++++++++++---------------- config/locales/en.yml | 3 ++ config/locales/tw.yml | 3 ++ 3 files changed, 21 insertions(+), 25 deletions(-) diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index c72dd8e5..84fc0d54 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,29 +1,19 @@ -
-
- -
-
-

- <%= t('devise.user_sign_in') %> -

- <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> - -
- <%= f.label :email, t('devise.email'), class: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" %> - <%= f.email_field :email, placeholder: "YOUR_EMAIL", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500' %> -
-
- <%= f.label :password, t('devise.password'), class: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" %> - <%= f.password_field :password, placeholder: "••••••", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500' %> -
- -
- <%= f.submit t('devise.login'), class: "cursor-pointer w-full block py-2.5 px-5 word-wrap text-sm text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-200" %> -
- - <% end %> -
+
+
+

<%= t('devise.user_sign_in') %>

+ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> +
+ <%= f.label :email, t('devise.email'), class: "form-text" %> + <%= f.email_field :email, placeholder: t('devise.session_new.your_email'), class: 'form-input' %>
+
+ <%= f.label :password, t('devise.password'), class: "form-text" %> + <%= f.password_field :password, placeholder: t('devise.session_new.your_password'), class: 'form-input' %> +
+
+ <%= f.submit t('devise.login'), class: "w-full px-4 py-2 font-bold text-center text-white bg-blue-500 rounded-lg cursor-pointer hover:bg-blue-700" %> +
+ <% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 66c7e5d1..e93ed1f4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -205,6 +205,9 @@ en: registrations: updated: "Your account has been updated successfully." edit_user_title: 'Edit Profile' + session_new: + your_email: 'Your Email' + your_password: 'Your Password' hrs: new_user: 'Add Employee' diff --git a/config/locales/tw.yml b/config/locales/tw.yml index 23532b84..1f5f4021 100644 --- a/config/locales/tw.yml +++ b/config/locales/tw.yml @@ -205,6 +205,9 @@ tw: registrations: updated: "更新成功" edit_user_title: '設定個人資料' + session_new: + your_email: '輸入信箱' + your_password: '輸入密碼' hrs: new_user: '新增員工' From 13dece55a9b5a67668fc25812d2ab4df26164f5e Mon Sep 17 00:00:00 2001 From: Liu-Yun-Syuan Date: Fri, 26 Jan 2024 04:47:04 +0800 Subject: [PATCH 03/19] fix company new layout --- app/views/companies/new.html.erb | 60 +++++++++++++++----------------- config/locales/en.yml | 34 ++++++++++-------- config/locales/tw.yml | 34 ++++++++++-------- 3 files changed, 66 insertions(+), 62 deletions(-) diff --git a/app/views/companies/new.html.erb b/app/views/companies/new.html.erb index 8be694e1..dce77265 100644 --- a/app/views/companies/new.html.erb +++ b/app/views/companies/new.html.erb @@ -1,35 +1,31 @@ -
-
- -
-
-

- <%= t('company.company_sign_up') %> -

- <%= form_with model: @company, data: { turbo: false } do |form| %> -
- <%= form.label :name, t('company.name'), class: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" %> - - <%= form.text_field :name, class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500' %> -
-
- <%= form.label :email, t('company.email'), class: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" %> - <%= form.email_field :email, placeholder: "example@company.com", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500' %> -
-
- <%= form.label :password, t('company.password'), class: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" %> - <%= form.password_field :password, placeholder: "••••••", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500' %> -
-
- <%= form.label :password_confirmation, t('company.password_confirmation'), class: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" %> - <%= form.password_field :password_confirmation, placeholder: "••••••", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500' %> - -
-
- <%= form.submit class: "cursor-pointer w-full bg-gradient-to-b from-[#18376c] form-20% to-[#3779eaa3] hover:bg-blue-900 text-white font-medium rounded-lg text-sm px-5 py-2.5 text-center" %> -
- <% end %> -
+
+
+
+ +

<%= t('company.company_sign_up') %>

+
+ <%= form_with model: @company, data: { turbo: false } do |form| %> +
+
+ <%= form.label :name, t('company.name'), class: "form-text" %> + <%= form.text_field :name, placeholder: t('company.enter_name'), class: 'form-input' %> +
+
+ <%= form.label :email, t('company.email'), class: "form-text" %> + <%= form.email_field :email, placeholder: t('company.enter_email'), class: 'form-input' %> +
+
+ <%= form.label :password, t('company.password'), class: "form-text" %> + <%= form.password_field :password, placeholder: t('company.enter_password'), class: 'form-input' %> +
+
+ <%= form.label :password_confirmation, t('company.password_confirmation'), class: "form-text" %> + <%= form.password_field :password_confirmation, placeholder: t('company.enter_password_confirmation'), class: 'form-input' %> +
+
+ <%= form.submit class: "w-full px-4 py-2 font-bold text-center text-white bg-blue-500 rounded-lg cursor-pointer hover:bg-blue-700" %> +
+ <% end %>
\ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index e93ed1f4..9fd7cf31 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -160,21 +160,25 @@ en: deleted: 'Event has been deleted' company: - creation_success: 'Successfully Registered the Company' - creation_failed: 'Creation Failed' - name: 'Name' - email: 'Email' - password: 'Password' - password_confirmation: 'Password_confirmation' - company_sign_up: 'Company Sign Up' - not_registered: 'Not Registered' - please: 'Please ' - company_sign_in: 'Company Sign In' - create_account: 'Create Account' - login: 'Login' - login_success: 'Login Success' - login_failed: 'Login Failed' - logout_success: 'Logout Success' + creation_success: "Successfully Registered the Company" + creation_failed: "Creation Failed" + name: "Name" + email: "Email" + password: "Password" + password_confirmation: "Password_confirmation" + company_sign_up: "Company Sign Up" + not_registered: "Not Registered" + please: "Please " + company_sign_in: "Company Sign In" + create_account: "Create Account" + login: "Login" + login_success: "Login Success" + login_failed: "Login Failed" + logout_success: "Logout Success" + enter_name: 'Enter Your Company name' + enter_email: 'Enter Your Email' + enter_password: 'Enter Your Password' + enter_password_confirmation: 'Enter The Same Password' devise: name: 'Name' diff --git a/config/locales/tw.yml b/config/locales/tw.yml index 1f5f4021..533384fb 100644 --- a/config/locales/tw.yml +++ b/config/locales/tw.yml @@ -160,21 +160,25 @@ tw: deleted: '活動已刪除' company: - creation_success: '公司創建成功' - creation_failed: '公司創建失敗' - name: '公司名稱' - email: '信箱' - password: '密碼' - password_confirmation: '密碼確認' - company_sign_up: '公司註冊' - not_registered: '尚未註冊' - please: '請先' - company_sign_in: '公司登入' - create_account: '建立帳戶' - login: '登入' - login_success: '登入成功' - login_failed: '登入失敗' - logout_success: '已登出' + creation_success: "公司創建成功" + creation_failed: "公司創建失敗" + name: "公司名稱" + email: "信箱" + password: "密碼" + password_confirmation: "密碼確認" + company_sign_up: "公司註冊" + not_registered: "尚未註冊" + please: "請先" + company_sign_in: "公司登入" + create_account: "建立帳戶" + login: "登入" + login_success: "登入成功" + login_failed: "登入失敗" + logout_success: "已登出" + enter_name: "輸入公司名稱" + enter_email: '輸入信箱' + enter_password: '輸入密碼' + enter_password_confirmation: '輸入確認密碼' devise: name: '名字' From 307b9029dcde326e1b4c0447e7a588b01a2f1926 Mon Sep 17 00:00:00 2001 From: Liu-Yun-Syuan Date: Fri, 26 Jan 2024 05:00:21 +0800 Subject: [PATCH 04/19] fix company sign_in layout --- app/views/companies/sign_in.html.erb | 48 ++++++++++++---------------- config/locales/en.yml | 2 ++ config/locales/tw.yml | 2 ++ 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/app/views/companies/sign_in.html.erb b/app/views/companies/sign_in.html.erb index df35409d..597fa324 100644 --- a/app/views/companies/sign_in.html.erb +++ b/app/views/companies/sign_in.html.erb @@ -1,31 +1,25 @@ -
-
- -
-
-

- <%= t('company.company_sign_in') %> -

- <%= form_with(url: sessions_path, scope: 'company', data: {turbo: false}) do |form| %> - -
- <%= form.label :email, t('company.email'), class: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" %> - <%= form.email_field :email, placeholder: "example@company.com", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500' %> -
-
- <%= form.label :password, t('company.password'), class: "block mb-2 text-sm font-medium text-gray-900 dark:text-white" %> - <%= form.password_field :password, placeholder: "••••••", class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500' %> -
- -
- <%= form.submit t('company.login'), class: "cursor-pointer w-full bg-gradient-to-b from-[#18376c] form-20% to-[#3779eaa3] hover:bg-blue-900 text-white font-medium rounded-lg text-sm px-5 py-2.5 text-center" %> -
-
- <%= t('company.not_registered') %>? <%= t('company.please') %><%= link_to t('company.create_account'), new_company_path, class: "text-blue-600 hover:font-bold active:bg-blue-300 focus:outline-none focus:ring" %> -
- <% end %> -
+
+
+
+ +

<%= t('company.company_sign_in') %>

+
+ <%= form_with(url: sessions_path, scope: 'company', data: {turbo: false}) do |form| %> +
+
+ <%= form.label :email, t('company.email'), class: "form-text" %> + <%= form.email_field :email, placeholder: t('company.your_email'), class: 'form-input' %> +
+
+ <%= form.label :password, t('company.password'), class: "form-text" %> + <%= form.password_field :password, placeholder: t('company.your_password'), class: 'form-input' %> +
+ <%= form.submit t('company.login'), class: "w-full my-4 px-4 py-2 font-bold text-center text-white bg-blue-500 rounded-lg cursor-pointer hover:bg-blue-700" %> +
+ <%= t('company.not_registered') %>? <%= t('company.please') %><%= link_to t('company.create_account'), new_company_path, class: "text-blue-600 hover:font-bold active:bg-blue-300 focus:outline-none focus:ring" %> +
+ <% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index 9fd7cf31..4606f858 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -179,6 +179,8 @@ en: enter_email: 'Enter Your Email' enter_password: 'Enter Your Password' enter_password_confirmation: 'Enter The Same Password' + your_email: 'Your Email' + your_password: 'Your Password' devise: name: 'Name' diff --git a/config/locales/tw.yml b/config/locales/tw.yml index 533384fb..e71e4b2c 100644 --- a/config/locales/tw.yml +++ b/config/locales/tw.yml @@ -179,6 +179,8 @@ tw: enter_email: '輸入信箱' enter_password: '輸入密碼' enter_password_confirmation: '輸入確認密碼' + your_email: '輸入信箱' + your_password: '輸入密碼' devise: name: '名字' From bf6d655e6c9786d7f559ed50a51c2fd9d5bb77ae Mon Sep 17 00:00:00 2001 From: Liu-Yun-Syuan Date: Fri, 26 Jan 2024 06:28:21 +0800 Subject: [PATCH 05/19] WIP: fix hrs index layout whitout destroy, update & new --- app/views/hrs/index.html.erb | 163 +++++++++++++---------------------- config/locales/en.yml | 42 ++++----- config/locales/tw.yml | 42 ++++----- 3 files changed, 101 insertions(+), 146 deletions(-) diff --git a/app/views/hrs/index.html.erb b/app/views/hrs/index.html.erb index 6101bb4b..ed50d266 100644 --- a/app/views/hrs/index.html.erb +++ b/app/views/hrs/index.html.erb @@ -1,111 +1,66 @@ -
- - -
-
-
-
- -
- +
+ <%= f.label :password, class: 'form-text mt-2' %> + <%= f.password_field :password_confirmation, placeholder: t('hrs.password_confirmation_placeholder'), class: 'form-input' %> + <%= f.label :password, class: 'form-text mt-2' %> + <%= f.password_field :password_confirmation, placeholder: t('hrs.password_confirmation_placeholder'), class: 'form-input' %> +
+
+ <%= f.label t('hrs.role'), class: "form-text mt-2" %> + <%= f.select :role, User.roles.keys.map { |w| [w.humanize, w]}, {}, { class: 'form-input' } %> + <%= f.submit t('hrs.new_user'), class: " mt-4 sm:absolute sm:bottom-0 w-full px-4 py-2 font-bold text-center text-white bg-blue-500 rounded-lg cursor-pointer hover:bg-blue-700" %>
-
-
- - - - - - + <% end %> + + +
+
<%= t('hrs.user_lists') %>
+ + + + + + + + + + + + <% @users.each do |user| %> + <%= form_for(user, url: hr_path(user), remote: true, method: :patch) do |f| %> +
- - - - - - + + + + + +
+
+ - <% @users.each do |user| %> - <%= form_for(user, url: hr_path(user), remote: true, method: :patch) do |f| %> -
-
- - - - - -
-
- - - - <% end %> - <% end %> -
<%= t('hrs.user_lists') %>
<%= t('hrs.name') %><%= t('hrs.email') %><%= t('hrs.role') %><%= t('hrs.update_column') %><%= t('hrs.delete_column') %>
<%= t('hrs.name') %><%= t('hrs.email') %><%= t('hrs.role') %><%= t('hrs.update_column') %><%= t('hrs.delete_column') %><%= f.text_field :name, class: 'bg-gray-50 border border-gray-300 w-full text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3 mx-1' %><%= f.text_field :email, class: 'bg-gray-50 border border-gray-300 w-full text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3 mx-1' %><%= f.select(:role, User.roles.keys.map { |w| [w.humanize, w]}, {}, { class: 'bg-gray-50 border border-gray-300 w-full text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3 mx-1' }) %><%= f.submit t('hrs.update'), class: "bg-blue-500 hover:bg-blue-700 text-white font-bold rounded px-4 py-2.5 mt-3 mx-1" %><%= link_to t('hrs.delete'), hr_path(user), class: "bg-red-500 hover:bg-red-700 text-white font-bold rounded inline-block mt-3 mx-1 py-2.5 px-4", data: {turbo_method: 'delete', turbo_confirm: t('hrs.delete_confirm') } %>
<%= f.text_field :name, class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3 mx-1' %><%= f.text_field :email, class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3 mx-1' %><%= f.select(:role, User.roles.keys.map { |w| [w.humanize, w]}, {}, { class: 'bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3 mx-1' }) %><%= f.submit t('hrs.update'), class: "bg-blue-500 hover:bg-blue-700 text-white font-bold rounded px-4 py-2.5 mt-3 mx-1" %><%= link_to t('hrs.delete'), hr_path(user), class: "bg-red-500 hover:bg-red-700 text-white font-bold rounded inline-block mt-3 mx-1 py-2.5 px-4", data: {turbo_method: 'delete', turbo_confirm: t('hrs.delete_confirm') } %>
-
-
-
-
+
+ <% end %> + <% end %> + +
diff --git a/config/locales/en.yml b/config/locales/en.yml index 4606f858..7d48c90b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -216,27 +216,27 @@ en: your_password: 'Your Password' hrs: - new_user: 'Add Employee' - new_users: 'Add Employees' - new_user_toggle: '✚' - role: 'Job Title' - name: 'Name' - email: 'Email' - name_placeholder: 'Name' - email_placeholder: 'Email Address' - password_placeholder: 'Password' - password_confirmation_placeholder: 'Confirm Password' - user_lists: 'User Lists' - update_column: 'Update' - delete_column: 'Delete' - update: '✎' - delete: 'X' - creation_success: 'Successfully Registered the Staff' - creation_failed: 'Creation Failed' - update_success: 'Staff File Renew' - update_failed: 'Update Failed' - delete_staff: 'Delete Staff' - delete_confirm: 'Are You Sure You Want To Delete?' + new_user: "Add A Employee" + new_users: "Add Employees" + new_user_toggle: "✚" + role: "Job Title" + name: "Name" + email: "Email" + name_placeholder: "Name" + email_placeholder: "Email Address" + password_placeholder: "Password" + password_confirmation_placeholder: "Confirm Password" + user_lists: "User Lists" + update_column: "Update" + delete_column: "Delete" + update: "✎" + delete: "X" + creation_success: "Successfully Registered the Staff" + creation_failed: "Creation Failed" + update_success: "Staff File Renew" + update_failed: "Update Failed" + delete_staff: "Delete Staff" + delete_confirm: "Are You Sure You Want To Delete?" import: import_employee: 'Import Employees' diff --git a/config/locales/tw.yml b/config/locales/tw.yml index e71e4b2c..0dc65ac2 100644 --- a/config/locales/tw.yml +++ b/config/locales/tw.yml @@ -216,27 +216,27 @@ tw: your_password: '輸入密碼' hrs: - new_user: '新增員工' - new_users: '新增多名員工' - new_user_toggle: '✚' - role: '職稱' - name: '名字' - email: '信箱' - name_placeholder: '輸入名字' - email_placeholder: '輸入員工信箱' - password_placeholder: '輸入密碼' - password_confirmation_placeholder: '確認密碼' - user_lists: '員工列表' - update_column: '更新' - delete_column: '刪除' - update: '✎' - delete: 'X' - creation_success: '員工新增成功' - creation_failed: '無法新增員工' - update_success: '員工資料更新' - update_failed: '員工更新失敗' - delete_staff: '刪除離職員工' - delete_confirm: '確認刪除?' + new_user: "新增一名員工" + new_users: "新增多名員工" + new_user_toggle: "✚" + role: "職稱" + name: "名字" + email: "信箱" + name_placeholder: "輸入名字" + email_placeholder: "輸入員工信箱" + password_placeholder: "輸入密碼" + password_confirmation_placeholder: "確認密碼" + user_lists: "員工列表" + update_column: "更新" + delete_column: "刪除" + update: "✎" + delete: "X" + creation_success: "員工新增成功" + creation_failed: "無法新增員工" + update_success: "員工資料更新" + update_failed: "員工更新失敗" + delete_staff: "刪除離職員工" + delete_confirm: "確認刪除?" import: import_employee: '匯入多名員工' From b140b699a1193ac58fa24ae727580e48e464ae5e Mon Sep 17 00:00:00 2001 From: Liu-Yun-Syuan Date: Fri, 26 Jan 2024 07:19:30 +0800 Subject: [PATCH 06/19] fix hrs index layout without turbo_stream --- app/javascript/lib/fontawesome.js | 4 +++- app/views/hrs/index.html.erb | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/javascript/lib/fontawesome.js b/app/javascript/lib/fontawesome.js index 8c807ee2..8bd2f400 100644 --- a/app/javascript/lib/fontawesome.js +++ b/app/javascript/lib/fontawesome.js @@ -17,7 +17,6 @@ import { faPenToSquare as faPenToSquareRegular } from '@fortawesome/free-regular import { faCircleChevronLeft } from '@fortawesome/free-solid-svg-icons/faCircleChevronLeft' import { faCrown } from '@fortawesome/free-solid-svg-icons/faCrown' import { faAlignJustify } from '@fortawesome/free-solid-svg-icons/faAlignJustify' -import { faHourglassStart } from '@fortawesome/free-solid-svg-icons/faHourglassStart' import { faMessage } from '@fortawesome/free-solid-svg-icons/faMessage' import { faLock } from '@fortawesome/free-solid-svg-icons/faLock' import { faSquarePlus } from '@fortawesome/free-solid-svg-icons/faSquarePlus' @@ -26,6 +25,8 @@ import { faBackward } from '@fortawesome/free-solid-svg-icons/faBackward' import { faCommentDots } from '@fortawesome/free-regular-svg-icons/faCommentDots' import { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark' import { faArrowRightToBracket } from '@fortawesome/free-solid-svg-icons/faArrowRightToBracket' +import { faHourglassStart } from '@fortawesome/free-solid-svg-icons/faHourglassStart' +import { faFileImport } from '@fortawesome/free-solid-svg-icons/faFileImport' library.add({ faEllipsis, @@ -55,6 +56,7 @@ library.add({ faCommentDots, faXmark, faArrowRightToBracket, + faFileImport, }) dom.watch() diff --git a/app/views/hrs/index.html.erb b/app/views/hrs/index.html.erb index ed50d266..e75d48d2 100644 --- a/app/views/hrs/index.html.erb +++ b/app/views/hrs/index.html.erb @@ -1,8 +1,9 @@
-
+
+

<%= t('hrs.new_users') %>

- <%= link_to t('import.import_employee'), users_import_path, class:"text-center rounded-md bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 inline-block shadow-md m-3" if current_company.paid%> + <%= link_to t('import.import_employee'), users_import_path, class:"text-center rounded-md bg-gray-700 hover:bg-gray-900 text-white font-bold py-2 px-4 inline-block ml-6" if current_company.paid%>
<%= form_with(model: @user, url: hrs_path, method: :post) do |f| %> @@ -16,11 +17,10 @@ <%= f.label :email, class: 'form-text mt-2' %> <%= f.email_field :email, placeholder: t('hrs.email_placeholder'), class: 'form-input' %>
-
- <%= f.label :password, class: 'form-text mt-2' %> - <%= f.password_field :password_confirmation, placeholder: t('hrs.password_confirmation_placeholder'), class: 'form-input' %> +
<%= f.label :password, class: 'form-text mt-2' %> - <%= f.password_field :password_confirmation, placeholder: t('hrs.password_confirmation_placeholder'), class: 'form-input' %> + <%= f.password_field :password, placeholder: t('hrs.password_confirmation_placeholder'), class: 'form-input' %> + <%= f.password_field :password_confirmation, placeholder: t('hrs.password_confirmation_placeholder'), class: 'form-input mt-4 sm:absolute sm:bottom-0' %>
<%= f.label t('hrs.role'), class: "form-text mt-2" %> @@ -52,9 +52,11 @@ <%= f.text_field :name, class: 'bg-gray-50 border border-gray-300 w-full text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3 mx-1' %> <%= f.text_field :email, class: 'bg-gray-50 border border-gray-300 w-full text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3 mx-1' %> <%= f.select(:role, User.roles.keys.map { |w| [w.humanize, w]}, {}, { class: 'bg-gray-50 border border-gray-300 w-full text-gray-900 rounded-lg focus:ring-primary-600 focus:border-primary-600 block p-2.5 mt-3 mx-1' }) %> - <%= f.submit t('hrs.update'), class: "bg-blue-500 hover:bg-blue-700 text-white font-bold rounded px-4 py-2.5 mt-3 mx-1" %> + + <%= f.submit t('hrs.update'), class: "bg-blue-500 hover:bg-blue-700 text-white font-bold rounded px-3 py-1.5 mt-3 mx-1 text-2xl rotate-90" %> +
- <%= link_to t('hrs.delete'), hr_path(user), class: "bg-red-500 hover:bg-red-700 text-white font-bold rounded inline-block mt-3 mx-1 py-2.5 px-4", data: {turbo_method: 'delete', turbo_confirm: t('hrs.delete_confirm') } %> + <%= link_to t('hrs.delete'), hr_path(user), class: "bg-white hover:bg-red-200 hover:border-red-400 text-gray-400 border hover:text-red-600 font-bold rounded inline-block mt-3 mx-1 py-2.5 px-4", data: {turbo_method: 'delete', turbo_confirm: t('hrs.delete_confirm') } %>
From 25fa84e9cb6cf1bf35e97493a7b0c6f95665ad84 Mon Sep 17 00:00:00 2001 From: Liu-Yun-Syuan Date: Fri, 26 Jan 2024 15:50:28 +0800 Subject: [PATCH 07/19] remove dark style --- .../stylesheets/application.tailwind.css | 10 +-- app/views/events/_form.html.erb | 2 +- app/views/layouts/_app_navbar.html.erb | 12 ++-- app/views/layouts/_main_navbar.html.erb | 16 ++--- app/views/layouts/_photo_dropdown.html.erb | 70 ++++++++++--------- app/views/lists/edit.html.erb | 6 +- app/views/lists/new.html.erb | 8 +-- app/views/main/_signup_company.html.erb | 18 ++--- app/views/messages/_new_message_form.html.erb | 4 +- app/views/projects/_drawer.html.erb | 2 +- app/views/projects/edit.html.erb | 10 +-- app/views/projects/new.html.erb | 10 +-- app/views/projects/new_task.html.erb | 2 +- app/views/shared/_alert.html.erb | 6 +- app/views/shared/_info.html.erb | 4 +- app/views/shared/_mail.html.erb | 4 +- app/views/shared/_modal.html.erb | 8 +-- app/views/shared/_notice.html.erb | 6 +- app/views/shared/_success.html.erb | 6 +- app/views/shared/_turbomodal.html.erb | 6 +- app/views/tasks/edit.html.erb | 8 +-- app/views/tasks/new.html.erb | 6 +- 22 files changed, 113 insertions(+), 111 deletions(-) diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index 1b1506dc..88dcf011 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -23,10 +23,10 @@ html { } .form-text { - @apply block mb-2 text-sm font-medium text-gray-900 dark:text-white; + @apply block mb-2 text-sm font-medium text-white text-gray-900; } .form-input { - @apply bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500; + @apply bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5; } .form-toggle-layer-1 { @@ -34,15 +34,15 @@ html { } .form-toggle-layer-3 { - @apply text-sm font-medium text-gray-900 ms-3 dark:text-gray-300; + @apply text-sm font-medium text-gray-900 ms-3; } .form-btn { - @apply inline-flex items-center px-5 py-2.5 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800; + @apply inline-flex items-center px-5 py-2.5 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300; } .form-d-btn { - @apply block py-2.5 px-5 text-white text-sm font-medium focus:outline-none bg-gray-600 rounded-lg border border-gray-200 hover:bg-gray-900 focus:z-10 focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700; + @apply block py-2.5 px-5 text-white text-sm font-medium focus:outline-none bg-gray-600 rounded-lg border border-gray-200 hover:bg-gray-900 focus:z-10 focus:ring-4 focus:ring-gray-200; } .msg-form { diff --git a/app/views/events/_form.html.erb b/app/views/events/_form.html.erb index 65bcd783..3fe70561 100644 --- a/app/views/events/_form.html.erb +++ b/app/views/events/_form.html.erb @@ -26,7 +26,7 @@
<%= form.label :all_day_event, class: 'form-toggle-layer-1' do %> <%= form.check_box :all_day_event, class: "sr-only peer", checked: event.all_day_event, data:{ datepicker_target:"allDay", action:"click->datepicker#clickedAllDay"} %> -
+
<%=t('calender.all_day_event')%> <% end %>
diff --git a/app/views/layouts/_app_navbar.html.erb b/app/views/layouts/_app_navbar.html.erb index 77e9fc42..a9c8a36b 100644 --- a/app/views/layouts/_app_navbar.html.erb +++ b/app/views/layouts/_app_navbar.html.erb @@ -1,20 +1,20 @@ -