Created
February 28, 2014 16:16
-
-
Save lincolndbryant/9273889 to your computer and use it in GitHub Desktop.
sketch of expiry changes
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
//a JS template that gets added to the end of the options tab | |
<div data-hubfield="create_page"> | |
<div class="show-if-create_page"> | |
<div data-hubfield="html_title" /> | |
<div data-hubfield="replacement_page" /> | |
<div data-hubfield="replacement_page" /> | |
<div data-hubfield="replacement_page" /> | |
<input name="expiry" value="none" /> Do not unpublish | |
<input name="expiry" value="date" /> Unpublish at a specific data & time | |
<div data-hubfield="expiry_unpublish_date"> | |
<input name="expiry" value="redirect" /> Redirect to a landing page at a specific date & time | |
<div data-hubfield="expiry_redirect_date" /> | |
<div data-hubfield="replacement_page" /> | |
</div> | |
//in edit-email.js, add attributes that hubfields are not in charge of saving | |
init -> | |
//jquery to toggle hiding and showing based on radio checking | |
app.on 'form:serialize', (data) -> | |
expiry = $('input[name="expiry"]').val() | |
if expiry.value is 'none' | |
data.use_page_expiry = false | |
data.replace_page = false | |
else if expiry.value is 'data' | |
data.use_page_expiry = true | |
data.replace_page = false | |
else if expiry.value is 'redirect' | |
data.use_page_expiry = true | |
data.replace_page = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment