Skip to content

Commit

Permalink
Merge pull request #611 from sul-dlss/improve-page-item-layout
Browse files Browse the repository at this point in the history
Remove page options and improve layout and styling of curation pages
  • Loading branch information
Jessie Keck committed Apr 5, 2014
2 parents 13a14cc + f0fdb78 commit 6f6c248
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
}

text-align: left;
.dd3-handle:before {
top: 3px;
}
}

&.checkbox-cell {
Expand Down
35 changes: 26 additions & 9 deletions app/assets/stylesheets/spotlight/_curation.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,33 +45,36 @@
display: inline-block;
padding-top: 0;
}
.display-sidebar-control {
.checkbox {
width: auto;
}
}
.publish-control {
display: inline;
.checkbox {
padding-top: 0;
}
}
.page-links {
padding-left: 4px;
.page-links, .contact-links {
text-align: right;
a {
padding: 0 2px;
}
}
.main {
width: 96%;
vertical-align: top;
width: 99%;
vertical-align: text-top;
display: inline-block;
}
}

.contacts_admin .panel-heading.page .main {
width: 95%;
}

.panel-heading.search {
/* widths don't add up to 100% because of padding of the container. */
.checkbox {
width: 3%;
vertical-align: top;
display: inline-block;
padding-top: 0;
}
.pic {
width: 70px;
Expand All @@ -82,12 +85,16 @@
width: 40%;
vertical-align: top;
display: inline-block;
margin-left: $padding-base-horizontal;
}
.description {
width: 30%;
vertical-align: top;
display: inline-block;
}
.panel-title {
font-size: 15px;
}
}

#edit-search {
Expand Down Expand Up @@ -136,4 +143,14 @@ h1,h2,h3,h4,h5,h6 {
@extend .text-muted;
font-size: $font-size-base;
text-align: right;
}

