Skip to content
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

Add tags to job list #21

Merged
merged 5 commits into from
Nov 17, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/assets/stylesheets/kuroko2/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
padding-top: 10px;
}

.spacer-right-3 {
margin-right: 3px;
}

.nowrap {
white-space: nowrap;
}
Expand Down
13 changes: 8 additions & 5 deletions app/views/kuroko2/job_definitions/_list.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
tr
th #
th.col-md-3 Name
th.col-md-3 Next Job
th.col-md-2 Latest Status
th.col-md-8 data-defaultsort='disabled' Description
th.col-md-2 Next Job
th.col-md-1 Latest Status
th.col-md-5 data-defaultsort='disabled' Tags / Description
th.col-md-1 data-defaultsort='disabled'  
tbody
- for definition in definitions
Expand All @@ -19,8 +19,11 @@
- else
td data-value="9999999999" --
td= labeled_status(definition.job_instances.take)
td= first_line(definition.description)
td
= link_to raw('<i class="fa fa-chevron-right"></i> View Details'), definition, class: 'btn btn-sm btn-default'
- definition.tags.each do |tag|
=link_to tag.name, root_path('tag': [tag.name]), class: 'label label-default spacer-right-3'
= first_line(definition.description)
td
= link_to raw('<i class="fa fa-chevron-right"></i> <span class="small">View Details</span>'), definition, class: 'btn btn-sm btn-default'
- else
.text-muted.well.well-sm.no-shadow There are no favorite job definitions.
11 changes: 7 additions & 4 deletions app/views/kuroko2/job_definitions/_search_results.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,25 @@
th #
th.col-md-3 Name
th.col-md-3 Administrators
th.col-md-5 Description
th.col-md-5 Tags / Description
th.col-md-1 &nbsp;
- for definition in definitions
tr
td
span.star-holder
= star_link_for(definition)
td= definition.id
td.no-decorate= link_to definition.name, definition
td.no-decorate= link_to definition.name, definition, class: ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change necessary?

Copy link
Member Author

@eisuke eisuke Nov 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops 7f2d748

td.no-decorate
- definition.admins.each do |user|
= link_to user.name, user_path(user)
br
td= first_line(definition.description)
td
= link_to raw('<i class="fa fa-chevron-right"></i> View Details'), definition, class: 'btn btn-sm btn-default'
- definition.tags.each do |tag|
=link_to tag.name, job_definitions_path('tag': [tag.name]), class: 'label label-default spacer-right-3'
= first_line(definition.description)
td
= link_to raw('<i class="fa fa-chevron-right"></i> <span class="small">View Details</span>'), definition, class: 'btn btn-sm btn-default'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use = link_to definition, class: 'btn btn-sm btn-default' do ...? Specifying raw by hand is dangerous.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed 37182b6.

But there are many raw functions in kuroko2 views 🤕

- else
- if params[:q].present?
.text-muted.well.well-sm.no-shadow No results found for the query.
Expand Down
2 changes: 1 addition & 1 deletion app/views/kuroko2/job_definitions/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

h4= 'Tags'
- for tag in @definition.tags
=link_to tag.name, job_definitions_path(tag: [tag.name]), class: 'badge'
=link_to tag.name, job_definitions_path(tag: [tag.name]), class: 'label label-default spacer-right-3'

h3= 'Administrator'.pluralize(@definition.admins.count)
ul.media-list
Expand Down