-
Notifications
You must be signed in to change notification settings - Fork 30
Show the view state of puppet modules/classes using chevrons on puppetclass selection page #439
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,21 +2,36 @@ | |||||||||
| <div class="col-md-6 classes"> | ||||||||||
| <% group.each do |list| %> | ||||||||||
| <% next if list.nil? %> | ||||||||||
| <ul class="puppetclass_group"> | ||||||||||
| <li><%= puppetclass_group_with_icon(list, selected_puppet_classes) %> | ||||||||||
| <ul id="pc_<%= list.first %>" style="display: none;"> | ||||||||||
| <% for klass in list.last.sort %> | ||||||||||
| <% unless authorized_for(controller: :host_editing, action: :edit_classes) %> | ||||||||||
| <li data-original-title="<%= _('Not authorized to edit classes') %>" rel="twipsy"><%= h klass.name %></li> | ||||||||||
| <% else %> | ||||||||||
| <li id="puppetclass_<%= klass.id %>" class="puppetclass<%= ' hide' if selected_puppet_classes.include?(klass) %>"> | ||||||||||
| <%= link_to_add_puppetclass(klass, resource_type) %> | ||||||||||
| </li> | ||||||||||
| <% end %> | ||||||||||
| <% end %> | ||||||||||
| </ul> | ||||||||||
| </li> | ||||||||||
| </ul> | ||||||||||
|
|
||||||||||
| <div class="panel-group paneless puppetclass_group" id="<%= list.first %>-avail-classes" style="margin-bottom: 1px;"> | ||||||||||
| <div class="panel-heading" style="padding-top: 2px; padding-bottom: 2px;"> | ||||||||||
| <p class="panel-title"> | ||||||||||
| <a data-toggle="collapse" data-parent="#<%= list.first %>-avail-classes" href="#<%= list.first %>-avail-classes-list" class="collapsed"> | ||||||||||
| <%= h list.first %> | ||||||||||
| </a> | ||||||||||
| </p> | ||||||||||
| </div> | ||||||||||
| <div id="<%= list.first %>-avail-classes-list" class="panel-collapse collapse"> | ||||||||||
| <div class="panel-body"> | ||||||||||
| <ul style="margin-bottom: 1px;"> | ||||||||||
| <% for klass in list.last.sort %> | ||||||||||
| <% unless authorized_for(:controller => :host_editing, :action => :edit_classes) %> | ||||||||||
| <li data-original-title="<%= _('Not authorized to edit classes') %>" rel="twipsy"> | ||||||||||
| <%= h klass.name %> | ||||||||||
| </li> | ||||||||||
| <% else %> | ||||||||||
| <% style = ["puppetclass", | ||||||||||
| selected_puppet_classes.include?(klass) ? "hide" : "", | ||||||||||
| ].join(' ') %> | ||||||||||
| <%= content_tag(:li, klass, :id=>"puppetclass_#{klass.id}", :class=>style) do %> | ||||||||||
| <%= link_to_add_puppetclass(klass,type) %> | ||||||||||
|
Comment on lines
+26
to
+27
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| <% end %> | ||||||||||
| <% end %> | ||||||||||
| <% end %> | ||||||||||
| </ul> | ||||||||||
| </div> | ||||||||||
| </div> | ||||||||||
| </div> | ||||||||||
| <% end %> | ||||||||||
| </div> | ||||||||||
| <% end %> | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,9 +28,18 @@ export function filterPuppetClasses(item) { | |
| classElems | ||
| .hide() | ||
| .has(`[data-class-name*="${term}"]`) | ||
| .show(); | ||
| .show() | ||
| .filter('div') | ||
| .find('a.collapsed') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is the |
||
| .attr('aria-expanded','true') | ||
| .click(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the click? |
||
| } else { | ||
| classElems.show(); | ||
| classElems | ||
| .show() | ||
| .has('.collapse') | ||
| .find('a[aria-expanded]') | ||
| .attr('aria-expanded','false') | ||
| .click(); | ||
| } | ||
| } | ||
|
|
||
|
|
||
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 can't say I'm exactly happy about inline styling all over the place. Could that be extracted to classes?