Skip to content

Commit

Permalink
Merge pull request #5447 from avalonmediasystem/admin_button_placement
Browse files Browse the repository at this point in the history
Move administrative buttons to top of page and outside of scope of Ramp
  • Loading branch information
cjcolvar authored Nov 3, 2023
2 parents 212b0f1 + b90f09b commit d50e19c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
6 changes: 0 additions & 6 deletions app/javascript/components/Ramp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ const Ramp = ({
master_files_count,
title,
expand_structure,
admin_links,
share,
timeline,
playlist,
thumbnail,
in_progress,
cdl
}) => {
Expand Down Expand Up @@ -94,10 +92,6 @@ const Ramp = ({
</button>
}
</Col>
<Col className="ramp-button-group-2">
{ admin_links.canUpdate && <div className="mr-1" dangerouslySetInnerHTML={{ __html: admin_links.content }} /> }
{ thumbnail.canCreate && <div className="mr-1" dangerouslySetInnerHTML={{ __html: thumbnail.content }} /> }
</Col>
</div>
<Row className="mx-0">
<Col md={12} lg={12} sm={12}>
Expand Down
2 changes: 1 addition & 1 deletion app/views/media_objects/_administrative_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Unless required by applicable law or agreed to in writing, software distributed
--- END LICENSE_HEADER BLOCK ---
%>
<% if can? :update, @media_object %>
<div id="administrative_options">
<div id="administrative_options" class="d-inline-block">
<%= link_to 'Edit', edit_media_object_path(@media_object), class: 'btn btn-primary text-nowrap' %>
<% if @media_object.published? %>
Expand Down
14 changes: 11 additions & 3 deletions app/views/media_objects/_item_view.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,19 @@ Unless required by applicable law or agreed to in writing, software distributed
<% in_progress = show_progress?(@masterFiles) %>
<div class="row">
<div class="col-sm-8">
<div class="col-sm-12">
<%= render 'workflow_progress' %>
</div>
<div class="col-sm-12 mb-2">
<%= render 'administrative_links' %>
<% if current_ability.can? :edit, @media_object %>
<% if lending_enabled?(@media_object) %>
<%= render 'thumbnail' if can_stream %>
<% else %>
<%= render 'thumbnail' %>
<% end %>
<% end %>
</div>
<div class="<%= in_progress || !@currentStream ? 'col-sm-4' : 'col-sm-12' %>">
<%= react_component("Ramp",
{
Expand All @@ -36,10 +46,8 @@ Unless required by applicable law or agreed to in writing, software distributed
master_files_count: @media_object.master_files.size,
title: { content: render('title') },
expand_structure: { content: render('expand_structure') },
admin_links: { canUpdate: (current_ability.can? :update, @media_object), content: render('administrative_links') },
share: { canShare: (will_partial_list_render? :share), content: lending_enabled?(@media_object) ? (render('share') if can_stream) : render('share') },
timeline: { canCreate: (current_ability.can? :create, Timeline), content: lending_enabled?(@media_object) ? (render('timeline') if can_stream) : render('timeline') },
thumbnail: { canCreate: (current_ability.can? :edit, @media_object), content: lending_enabled?(@media_object) ? (render('thumbnail') if can_stream) : render('thumbnail') },
playlist: { canCreate: (current_ability.can? :create, Playlist), tab: render('add_to_playlist') },
in_progress: in_progress,
cdl: { enabled: lending_enabled?(@media_object), can_stream: can_stream, embed: render('embed_checkout'), destroy: render('destroy_checkout') }
Expand Down
2 changes: 1 addition & 1 deletion app/views/media_objects/_thumbnail.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Unless required by applicable law or agreed to in writing, software distributed
--- END LICENSE_HEADER BLOCK ---
%>

<div id="thumbnail-button" style="display: inline-block;">
<div id="thumbnail-button" class="d-inline-block">
<button type="button" class="btn btn-outline text-nowrap" id="create-thumbnail-btn" data-toggle="modal" data-target="#thumbnailModal" disabled>
Create Thumbnail
</button>
Expand Down

0 comments on commit d50e19c

Please sign in to comment.