-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Developed Projects listing page #105
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
58e9770
added projects listing page
judis007 d13b423
added ransack gem for searching
judis007 37f5434
Code improvements (#107)
akhilgkrishnan 47bcbe9
removed the pending specs
judis007 8423ddd
added en locale
judis007 e95d7b8
Merge branch 'develop' into project-list
judis007 168452e
changed the @q to @query in the index action
judis007 f7ad02b
added project request spec
judis007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
class ProjectsController < ApplicationController | ||
def index | ||
if params["query"] | ||
@projects = Project.where("name LIKE ?", "%#{params['query']}%") | ||
else | ||
@projects = Project.all | ||
judis007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<div class="" id="root-page"> | ||
<div class="max-w-6xl mx-auto px-2 md:px-11 font-manrope" x-data="{ 'isDialogOpen': false }" @keydown.escape="isDialogOpen = false"> | ||
<div class="px-5"> | ||
<div class=""> | ||
|
||
<div class="sm:flex sm:items-center sm:justify-between mt-6 mb-3"> | ||
<div class="flex-1 min-w-0"> | ||
<h2 class="text-3xl font-extrabold leading-7 text-gray-900 sm:text-4xl py-1"> | ||
Projects | ||
</h2> | ||
</div> | ||
<div class="mt-6 flex sm:mt-0 md:ml-4 items-center sm:w-4/6"> | ||
<div class="mt-1 relative rounded-md shadow-sm md:ml-10"> | ||
<%= form_with url: projects_path, method: :get do |form| %> | ||
<%= form.text_field :query, class: 'rounded tracking-wider appearance-none border border-gray-100 block w-72 sm:w-96 px-3 py-2 bg-miru-gray-100 h-8 shadow-sm font-semibold text-xs text-miru-dark-purple-1000 focus:outline-none focus:ring-miru-gray-1000 focus:border-miru-gray-1000 sm:text-sm', placeholder: 'Search' %> | ||
<%= image_submit_tag 'search_icon.svg', class: "h-3 text-miru-gray-400 absolute inset-y-2 right-0 pr-3 flex items-center cursor-pointer" %> | ||
<% end %> | ||
</div> | ||
</div> | ||
<div class="mt-6 flex sm:mt-0 md:ml-4"> | ||
<button @click="isDialogOpen = true" type="button" class="ml-2 tracking-widest inline-flex items-center h-10 w-full flex justify-center py-1 px-4 border-2 border-miru-han-purple-1000 shadow-sm bg-transparent hover:border-miru-han-purple-600 focus:outline-none rounded text-base font-sans font-medium text-miru-han-purple-1000 bg-transparent hover:text-miru-han-purple-600 cursor-pointer"> | ||
<img src="<%= image_url 'plus_icon.svg' %>" class="-ml-0.5 mr-2 h-4 w-4 "> | ||
NEW PROJECT | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<!-- team table --> | ||
<div class="flex flex-col"> | ||
<div class="-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8 "> | ||
<div class="py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8"> | ||
<div class="overflow-hidden border-b-2 border-miru-gray-200 "> | ||
<table class="min-w-full divide-y divide-gray-200 mt-4"> | ||
<thead class=""> | ||
<tr> | ||
<th scope="col" class="px-6 py-5 text-left text-sm font-semibold text-miru-dark-purple-600 tracking-wider"> | ||
PROJECT/CLIENT | ||
judis007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</th> | ||
<th scope="col" class="px-6 py-5 text-left text-sm font-semibold text-miru-dark-purple-600 tracking-wider"> | ||
HOURS LOGGED | ||
</th> | ||
<th scope="col" class="px-6 py-5 text-left text-sm font-semibold text-miru-dark-purple-600 tracking-wider"> | ||
|
||
</th> | ||
<th scope="col" class="relative px-6 py-5"> | ||
<span class="sr-only">Edit</span> | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody class="bg-white divide-y divide-gray-200"> | ||
<% @projects.each do |project| %> | ||
<tr> | ||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-miru-dark-purple-1000"> | ||
<%= project.name.capitalize %> | ||
</td> | ||
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-miru-dark-purple-1000"> | ||
<%= project.timesheet_entries.collect(&:duration).first %> | ||
</td> | ||
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium"> | ||
</td> | ||
</tr> | ||
<% end %> | ||
|
||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
judis007 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will be really nice if we could use Ransack gem for the search part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keshavbiswa, I have added the Ransack gem. Can you review it once again?