-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update parts accordion to Bootstrap 3
* Bootstrap 3 uses collapsing panels to build an accordion: http://getbootstrap.com/javascript/#collapse-examples * Use a `js-` prefixed class as the handle for sortable items * Upgrade jQuery UI library to work with newer jQuery (1.8.20 to 1.10.4) — only includes ui.sortable, ui.accordion and core * Use a CSS animation for the yellow fade effect
- Loading branch information
Showing
7 changed files
with
71 additions
and
54 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
|
||
@import "govuk_admin_template"; | ||
@import "scaffold"; | ||
@import "sortable_accordion"; |
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,31 @@ | ||
.ui-sortable .panel { | ||
margin-bottom: 5px; | ||
} | ||
|
||
// 3s yellow fade animation | ||
// Could be part of admin gem | ||
// Based on http://jsfiddle.net/csswizardry/TVqVC/ | ||
|
||
@-webkit-keyframes yellow-fade { | ||
5% { | ||
background-color:#ff9; | ||
} | ||
} | ||
|
||
@-moz-keyframes yellow-fade { | ||
5% { | ||
background-color:#ff9; | ||
} | ||
} | ||
|
||
@keyframes yellow-fade { | ||
5% { | ||
background-color:#ff9; | ||
} | ||
} | ||
|
||
.yellow-fade { | ||
-webkit-animation:yellow-fade 3s; | ||
-moz-animation:yellow-fade 3s; | ||
animation:yellow-fade 3s; | ||
} |
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,43 +1,43 @@ | ||
<div class="accordion-group part"> | ||
<div class="accordion-heading"> | ||
<a class="accordion-toggle" data-toggle="collapse" data-parent="#parts" href="#<%= f.object.slug || 'untitled-part' %>"> | ||
<i class="icon-chevron-down"></i> | ||
<%= f.object.title.present? ? f.object.title : 'Untitled part' %> | ||
</a> | ||
<div class="panel panel-default part"> | ||
<div class="panel-heading js-sort-handle"> | ||
<h4 class="panel-title" > | ||
<a data-toggle="collapse" data-parent="#parts" href="#<%= f.object.slug || 'untitled-part' %>"> | ||
<i class="glyphicon glyphicon-chevron-down glyphicon-smaller-than-text add-right-margin pull-left"></i> | ||
<%= f.object.title.present? ? f.object.title : 'Untitled part' %> | ||
</a> | ||
</h4> | ||
</div> | ||
<div id="<%= f.object.slug || 'untitled-part' %>" class="accordion-body <% if f.object.valid? %>collapse <% end %>in"> | ||
<div class="accordion-inner"> | ||
|
||
<div class="row"> | ||
<div id="<%= f.object.slug || 'untitled-part' %>" class="panel-collapse <% if f.object.valid? %>collapse <% end %>in"> | ||
<div class="panel-body"> | ||
|
||
<%= f.inputs do %> | ||
<%= f.input :title, | ||
:input_html => { :class => 'col-md-12 title', :disabled => ! editable }, | ||
:input_html => { :class => 'title', :disabled => ! editable }, | ||
:hint => true, | ||
:required => true %> | ||
|
||
<%= f.input :body, | ||
:as => :text, | ||
:required => true, | ||
:input_html => { :class => 'col-md-12', :rows => '25', :disabled => ! editable } %> | ||
:input_html => { :rows => '25', :disabled => ! editable } %> | ||
|
||
<%= f.input :slug, | ||
:input_html => { :class => 'col-md-12 slug', :disabled => ! editable }, | ||
:input_html => { :class => 'slug', :disabled => ! editable }, | ||
:hint => false, | ||
:required => true %> | ||
|
||
<p class="help-block"><i class="icon-info-sign"></i> Eg. title-of-part (no spaces, apostrophes, etc).</p> | ||
<p class="help-block"> | ||
<i class="glyphicon glyphicon-info-sign"></i> eg title-of-part (no spaces, apostrophes, etc). | ||
</p> | ||
|
||
<%= f.input :order, :as => :hidden, :input_html => { :class => 'order', :disabled => !editable } %> | ||
|
||
<% if editable %> | ||
<div class="row"> | ||
<hr> | ||
<%= f.remove_link "Remove this part" %> | ||
</div><!--/.row --> | ||
<hr> | ||
<%= f.remove_link "Remove this part" %> | ||
<% end %> | ||
<% end %> | ||
</div><!--/.row --> | ||
|
||
</div> | ||
</div> | ||
</div> |
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
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
Large diffs are not rendered by default.
Oops, something went wrong.