table#exhibit-specific-fields {
margin-top: 2em;
.field-label {
min-width: 10em;
}
.actions a {
padding: 0 2px;
}
}
2 changes: 1 addition & 1 deletion app/assets/stylesheets/spotlight/_nestable.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@ tr.dd-item {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.dd3-handle:before { content: ''; display: block; position: absolute; left: 0; top: 3px; width: 100%; text-align: center; text-indent: 0; color: #fff; font-size: 20px; font-weight: normal; }
.dd3-handle:before { content: ''; display: block; position: absolute; left: 0; top: 9px; width: 100%; text-align: center; text-indent: 0; color: #fff; font-size: 20px; font-weight: normal; }
.dd3-handle:hover { background: #ddd; }
19 changes: 9 additions & 10 deletions app/views/spotlight/feature_pages/_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
<h3><%= t('spotlight.pages.index.feature_pages.home_pages_header') %></h3>
<div class="panel panel-default">
<div class="panel-heading page">
<div class="main">
<%= p.hidden_field :id, value: page.id , class: 'form-control input-sm' %>
<h3 class="panel-title" data-in-place-edit-target=".edit-in-place">
<a href="#edit-in-place" class="field-label edit-in-place"><%= page.title %></a>
<%= p.hidden_field :title, value: page.title , class: 'form-control input-sm' %>
</h3>
<div class="col-sm-9 page-links">
<div class="main row">
<div class="col-sm-8">
<%= p.hidden_field :id, value: page.id , class: 'form-control input-sm' %>
<h3 class="panel-title" data-in-place-edit-target=".edit-in-place">
<a href="#edit-in-place" class="field-label edit-in-place"><%= page.title %></a>
<%= p.hidden_field :title, value: page.title , class: 'form-control input-sm' %>
</h3>
</div>
<div class="col-sm-4 page-links">
<%= exhibit_view_link page, exhibit_root_path(page.exhibit), class: 'btn btn-link' %> &middot;
<%= exhibit_edit_link page, edit_exhibit_home_page_path(page.exhibit), class: 'btn btn-link' %>
</div>
<div class="col-sm-3 display-sidebar-control">
<%= p.check_box :display_title, label: t('spotlight.administration.display_title') %>
</div>
</div>
</div>
</div>
Expand Down
25 changes: 12 additions & 13 deletions app/views/spotlight/pages/_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@
<div class="publish-control">
<%= f.check_box :published, label: '' %>
</div>
<div class="main">
<%= f.hidden_field :id %>
<%= f.hidden_field :weight, data: {property: "weight"} %>
<h3 class="panel-title" data-in-place-edit-target=".edit-in-place">
<a href="#edit-in-place" class="field-label edit-in-place"><%= page.title %></a>
<%= f.hidden_field :title, value: page.title , class: 'form-control input-sm' %>
</h3>
<div class="row">
<div class="page-links col-sm-9">
<div class="main row">
<div class="col-sm-8">
<%= f.hidden_field :id %>
<%= f.hidden_field :weight, data: {property: "weight"} %>
<h3 class="panel-title" data-in-place-edit-target=".edit-in-place">
<a href="#edit-in-place" class="field-label edit-in-place"><%= page.title %></a>
<%= f.hidden_field :title, value: page.title , class: 'form-control input-sm' %>
</h3>
</div>

<div class="page-links col-sm-4">
<%= exhibit_view_link page, :class => 'btn btn-link' %> &middot;
<%= exhibit_edit_link page, :class => 'btn btn-link' %> &middot;
<%= exhibit_delete_link page, :class => 'btn btn-link' %>
</div>
<%- if page.feature_page? -%>
<%= f.hidden_field :parent_page_id, data: {property: "parent_page"} %>
<div class="col-sm-3 display-sidebar-control">
<%= f.check_box :display_sidebar, label: t('spotlight.administration.show_sidebar') %>
</div>
<% end %>
</div>

</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/spotlight/searches/_search.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="pic thumbnail"><%= image_tag(search.featured_image) if search.featured_image %></div>
<div class="main">
<div class="title"><%= search.title %></div>
<div class="title panel-title"><%= search.title %></div>
<div class="count"><%= t :'.item_count', count: search.count %></div>
<div class="actions"><%= exhibit_edit_link(search) %> &bull; <%= exhibit_delete_link(search) %></div>
<%= f.hidden_field :id %>
Expand Down
37 changes: 0 additions & 37 deletions spec/features/home_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,43 +34,6 @@
expect(page).to have_selector ".panel-title a", text: "New Home Page Title"
end

it "should allow users to edit the display_title attribute" do
visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)
within '#user-util-collapse .dropdown-menu' do
click_link 'Dashboard'
end

click_link "Feature pages"

# Choose to display the home page title
within(".home_page") do
check "Show title"
end
click_button "Save changes"

visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)

# Verify the home page title is being displayed
expect(page).to have_css("h1.page-title", text: exhibit.home_page.title)

within '.dropdown-menu' do
click_link 'Dashboard'
end

click_link "Feature pages"

# Choose to not display the home page title
within(".home_page") do
uncheck "Show title"
end
click_button "Save changes"

visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)

# Verify the home page title is not being displayed
expect(page).not_to have_css("h1.page-title", text: exhibit.home_page.title)
end

describe "page options on edit form" do
describe "show title" do
let(:home_page) { FactoryGirl.create(:home_page, display_title: false, exhibit: exhibit) }
Expand Down
16 changes: 0 additions & 16 deletions spec/features/javascript/feature_page_admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,6 @@
end
end

it "should store the display_sidebar boolean" do
visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)
click_link exhibit_curator.email
within '#user-util-collapse .dropdown' do
click_link 'Dashboard'
end
click_link "Feature pages"
within("[data-id='#{page1.id}']") do
expect(field_labeled("Show sidebar")).to_not be_checked
check "Show sidebar"
end
click_button "Save changes"
within("[data-id='#{page1.id}']") do
expect(field_labeled("Show sidebar")).to be_checked
end
end
it "should stay in curation mode if a user has unsaved data" do
visit spotlight.exhibit_home_page_path(exhibit, exhibit.home_page)
click_link exhibit_curator.email
Expand Down

0 comments on commit 6f6c248

Please sign in to comment.