-
Notifications
You must be signed in to change notification settings - Fork 437
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
Refactor package partial links (_side_links) #5854
Merged
vpereira
merged 7 commits into
openSUSE:master
from
vpereira:refactor_package_partial_links
Sep 14, 2018
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0da8feb
Add show_failures partial
vpereira 2e6d8cf
Add show_devel_package partial
vpereira 68e1a7c
Add show_inherited_from_project partial
vpereira 37a1006
Add show_developed_packages partial
vpereira b6b9634
Add show_patchinfo partial
vpereira ce943d0
Add show_derived_packages partial
vpereira bd6f525
Add show_linkinfo partial
vpereira 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
4 changes: 4 additions & 0 deletions
4
src/api/app/views/webui2/webui/package/_show_derived_packages.html.haml
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,4 @@ | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
= package.linking_packages.size | ||
= link_to('derived packages', linking_packages_path(project: project, package: package), remote: true) |
4 changes: 4 additions & 0 deletions
4
src/api/app/views/webui2/webui/package/_show_devel_package.html.haml
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,4 @@ | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
Developed at | ||
= link_to(elide(devel_package.project.name, 44), package_show_path(project: devel_package.project.name, package: devel_package.name)) |
6 changes: 6 additions & 0 deletions
6
src/api/app/views/webui2/webui/package/_show_developed_packages.html.haml
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,6 @@ | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
Devel package for | ||
- developed_packages.each_with_index do |pkg, index| | ||
= ',' if index > 0 | ||
= link_to(elide(pkg.project.name, 40), package_show_path(project: pkg.project.name, package: pkg.name)) |
6 changes: 6 additions & 0 deletions
6
src/api/app/views/webui2/webui/package/_show_failures.html.haml
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,6 @@ | ||
%li | ||
%i.fas.fa-times-circle.text-danger{ title: 'Errors' } | ||
= failures | ||
= link_to "error#{failures == 1 ? '' : 's'}", project_monitor_path(project: project, pkgname: package_name, succeeded: 0, | ||
blocked: 0, finished: 0, signing: 0, dispatching: 0, | ||
scheduled: 0, building: 0) |
4 changes: 4 additions & 0 deletions
4
src/api/app/views/webui2/webui/package/_show_inherited_from_project.html.haml
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,4 @@ | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
Sources inherited from project | ||
= link_to(elide(project_name, 40), package_show_path(project: project_name, package: package_name)) |
23 changes: 23 additions & 0 deletions
23
src/api/app/views/webui2/webui/package/_show_linkinfo.html.haml
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,23 @@ | ||
- linked_package = linkinfo[:package] | ||
%li | ||
%i.fas.fa-link.text-dark | ||
Links to | ||
- if linkinfo[:remote_project] | ||
remote | ||
%i | ||
= linkinfo[:remote_project] | ||
\/ | ||
= linked_package | ||
- else | ||
= project_or_package_link(project: linked_package.project.name, package: linked_package.name, short: true) | ||
- if linkinfo[:error] | ||
%li | ||
%i.fas.fa-times-circle.text-danger | ||
Link has errors: | ||
%i= linkinfo[:error] | ||
- elsif linkinfo[:diff] | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
Has a | ||
= link_to('link diff', package_rdiff_path(oproject: linked_package.project.name, opackage: linked_package.name, | ||
project: project, package: package, rev: revision)) |
6 changes: 6 additions & 0 deletions
6
src/api/app/views/webui2/webui/package/_show_patchinfo.html.haml
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,6 @@ | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
Has a | ||
= link_to 'patchinfo', patchinfo_show_path(package: package, project: project) | ||
for | ||
= link_to 'maintenance updates', 'http://en.opensuse.org/Portal:Maintenance' |
66 changes: 12 additions & 54 deletions
66
src/api/app/views/webui2/webui/package/_side_links.html.haml
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 |
---|---|---|
@@ -1,66 +1,24 @@ | ||
-# FIXME: refactor this file | ||
%ul.list-unstyled | ||
- if failures > 0 | ||
%li | ||
%i.fas.fa-times-circle.text-danger{ title: 'Errors' } | ||
= failures | ||
= link_to "error#{failures == 1 ? '' : 's'}", project_monitor_path(project: project, pkgname: package.name, succeeded: 0, | ||
blocked: 0, finished: 0, signing: 0, dispatching: 0, | ||
scheduled: 0, building: 0) | ||
= render partial: 'show_failures', locals: { failures: failures, package_name: package.name, project: project } | ||
|
||
- if devel_package | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
Developed at | ||
= link_to(elide(devel_package.project.name, 44), package_show_path(project: devel_package.project.name, package: devel_package.name)) | ||
= render partial: 'show_devel_package', locals: { devel_package: devel_package } | ||
|
||
- if package.project != project | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
Sources inherited from project | ||
= link_to(elide(package.project.name, 40), package_show_path(project: package.project.name, package: package.name)) | ||
= render partial: 'show_inherited_from_project', locals: { project_name: package.project.name, package_name: package.name } | ||
|
||
- if package.developed_packages.present? | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
Devel package for | ||
- package.developed_packages.each_with_index do |pkg, index| | ||
= ',' if index > 0 | ||
= link_to(elide(pkg.project.name, 40), package_show_path(project: pkg.project.name, package: pkg.name)) | ||
= render partial: 'show_developed_packages', locals: { developed_packages: package.developed_packages } | ||
|
||
- if package.is_patchinfo? | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
Has a | ||
= link_to 'patchinfo', patchinfo_show_path(package: package, project: project) | ||
for | ||
= link_to 'maintenance updates', 'http://en.opensuse.org/Portal:Maintenance' | ||
//TODO: Fix this hard link | ||
= render partial: 'show_patchinfo', locals: { package: package, project: project } | ||
|
||
- if package.linking_packages.present? | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
= package.linking_packages.size | ||
= link_to('derived packages', linking_packages_path(project: project, package: package), remote: true) | ||
= render partial: 'show_derived_packages', locals: { package: package, project: project } | ||
|
||
- if linkinfo | ||
- linked_package = linkinfo[:package] | ||
%li | ||
%i.fas.fa-link.text-dark | ||
Links to | ||
- if linkinfo[:remote_project] | ||
remote | ||
%i | ||
= linkinfo[:remote_project] | ||
\/ | ||
= linked_package | ||
- else | ||
= project_or_package_link(project: linked_package.project.name, package: linked_package.name, short: true) | ||
- if linkinfo[:error] | ||
%li | ||
%i.fas.fa-times-circle.text-danger | ||
Link has errors: | ||
%i= linkinfo[:error] | ||
- elsif linkinfo[:diff] | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
Has a | ||
= link_to('link diff', package_rdiff_path(oproject: linked_package.project.name, opackage: linked_package.name, | ||
project: project, package: package, rev: revision)) | ||
= render partial: 'show_linkinfo', locals: { package: package, project: project, linkinfo: linkinfo, revision: revision } | ||
|
||
= render partial: 'extra_actions', locals: { project: project, package: package } |
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.
Nice use case for pluralize
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.
@dmarcoux, good catch