Skip to content

Commit

Permalink
update repository link
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitpaulk committed May 13, 2024
1 parent ee49ebc commit 8ef54db
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/components/course-page/repository-dropdown-action.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
>
{{yield}}

{{svg-jar @icon class=(concat "w-5 ml-4 text-gray-300 " (if @isDisabled "" "group-hover:text-teal-500"))}}
{{svg-jar @icon class=(concat "w-5 ml-8 text-gray-300 " (if @isDisabled "" "group-hover:text-teal-500"))}}
</div>
22 changes: 9 additions & 13 deletions app/components/course-page/repository-dropdown.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</button>
</dd.Trigger>
<dd.Content>
<div class="bg-white rounded-lg shadow-lg border py-2 my-1" data-test-repository-dropdown-content>
<div class="bg-white rounded-lg shadow-lg border py-2 my-1 max-h-[75vh] overflow-y-auto" data-test-repository-dropdown-content>
<div class="text-sm text-gray-700">
<div
class="px-3 py-2 hover:bg-gray-50 flex group {{if @activeRepository.isNew 'text-gray-300'}}"
Expand Down Expand Up @@ -84,19 +84,15 @@
{{/unless}}
</div>
{{#if (gt this.nonActiveRepositories.length 0)}}
<div class="pl-3 text-sm">
<div class="font-bold text-gray-600 mb-2 mt-3">
Switch to a different repo:
</div>
<div class="">
{{#each this.nonActiveRepositories as |repository|}}
<CoursePage::RepositoryDropdown::NonActiveRepositoryLink
@repository={{repository}}
{{on "click" (fn this.handleRepositoryLinkClick repository dd.actions)}}
/>
{{/each}}
</div>
<div class="font-bold text-gray-600 mb-2 mt-3 pl-3 text-sm">
Switch to a different repo:
</div>
{{#each this.nonActiveRepositories as |repository|}}
<CoursePage::RepositoryDropdown::NonActiveRepositoryLink
@repository={{repository}}
{{on "click" (fn this.handleRepositoryLinkClick repository dd.actions)}}
/>
{{/each}}
{{/if}}
</div>
</dd.Content>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
<div
class="flex justify-between items-center py-2 pl-2 pr-3 hover:bg-gray-50 group cursor-pointer"
role="button"
data-test-repository-link
...attributes
>
<div class="flex items-center mr-6">
<img src={{@repository.language.grayLogoUrl}} alt={{@repository.language.name}} class="w-4 h-4 mr-2 block group-hover:hidden" />
<img src={{@repository.language.tealLogoUrl}} alt={{@repository.language.name}} class="w-4 h-4 mr-2 hidden group-hover:block" />
<span class="text-gray-700">{{@repository.name}}</span>
<div class="flex justify-between items-center py-2 px-3 hover:bg-gray-50 group cursor-pointer" role="button" data-test-repository-link ...attributes>
<div>
<div class="flex items-center">
<span class="text-gray-700 text-sm">{{@repository.name}}</span>

<div class="text-gray-400 text-xs ml-1">
{{#if @repository.lastSubmissionAt}}
(pushed
{{date-from-now @repository.lastSubmissionAt}})
{{else}}
(not pushed yet)
{{/if}}
</div>
</div>

<div class="text-gray-400 text-xs mt-1">
{{@repository.completedStages.length}}
/
{{@repository.course.stages.length}}
stages
</div>
</div>

{{#if @repository.lastSubmissionAt}}
<span class="text-gray-400 text-xs">(pushed {{date-from-now @repository.lastSubmissionAt}})</span>
{{/if}}
<div class="text-gray-400 text-xs ml-6">
<img src={{@repository.language.grayLogoUrl}} alt={{@repository.language.name}} class="w-6 h-6 block group-hover:hidden flex-shrink-0" />
<img src={{@repository.language.tealLogoUrl}} alt={{@repository.language.name}} class="w-6 h-6 hidden group-hover:block flex-shrink-0" />
</div>
</div>

0 comments on commit 8ef54db

Please sign in to comment.