-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
67 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
(function( $ ){ | ||
|
||
$.fn.reportProblem = function( options ) { | ||
// Create some defaults, extending them with any options that were provided | ||
var settings = $.extend( { }, options); | ||
var container, target, cancel; | ||
|
||
function init() { | ||
target_val = container.attr('data-target') | ||
if (!target_val) | ||
return | ||
|
||
target = $("#" + target_val); | ||
container.on('click', open); | ||
target.find('[data-behavior="cancel-link"]').on('click', close); | ||
} | ||
|
||
function open(event) { | ||
event.preventDefault(); | ||
target.slideToggle('slow'); | ||
} | ||
|
||
function close(event) { | ||
event.preventDefault(); | ||
target.slideUp('fast'); | ||
} | ||
|
||
return this.each(function() { | ||
container = $(this); | ||
init(); | ||
}); | ||
} | ||
})( jQuery ); | ||
|
||
Spotlight.onLoad(function() { | ||
$('[data-behavior="contact-link"]').reportProblem(); | ||
}); | ||
|
||
|
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,4 @@ | ||
#report-problem-form { | ||
margin-bottom: 30px; | ||
display: none; | ||
} |
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
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
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,15 @@ | ||
<div id="report-problem-form" class='row'> | ||
<% contact_form = Spotlight::ContactForm.new current_url: request.original_url %> | ||
<%= bootstrap_form_for contact_form, url: spotlight.exhibit_contact_form_path(current_exhibit, contact_form), style: :horizontal, right: "col-sm-5" do |f| %> | ||
|
||
<h2 class="col-md-offset-2"><%= t(:'.title') %></h2> | ||
<%= f.text_field :name %> | ||
<%= f.text_field :email %> | ||
<%= f.text_area :message, rows: 7 %> | ||
<%= f.hidden_field :current_url %> | ||
<%= f.form_group do %> | ||
<%= f.submit nil %> | ||
<%= link_to t(:'helpers.action.cancel'), '#', class: 'btn btn-text', data: { 'behavior' => 'cancel-link' } %> | ||
<% end %> | ||
<% end %> | ||
</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