-
Notifications
You must be signed in to change notification settings - Fork 0
News temp trending #60
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
Conversation
* changes * Apply automatic changes * Update app/Http/Controllers/ResourceEditsController.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…mputerScienceResources.com into news-temp-trending
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.
Pull request overview
This pull request refactors the news section to display trending resources instead of news posts. The changes repurpose existing UI components to show hot/trending resources based on vote scores rather than displaying news items.
Key Changes:
- Replaced
news_postsdata withhot_resourcesthroughout the frontend and backend - Updated UI text and icons from "Latest News" to "Trending Resources"
- Modified the backend service to fetch trending resources using the 'hot' sorting algorithm instead of NewsPost records
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/js/Pages/Resources/Index.vue | Updated prop from news_posts to hot_resources and passed it to NewsSection component |
| resources/js/Components/NewsItem.vue | Converted component to display resource data (name, image, description, upvotes) instead of news data |
| resources/js/Components/News/NewsSection.vue | Updated props and labels to handle hotResources and display "Trending Resources" instead of "Latest News" |
| resources/js/Components/News/NewsDialog.vue | Updated prop from newsItems to resourceItems for consistency |
| app/Services/ComputerScienceResourceService.php | Replaced NewsPost query with hot resources query using ResourceSortingManager, updated return data structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <script setup> | ||
| import { Link } from '@inertiajs/vue3'; | ||
|
|
||
| defineProps({ | ||
| news: { | ||
| resource: { | ||
| type: Object, | ||
| required: true, | ||
| }, | ||
| }); | ||
| </script> | ||
|
|
||
| <template> | ||
| <div class="my-4"> | ||
| <h3 class="font-bold mb-2 text-lg"> | ||
| {{ news.title }} | ||
| </h3> | ||
| <Link :href="route('resources.show', { slug: resource.slug }) || '#'" target="_blank" rel="noopener noreferrer"> | ||
| <div class="my-4 border hover:bg-gray-50 dark:hover:bg-gray-700 p-2 rounded-sm transition-colors cursor-pointer"> | ||
| <div class="flex items-center gap-2 text-xs text-gray-500 dark:text-gray-400 mb-1"> | ||
| <span v-if="resource.upvotes_count || resource.vote_score" class="flex items-center gap-1"> | ||
| <svg class="w-4 h-4 text-orange-500" fill="currentColor" viewBox="0 0 20 20"> | ||
| <path d="M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z" /> | ||
| </svg> | ||
| {{ resource.upvotes_count || resource.vote_score }} | ||
| </span> | ||
| </div> | ||
|
|
||
| <h3 class="font-bold mb-2 text-md dark:text-white line-clamp-2"> | ||
| {{ resource.name }} | ||
| </h3> | ||
|
|
||
| <img | ||
| v-if="resource.image_url " | ||
| :src="resource.image_url" | ||
| :alt="resource.name" | ||
| class="w-full h-32 object-cover rounded mb-2" | ||
| /> | ||
|
|
||
| <img | ||
| v-if="news.thumbnail_url" | ||
| :src="news.thumbnail_url" | ||
| :alt="news.title" | ||
| class="w-full h-48 object-cover rounded mb-2" | ||
| /> | ||
| <p class="text-sm text-gray-600 dark:text-gray-300 line-clamp-3 mb-2"> | ||
| {{ resource.excerpt || resource.description }} | ||
| </p> | ||
|
|
||
| <p class="text-sm text-gray-600"> | ||
| {{ news.excerpt }} | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </Link> | ||
| </template> |
Copilot
AI
Dec 30, 2025
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.
The component file is still named 'NewsItem.vue' but it now displays resource items instead of news items. Consider renaming this component to 'ResourceItem.vue' or 'TrendingResourceItem.vue' to better reflect its current purpose and improve code maintainability.
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.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@AllanKoder I've opened a new pull request, #61, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@AllanKoder I've opened a new pull request, #62, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@AllanKoder I've opened a new pull request, #63, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
* Initial plan * Rename NewsItem.vue to TrendingResourceItem.vue and update all references Co-authored-by: AllanKoder <74692833+AllanKoder@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: AllanKoder <74692833+AllanKoder@users.noreply.github.com>
No description provided.