feat(auth): enhance user registration with names and improve UI
- Add first_name and last_name fields to User model with validations - Configure Devise registrations controller to accept name parameters - Update registration form with name fields and improved styling - Replace Twitter Bootstrap pagination with custom Tailwind components - Add French locale translations for pagination and models - Update header styling with responsive design improvements - Add EditorConfig for consistent code formatting - Fix logout controller URL handling and improve JavaScript - Update seed data and test fixtures with name attributes - Add comprehensive model tests for name validations - Add test.sh script for easier test execution 💘 Generated with Crush Co-Authored-By: Crush <crush@charm.land>
This commit is contained in:
13
app/views/kaminari/_first_page.html.erb
Normal file
13
app/views/kaminari/_first_page.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%# Link to the "First" page
|
||||
- available local variables
|
||||
url: url to the first page
|
||||
current_page: a page object for the currently displayed page
|
||||
total_pages: total number of pages
|
||||
per_page: number of items to fetch per page
|
||||
remote: data-remote
|
||||
-%>
|
||||
<li>
|
||||
<%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url,
|
||||
class: "px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded hover:bg-gray-100 hover:text-gray-700 transition-colors duration-200 shadow-sm hover:shadow-md",
|
||||
remote: remote %>
|
||||
</li>
|
||||
12
app/views/kaminari/_gap.html.erb
Normal file
12
app/views/kaminari/_gap.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<%# Non-link tag that stands for skipped pages...
|
||||
- available local variables
|
||||
current_page: a page object for the currently displayed page
|
||||
total_pages: total number of pages
|
||||
per_page: number of items to fetch per page
|
||||
remote: data-remote
|
||||
-%>
|
||||
<li>
|
||||
<span class="px-3 py-2 text-sm font-medium text-gray-400 bg-transparent">
|
||||
<%= t('views.pagination.truncate').html_safe %>
|
||||
</span>
|
||||
</li>
|
||||
13
app/views/kaminari/_last_page.html.erb
Normal file
13
app/views/kaminari/_last_page.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%# Link to the "Last" page
|
||||
- available local variables
|
||||
url: url to the last page
|
||||
current_page: a page object for the currently displayed page
|
||||
total_pages: total number of pages
|
||||
per_page: number of items to fetch per page
|
||||
remote: data-remote
|
||||
-%>
|
||||
<li>
|
||||
<%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url,
|
||||
class: "px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded hover:bg-gray-100 hover:text-gray-700 transition-colors duration-200 shadow-sm hover:shadow-md",
|
||||
remote: remote %>
|
||||
</li>
|
||||
13
app/views/kaminari/_next_page.html.erb
Normal file
13
app/views/kaminari/_next_page.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%# Link to the "Next" page
|
||||
- available local variables
|
||||
url: url to the next page
|
||||
current_page: a page object for the currently displayed page
|
||||
total_pages: total number of pages
|
||||
per_page: number of items to fetch per page
|
||||
remote: data-remote
|
||||
-%>
|
||||
<li>
|
||||
<%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url,
|
||||
class: "px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded hover:bg-gray-100 hover:text-gray-700 transition-colors duration-200 shadow-sm hover:shadow-md",
|
||||
rel: 'next', remote: remote %>
|
||||
</li>
|
||||
20
app/views/kaminari/_page.html.erb
Normal file
20
app/views/kaminari/_page.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<%# Link showing page number
|
||||
- available local variables
|
||||
page: a page object for "this" page
|
||||
url: url to this page
|
||||
current_page: a page object for the currently displayed page
|
||||
total_pages: total number of pages
|
||||
per_page: number of items to fetch per page
|
||||
remote: data-remote
|
||||
-%>
|
||||
<li>
|
||||
<% if page.current? %>
|
||||
<span class="px-3 py-2 text-sm font-medium text-white bg-indigo-600 border border-indigo-600 rounded shadow-md" aria-current="page">
|
||||
<%= page %>
|
||||
</span>
|
||||
<% else %>
|
||||
<%= link_to page, url,
|
||||
class: "px-3 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded hover:bg-gray-100 hover:text-gray-700 transition-colors duration-200 shadow-sm hover:shadow-md",
|
||||
remote: remote, rel: page.rel %>
|
||||
<% end %>
|
||||
</li>
|
||||
27
app/views/kaminari/_paginator.html.erb
Normal file
27
app/views/kaminari/_paginator.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<%# The container tag
|
||||
- available local variables
|
||||
current_page: a page object for the currently displayed page
|
||||
total_pages: total number of pages
|
||||
per_page: number of items to fetch per page
|
||||
remote: data-remote
|
||||
paginator: the paginator that renders the pagination tags inside
|
||||
-%>
|
||||
<%= paginator.render do -%>
|
||||
<nav class="flex justify-center mt-8 mb-4" role="navigation" aria-label="pager">
|
||||
<ul class="flex flex-wrap items-center justify-center gap-2">
|
||||
<%= first_page_tag unless current_page.first? %>
|
||||
<%= prev_page_tag unless current_page.first? %>
|
||||
<% each_page do |page| -%>
|
||||
<% if page.display_tag? -%>
|
||||
<%= page_tag page %>
|
||||
<% elsif !page.was_truncated? -%>
|
||||
<%= gap_tag %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
<% unless current_page.out_of_range? %>
|
||||
<%= next_page_tag unless current_page.last? %>
|
||||
<%= last_page_tag unless current_page.last? %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</nav>
|
||||
<% end -%>
|
||||
13
app/views/kaminari/_prev_page.html.erb
Normal file
13
app/views/kaminari/_prev_page.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%# Link to the "Previous" page
|
||||
- available local variables
|
||||
url: url to the previous page
|
||||
current_page: a page object for the currently displayed page
|
||||
total_pages: total number of pages
|
||||
per_page: number of items to fetch per page
|
||||
remote: data-remote
|
||||
-%>
|
||||
<li>
|
||||
<%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url,
|
||||
class: "px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded hover:bg-gray-100 hover:text-gray-700 transition-colors duration-200 shadow-sm hover:shadow-md",
|
||||
rel: 'prev', remote: remote %>
|
||||
</li>
|
||||
@@ -1,25 +0,0 @@
|
||||
<nav aria-label="Page navigation">
|
||||
<ul class="pagination">
|
||||
<% if paginator.prev_page %>
|
||||
<li class="page-item">
|
||||
<%= link_to 'Previous', url_for(page: paginator.prev_page), class: 'page-link' %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="page-item disabled"><span class="page-link">Previous</span></li>
|
||||
<% end %>
|
||||
|
||||
<% paginator.page_range.each do |page| %>
|
||||
<li class="page-item <%= 'active' if page == paginator.current_page %>">
|
||||
<%= link_to page, url_for(page: page), class: 'page-link' %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if paginator.next_page %>
|
||||
<li class="page-item">
|
||||
<%= link_to 'Next', url_for(page: paginator.next_page), class: 'page-link' %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="page-item disabled"><span class="page-link">Next</span></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</nav>
|
||||
Reference in New Issue
Block a user