diff options
| -rw-r--r-- | site/db.json | 4 | ||||
| -rw-r--r-- | themes/okadmin/public/js/app.js | 13 | ||||
| -rw-r--r-- | themes/okadmin/templates/index.liquid | 2 | ||||
| -rw-r--r-- | themes/okadmin/templates/resource.liquid | 4 |
4 files changed, 15 insertions, 8 deletions
diff --git a/site/db.json b/site/db.json index 1eee2e0..6c598ab 100644 --- a/site/db.json +++ b/site/db.json @@ -36,14 +36,14 @@ "title": "WHO WE ARE", "body": "WE ARE A COLLECTIVE OF DIGITAL NATIVES, INDUSTRY INFLUENCERS, TRENDSETTERS, MILLENNIAL COMMUNICATORS & UNORTHODOX STRATEGISTS – A NEW MEDIA CREATIVE LAB. TOGETHER WE CREATE LIVING, BREATHING, CONTENT DRIVEN EXPERIENCES THAT ENGAGE TODAY’S CONSUMER AUDIENCE. WE ARE WILD, PUNK, PROVOCATIVE, RADICAL, FEARLESS, SUBVERSIVE, BOISTEROUS, ANARCHIC, UNEXPECTED & DISRUPTIVE. MOST OF ALL WE ARE CURIOUS. WELCOME TO THE WORLD OF TWO HUSTLERS.", "image": "http://www.lansdowneresort.com/meetings/assets/images/masthead/meetings-team-building.jpg", - "__index": 1 + "__index": "1" }, { "id": "contact", "title": "CONTACT", "body": "TWOHUSTLERS\r\n50 WHITE STREET\r\nNEW YORK, NY 10013\r\n<a href=\"mailto:info@twohustlers.com\">INFO@TWOHUSTLERS.COM</a>\r\n+1 646 370-1180\r\nTWOHUSTLERS ©2014\r\nWEBSITE BY <a href=\"http://okfoc.us/\">OKFOCUS</a>", "image": "http://checkingintocollege.com/wp/wp-content/uploads/2014/08/angryphone.jpg", - "__index": 0 + "__index": "0" } ], "advertising": [], diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js index b53d21f..ab571f3 100644 --- a/themes/okadmin/public/js/app.js +++ b/themes/okadmin/public/js/app.js @@ -51,7 +51,8 @@ var OKAdmin = function(){ // fix post indexing in list-driven inputs $(".main.resource form").submit(function(e){ - var $id = $("[name=id]"), $title = $("[name=title]"), $shortname = $("[name=shortname]") + var $id = $("[name=id]"), $title = $("[name=title]"), $shortname = $("[name=shortname]"), $section = $(".resource.main") + var id = $section.data("id"), type = $section.data("type") if ($title.length && ! $title.val()) { alert("Please enter a title") @@ -65,8 +66,14 @@ var OKAdmin = function(){ return } - var slug = slugify( $title.val() ) - $id.val( slug ) + // TODO: pass through whether this page is static + if (type === "page" && (id == "contact" || id == "about")) { + ; + } + else { + var slug = slugify( $title.val() ) + $id.val( slug ) + } $(".image-element").each(function(index){ $(this).find("input,textarea").each(function(){ diff --git a/themes/okadmin/templates/index.liquid b/themes/okadmin/templates/index.liquid index 330ed89..d25100f 100644 --- a/themes/okadmin/templates/index.liquid +++ b/themes/okadmin/templates/index.liquid @@ -16,7 +16,7 @@ <ol class="resource-list"> {% for data in resource.data %} <li> - <a href="{{resource.type}}/{{data.id}}/">{{data.id}}</a> + <a href="{{resource.type}}/{{data.id}}/">{{data.title}}</a> <input class="resource-input" type="hidden" name="{{resource.type}}[{{forloop.index0}}]" value='{{data | stringify}}'> </li> {% endfor %} diff --git a/themes/okadmin/templates/resource.liquid b/themes/okadmin/templates/resource.liquid index abc59e9..aa3efe0 100644 --- a/themes/okadmin/templates/resource.liquid +++ b/themes/okadmin/templates/resource.liquid @@ -6,8 +6,8 @@ <a href="../..">Back</a> </nav> -<section class="resource main"> - <h2>EDIT {{ resource.type }} '{{ resource.id }}'</h2> +<section class="resource main" data-type="{{ resource.type }}" data-id="{{ resource.id }}"> + <h2>EDIT {{ resource.type }} '{{ resource.spec.title.value }}'</h2> <form action="." method="POST"> <input type="hidden" name="_method" value="PUT"> {% include 'partials/inputs' %} |
