setting up gulp and basic list and edit view files
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 19 Sep 2017 17:16:16 +0000 (13:16 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 19 Sep 2017 17:16:16 +0000 (13:16 -0400)
setting up the vasic edit and list view pages for admin

.gitignore [new file with mode: 0644]
css/admin.css [new file with mode: 0644]
css/admin.css.map [new file with mode: 0644]
css/front.css [new file with mode: 0644]
css/front.css.map [new file with mode: 0644]
gulpfile.js [new file with mode: 0644]
package.json [new file with mode: 0644]
scss/admin.scss [new file with mode: 0644]
scss/front.scss [new file with mode: 0644]
views/admin/buySell/edit.html
views/admin/buySell/list.html

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..3c3629e
--- /dev/null
@@ -0,0 +1 @@
+node_modules
diff --git a/css/admin.css b/css/admin.css
new file mode 100644 (file)
index 0000000..c033154
--- /dev/null
@@ -0,0 +1,3 @@
+#glm-admin-content-container .admin-item-label,#glm-admin-content-container .admin-item-input,#glm-admin-content-container .admin-item-list{padding:0}.itemTitle-record{float:left}.admin-new-item{margin-bottom:15px}.admin-new-item .admin-new-item-link{padding:5px;background:#3D84D0;color:white;text-decoration:none;border-radius:4px}.no-padding{padding:0}.no-margin{margin:0}#glm-admin-content-container .admin-item-list-header{margin-bottom:20px;padding-bottom:2px;border-bottom:1px solid lightgray}.admin-item-list-row{padding-bottom:5px}.item-company-list-header,.item-date-list-header,.item-title-list-header{font-weight:bold;font-size:16px}.admin-item-list-row:nth-child(odd){background:#e3e3e5}
+
+/*# sourceMappingURL=admin.css.map */
diff --git a/css/admin.css.map b/css/admin.css.map
new file mode 100644 (file)
index 0000000..6bd1f39
--- /dev/null
@@ -0,0 +1 @@
+{"version":3,"file":"admin.css","sources":["admin.scss"],"sourcesContent":["#glm-admin-content-container .admin-item-label,\n#glm-admin-content-container .admin-item-input,\n#glm-admin-content-container .admin-item-list{\n    padding: 0;\n}\n.itemTitle-record{\n    float: left;\n}\n.admin-item-input textarea{\n   \n}\n.admin-new-item{\n    margin-bottom: 15px;\n}\n.admin-new-item .admin-new-item-link{\n    padding: 5px;\n    background: #3D84D0;\n    color: white;\n    text-decoration: none;\n    border-radius: 4px;\n}\n.no-padding{\n    padding: 0;\n}\n.no-margin{\n    margin: 0;\n}\n#glm-admin-content-container .admin-item-list-header{\n    margin-bottom: 20px;\n    padding-bottom: 2px;\n    border-bottom: 1px solid lightgray;\n}\n.admin-item-list-row{\n    padding-bottom: 5px;\n/*    border-bottom: 1px solid lightgray;*/\n}\n.item-company-list-header,.item-date-list-header, .item-title-list-header{\n    font-weight: bold;\n    font-size: 16px;\n}\n.admin-item-list-row:nth-child(odd){\n    background: #e3e3e5;\n}\n"],"names":[],"mappings":"AAAA,AAA6B,4BAAD,CAAC,iBAAiB,CAC9C,AAA6B,4BAAD,CAAC,iBAAiB,CAC9C,AAA6B,4BAAD,CAAC,gBAAgB,AAAA,CACzC,OAAO,CAAE,CAAC,CACb,AACD,AAAA,iBAAiB,AAAA,CACb,KAAK,CAAE,IAAI,CACd,AAID,AAAA,eAAe,AAAA,CACX,aAAa,CAAE,IAAI,CACtB,AACD,AAAgB,eAAD,CAAC,oBAAoB,AAAA,CAChC,OAAO,CAAE,GAAG,CACZ,UAAU,CAAE,OAAO,CACnB,KAAK,CAAE,KAAK,CACZ,eAAe,CAAE,IAAI,CACrB,aAAa,CAAE,GAAG,CACrB,AACD,AAAA,WAAW,AAAA,CACP,OAAO,CAAE,CAAC,CACb,AACD,AAAA,UAAU,AAAA,CACN,MAAM,CAAE,CAAC,CACZ,AACD,AAA6B,4BAAD,CAAC,uBAAuB,AAAA,CAChD,aAAa,CAAE,IAAI,CACnB,cAAc,CAAE,GAAG,CACnB,aAAa,CAAE,mBAAmB,CACrC,AACD,AAAA,oBAAoB,AAAA,CAChB,cAAc,CAAE,GAAG,CAEtB,AACD,AAAA,yBAAyB,CAAC,AAAA,sBAAsB,CAAE,AAAA,uBAAuB,AAAA,CACrE,WAAW,CAAE,IAAI,CACjB,SAAS,CAAE,IAAI,CAClB,AACD,AAAA,oBAAoB,AAAA,UAAW,CAAA,AAAA,GAAG,CAAC,CAC/B,UAAU,CAAE,OAAO,CACtB"}
\ No newline at end of file
diff --git a/css/front.css b/css/front.css
new file mode 100644 (file)
index 0000000..16f0cb3
--- /dev/null
@@ -0,0 +1,3 @@
+.no-padding{padding:0}body .front-item-listings-wrapper{margin-top:20px}body .front-item-listings-wrapper .item-detail-wrapper .front-title{font-weight:bold;font-size:20px}body .front-item-listings-wrapper .item-detail-wrapper div{float:none !important;line-height:1.1;margin:8px 8px 8px 0}body .front-item-listings-wrapper span{font-weight:bold}body .front-item-listings-wrapper .front-item-list-row{margin-bottom:20px}body .front-item-listings-wrapper .front-item-list-row .item-title-list span{font-size:20px}body .front-item-listings-wrapper .item-title-search #item_title_dropdown{max-width:450px}body .front-item-listings-wrapper .item-title-search .item-title-button{height:39px}@media screen and (max-width: 641px){body .front-item-listings-wrapper .item-title-button{display:block;max-width:100px;margin:0 auto}body .front-item-listings-wrapper .front-item-search{margin-bottom:20px}}@media (min-width: 639px) and (max-width: 1025px){body .front-item-listings-wrapper .item-title-button{display:inline-block;margin:0 0 0 10px}}@media (min-width: 1023px){body .front-item-listings-wrapper .item-title-button{display:inline-block;margin:0 0 0 10px}}
+
+/*# sourceMappingURL=front.css.map */
diff --git a/css/front.css.map b/css/front.css.map
new file mode 100644 (file)
index 0000000..4b05f66
--- /dev/null
@@ -0,0 +1 @@
+{"version":3,"file":"front.css","sources":["front.scss"],"sourcesContent":[".no-padding{\n    padding: 0;\n}\n\nbody .front-item-listings-wrapper {\n    .item-detail-wrapper{\n        .front-title{\n            font-weight: bold;\n            font-size: 20px;\n        }\n       div{\n           float: none !important;\n           line-height: 1.1;\n           margin: 8px 8px 8px 0;\n       }\n    }\n    // .front-item-search{\n    //     max-width: 530px;\n    //     margin: 0 auto;\n    // }\n    margin-top: 20px;\n    span{\n        font-weight: bold;\n    }\n   \n    .front-item-list-row{\n        margin-bottom: 20px;\n        .item-title-list{\n            span{\n                font-size: 20px;\n            }\n        }\n\n    }\n    .item-title-search{\n        #item_title_dropdown{\n            max-width: 450px;\n        }\n        .item-title-button{\n            height: 39px;\n        }\n    }\n    \n    @media screen and (max-width: 641px){\n        .item-title-button{\n            display: block;\n            max-width: 100px;\n            margin: 0 auto;\n        }\n        .front-item-search{\n            margin-bottom: 20px;\n        }\n    }\n    @media (min-width: 639px) and (max-width: 1025px){\n        .item-title-button{\n            display: inline-block;\n            margin: 0 0 0 10px;\n        }\n    }\n    @media (min-width: 1023px){\n        .item-title-button{\n            display: inline-block;\n            margin: 0 0 0 10px;\n        } \n    }\n}"],"names":[],"mappings":"AAAA,AAAA,WAAW,AAAA,CACP,OAAO,CAAE,CAAC,CACb,AAED,AAAK,IAAD,CAAC,4BAA4B,AAAC,CAgB9B,UAAU,CAAE,IAAI,CA6CnB,AA7DD,AAEQ,IAFJ,CAAC,4BAA4B,CAC7B,oBAAoB,CAChB,YAAY,AAAA,CACR,WAAW,CAAE,IAAI,CACjB,SAAS,CAAE,IAAI,CAClB,AALT,AAMO,IANH,CAAC,4BAA4B,CAC7B,oBAAoB,CAKjB,GAAG,AAAA,CACC,KAAK,CAAE,eAAe,CACtB,WAAW,CAAE,GAAG,CAChB,MAAM,CAAE,aAAa,CACxB,AAVR,AAiBI,IAjBA,CAAC,4BAA4B,CAiB7B,IAAI,AAAA,CACA,WAAW,CAAE,IAAI,CACpB,AAnBL,AAqBI,IArBA,CAAC,4BAA4B,CAqB7B,oBAAoB,AAAA,CAChB,aAAa,CAAE,IAAI,CAOtB,AA7BL,AAwBY,IAxBR,CAAC,4BAA4B,CAqB7B,oBAAoB,CAEhB,gBAAgB,CACZ,IAAI,AAAA,CACA,SAAS,CAAE,IAAI,CAClB,AA1Bb,AA+BQ,IA/BJ,CAAC,4BAA4B,CA8B7B,kBAAkB,CACd,oBAAoB,AAAA,CAChB,SAAS,CAAE,KAAK,CACnB,AAjCT,AAkCQ,IAlCJ,CAAC,4BAA4B,CA8B7B,kBAAkB,CAId,kBAAkB,AAAA,CACd,MAAM,CAAE,IAAI,CACf,AAGL,MAAM,CAAC,MAAM,MAAM,SAAS,EAAE,KAAK,EAvCvC,AAwCQ,IAxCJ,CAAC,4BAA4B,CAwCzB,kBAAkB,AAAA,CACd,OAAO,CAAE,KAAK,CACd,SAAS,CAAE,KAAK,CAChB,MAAM,CAAE,MAAM,CACjB,AA5CT,AA6CQ,IA7CJ,CAAC,4BAA4B,CA6CzB,kBAAkB,AAAA,CACd,aAAa,CAAE,IAAI,CACtB,CAEL,MAAM,EAAE,SAAS,EAAE,KAAK,OAAO,SAAS,EAAE,MAAM,EAjDpD,AAkDQ,IAlDJ,CAAC,4BAA4B,CAkDzB,kBAAkB,AAAA,CACd,OAAO,CAAE,YAAY,CACrB,MAAM,CAAE,UAAU,CACrB,CAEL,MAAM,EAAE,SAAS,EAAE,MAAM,EAvD7B,AAwDQ,IAxDJ,CAAC,4BAA4B,CAwDzB,kBAAkB,AAAA,CACd,OAAO,CAAE,YAAY,CACrB,MAAM,CAAE,UAAU,CACrB"}
\ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
new file mode 100644 (file)
index 0000000..4d14218
--- /dev/null
@@ -0,0 +1,53 @@
+var gulp = require('gulp');
+var rename = require('gulp-rename');
+var sass = require('gulp-sass');
+var maps = require('gulp-sourcemaps');
+
+function swallowError (error) {
+
+  // If you want details of the error in the console
+  console.log(error.toString())
+
+  this.emit('end')
+}
+
+function swallowError (error) {
+
+  // If you want details of the error in the console
+  console.log(error.toString());
+
+  this.emit('end');
+}
+
+gulp.task('sass_admin', function() {
+  return gulp.src('scss/admin.scss')
+    .pipe(maps.init())
+    .on('error', swallowError)
+    .pipe(sass({ 
+      outputStyle: 'compressed'
+  })).on('error', swallowError)
+  .pipe(rename('admin.css'))
+    .pipe(maps.write('.'))
+    .pipe(gulp.dest('css'));
+});
+gulp.task('sass_front', function() {
+    return gulp.src('scss/front.scss')
+      .pipe(maps.init())
+      .on('error', swallowError)
+      .pipe(sass({ 
+        outputStyle: 'compressed'
+    })).on('error', swallowError)
+    .pipe(rename('front.css'))
+      .pipe(maps.write('.'))
+      .pipe(gulp.dest('css'));
+  });
+
+gulp.task('watch', function () {
+  gulp.watch('scss/**/*.{scss,sass}', ['sass_admin','sass_front']);
+});
+
+gulp.task('build', ["sass_admin", "sass_front"]);
+
+gulp.task('runwatch', ["sass_admin", "sass_front"]);
+
+gulp.task('default', ["runwatch","watch"]);
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644 (file)
index 0000000..b25296d
--- /dev/null
@@ -0,0 +1,21 @@
+{
+  "name": "glm-member-db-buy-sell",
+  "version": "1.0.0",
+  "description": "=== GLM Members Database Buy Sell === Contributors: cscott@gaslightmedia.com Donate link: http://www.gaslightmedia.com Tags: Gaslight Media,Plugin,Buy Sell Requires at least: 3.0.1 Tested up to: 3.4 Stable tag: 4.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git@cvs2:WP-Plugins/glm-member-db-buy-sell"
+  },
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "gulp": "^3.9.1",
+    "gulp-rename": "^1.2.2",
+    "gulp-sass": "^3.1.0",
+    "gulp-sourcemaps": "^2.6.1"
+  }
+}
diff --git a/scss/admin.scss b/scss/admin.scss
new file mode 100644 (file)
index 0000000..24a178e
--- /dev/null
@@ -0,0 +1,43 @@
+#glm-admin-content-container .admin-item-label,
+#glm-admin-content-container .admin-item-input,
+#glm-admin-content-container .admin-item-list{
+    padding: 0;
+}
+.itemTitle-record{
+    float: left;
+}
+.admin-item-input textarea{
+   
+}
+.admin-new-item{
+    margin-bottom: 15px;
+}
+.admin-new-item .admin-new-item-link{
+    padding: 5px;
+    background: #3D84D0;
+    color: white;
+    text-decoration: none;
+    border-radius: 4px;
+}
+.no-padding{
+    padding: 0;
+}
+.no-margin{
+    margin: 0;
+}
+#glm-admin-content-container .admin-item-list-header{
+    margin-bottom: 20px;
+    padding-bottom: 2px;
+    border-bottom: 1px solid lightgray;
+}
+.admin-item-list-row{
+    padding-bottom: 5px;
+/*    border-bottom: 1px solid lightgray;*/
+}
+.item-company-list-header,.item-date-list-header, .item-title-list-header{
+    font-weight: bold;
+    font-size: 16px;
+}
+.admin-item-list-row:nth-child(odd){
+    background: #e3e3e5;
+}
diff --git a/scss/front.scss b/scss/front.scss
new file mode 100644 (file)
index 0000000..31b1485
--- /dev/null
@@ -0,0 +1,66 @@
+.no-padding{
+    padding: 0;
+}
+
+body .front-item-listings-wrapper {
+    .item-detail-wrapper{
+        .front-title{
+            font-weight: bold;
+            font-size: 20px;
+        }
+       div{
+           float: none !important;
+           line-height: 1.1;
+           margin: 8px 8px 8px 0;
+       }
+    }
+    // .front-item-search{
+    //     max-width: 530px;
+    //     margin: 0 auto;
+    // }
+    margin-top: 20px;
+    span{
+        font-weight: bold;
+    }
+   
+    .front-item-list-row{
+        margin-bottom: 20px;
+        .item-title-list{
+            span{
+                font-size: 20px;
+            }
+        }
+
+    }
+    .item-title-search{
+        #item_title_dropdown{
+            max-width: 450px;
+        }
+        .item-title-button{
+            height: 39px;
+        }
+    }
+    
+    @media screen and (max-width: 641px){
+        .item-title-button{
+            display: block;
+            max-width: 100px;
+            margin: 0 auto;
+        }
+        .front-item-search{
+            margin-bottom: 20px;
+        }
+    }
+    @media (min-width: 639px) and (max-width: 1025px){
+        .item-title-button{
+            display: inline-block;
+            margin: 0 0 0 10px;
+        }
+    }
+    @media (min-width: 1023px){
+        .item-title-button{
+            display: inline-block;
+            margin: 0 0 0 10px;
+        } 
+    }
+}
\ No newline at end of file
index e69de29..b9f8713 100644 (file)
@@ -0,0 +1,390 @@
+{include file='admin/header.html'}
+
+{if ($option == 'add' || $haveItem)}
+    <a href="{$thisUrl}?page={$thisPage}&glm_action=index" class="button button-secondary glm-button glm-right">Return to items List</a>
+
+  {if $option == 'edit' || $option == 'update'}
+    <a id="deleteItemButton" class="button button-secondary glm-button glm-right">Delete this Item</a>
+    <h2>Edit Item Posting
+  {else}
+    <h2>Add New Item Posting
+  {/if}
+        &nbsp;&nbsp;&nbsp;
+        {if $itemUpdated}<span class="glm-notice glm-flash-updated">Item Updated</span>{/if}
+        {if $itemUpdateError}<span class="glm-error glm-flash-updated">Item Update Error</span>{/if}
+        {if $itemAdded}<span class="glm-notice glm-flash-updated">Item Added</span>{/if}
+        {if $itemAddError}<span class="glm-error glm-flash-updated">Item Add Error</span>{/if}
+    </h2>
+
+    {if $itemUpdateError || $itemAddError}
+      <h1 class="glm-error">NOTICE: Your Item has not yet been submitted.<br>Please select the tabs indicating a problem, correct the indicated fields and resubmit.</h1>
+    {else}
+    {/if}
+    <form action="{$thisUrl}?page={$thisPage}" method="post" enctype="multipart/form-data">
+        <input type="hidden" name="glm_action" value="index">
+    {if $haveItem}
+        <input type="hidden" name="option" value="update">
+        <input type="hidden" name="item" value="{$item.fieldData.id}">
+    {else}
+        <input type="hidden" name="option" value="insert">
+    {/if}
+
+       <h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
+            <a id="glm-item-descr" data-show-table="glm-table-descr" class="glm-item-tab nav-tab nav-tab-active">Item Postings</a>
+        </h2>
+        <!-- ITEM TITLE -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                Item 
+            </div>
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-input">
+                <select id="item_title" data-id="title" name="title">
+                    <option value="">Select a Item Title</option>
+                    {$itemTitles|@print_r}
+                    {foreach from=$itemTitles item=j}
+                        {if 'fieldData'|array_key_exists:$item}
+                            <option value="{$j.id}" {if $item.fieldData.title.name == {$j.item_title}} selected="selected"{/if}>
+                        {else if}
+                            <option value="{$j.id}">
+                        {/if}
+                            {$j.item_title}
+                        </option>
+                    {/foreach}
+                </select>
+            </div>
+            <div class="glm-small-12 glm-medium-8 glm-columns admin-item-input">
+                <label for="new_title">New Item Title</label>
+               <input id="new_item_title" type="text" name="new_item_title">
+            </div>
+        </div>
+        <!-- MEMBER for admins only-->
+        {if !$lockedToMember}
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                    Member
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                <select id="member" data-id="member" name="member">
+                    <option value="">Select a Member</option>
+                    {foreach from=$memberList item=m}
+                        {if 'fieldData'|array_key_exists:$item}
+                            <option value="{$m.id}" {if $item.fieldData.member.name == {$m.name}} selected="selected"{/if}>
+                        {else if}
+                            <option value="{$m.id}">
+                        {/if}
+                            {$m.name}
+                        </option>
+                    {/foreach}
+                </select>
+            </div>
+        </div>
+        {else}
+        <!-- hidden MEMBER ID field here -->
+        <input type="hidden" name="member" value="{$item.fieldData.member.value}">
+        {/if}
+
+        <!-- COMPANY -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                   Company
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                <input type="text" name="company" {if $item.fieldData.company} value='{$item.fieldData.company}' {/if}>
+            </div>
+        </div>
+        <!-- FACILITY OPERATION -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                    Facility Operation
+            </div>
+            
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                {php}
+                    wp_editor(
+              
+                        '{$item.fieldData.facility_operation|escape:quotes}', 
+   
+               
+                    'facility_operation', array(
+                        'media_buttons' => false,
+                        'tinymce'      => false,
+                        // 'quicktags' => false,
+                        // 'wpautop' => false,  NOTE: Dont's use. Problem when numerous spaces before text.
+                        'textarea_name' => 'facility_operation',
+                        'editor_height' => 200,     // Height in px, overrides editor_rows
+                            // 'textarea_rows' => 8
+                    ));
+                {/php}
+            </div>
+        </div>
+        <!-- DESCRIPTION -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                   Description
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                {php}
+                    wp_editor(
+                  
+                        '{$item.fieldData.descr|escape:quotes}', 
+              
+                    'descr', array(
+                        'media_buttons' => false,
+                        'tinymce'      => false,
+                        // 'quicktags' => false,
+                        // 'wpautop' => false,  NOTE: Dont's use. Problem when numerous spaces before text.
+                        'textarea_name' => 'descr',
+                        'editor_height' => 200,     // Height in px, overrides editor_rows
+                            // 'textarea_rows' => 8
+                    ));
+                {/php}
+            </div>
+        </div>
+        <!-- ITEM REQUIREMENTS -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                 Item Requirements   
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                {php}
+                    wp_editor(
+               
+                        '{$item.fieldData.requirements|escape:quotes}', 
+     
+                    'requirements', array(
+                        'media_buttons' => false,
+                        'tinymce'      => false,
+                        // 'quicktags' => false,
+                        // 'wpautop' => false,  NOTE: Dont's use. Problem when numerous spaces before text.
+                        'textarea_name' => 'requirements',
+                        'editor_height' => 200,     // Height in px, overrides editor_rows
+                            // 'textarea_rows' => 8
+                    ));
+                {/php}
+            </div>
+        </div>
+        <!-- BENEFITS -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                  Item Benefits 
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                {php}
+                    wp_editor(
+                
+                        '{$item.fieldData.benefits|escape:quotes}', 
+         
+   
+                    'benefits', array(
+                        'media_buttons' => false,
+                        'tinymce'      => false,
+                        // 'quicktags' => false,
+                        // 'wpautop' => false,  NOTE: Dont's use. Problem when numerous spaces before text.
+                        'textarea_name' => 'benefits',
+                        'editor_height' => 200,     // Height in px, overrides editor_rows
+                            // 'textarea_rows' => 8
+                    ));
+                {/php}
+            </div>
+        </div>
+        <!-- SALARY -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                   Salary 
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                <input type="text" name="salary" {if $item.fieldData.salary} value='{$item.fieldData.salary}' {/if}>
+            </div>
+        </div>
+        <!-- POSITION AVAILABLE -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                    Position Available
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                <input type="text" name="position_available" {if $item.fieldData.position_available} value='{$item.fieldData.position_available}' {/if}>
+            </div>
+        </div>
+       <!-- DURATION -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                Item Duration    
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                <input type="text" name="duration" {if $item.fieldData.duration} value='{$item.fieldData.duration}' {/if}>
+            </div>
+        </div>
+       <!-- DEADLINE -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                Deadline    
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                <input type="text" name="deadline" {if $item.fieldData.deadline} value='{$item.fieldData.deadline}' {/if}>
+            </div>
+        </div>
+       <!-- ITEM LOCATION -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                Item Location    
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                {php}
+                    wp_editor(
+         
+                        '{$item.fieldData.item_location|escape:quotes}', 
+      
+                    'item_location', array(
+                        'media_buttons' => false,
+                        'tinymce'      => false,
+                        // 'quicktags' => false,
+                        // 'wpautop' => false,  NOTE: Dont's use. Problem when numerous spaces before text.
+                        'textarea_name' => 'item_location',
+                        'editor_height' => 200,     // Height in px, overrides editor_rows
+                            // 'textarea_rows' => 8
+                    ));
+                {/php}
+            </div>
+        </div>
+        <!-- SEND RESUME TO  -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                    Send Resume To
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                {php}
+                wp_editor(
+     
+                    '{$item.fieldData.resume_location|escape:quotes}', 
+  
+                'resume_location', array(
+                    'media_buttons' => false,
+                    'tinymce'      => false,
+                    // 'quicktags' => false,
+                    // 'wpautop' => false,  NOTE: Dont's use. Problem when numerous spaces before text.
+                    'textarea_name' => 'resume_location',
+                    'editor_height' => 200,     // Height in px, overrides editor_rows
+                        // 'textarea_rows' => 8
+                ));
+            {/php}
+            </div>
+        </div>
+       <!-- CONTACT NAME -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                    Contact Name
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                <input type="text" name="contactname" {if $item.fieldData.contactname} value='{$item.fieldData.contactname}' {/if}>
+            </div>
+        </div>
+       <!-- EMAIL TO -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                    Contact Email
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                <input type="text" name="email_location" {if $item.fieldData.email_location} value='{$item.fieldData.email_location}' {/if}>
+            </div>
+        </div>
+       <!-- CONTACT PHONE -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                    Contact Phone
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                <input type="text" name="contactphone" {if $item.fieldData.contactphone} value='{$item.fieldData.contactphone}' {/if}>
+            </div>
+        </div>
+       <!-- VISIBLE -->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                    Visible
+            </div>
+             <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                    <input id="item-visible" data-id="item-visible" type="checkbox" name="visible" class="visible-checkbox" {if $item.fieldData.visible.value} checked{/if}>
+            </div>
+        </div>
+        <!-- ITEM EXPIRATION-->
+        <div class="glm-item-row glm-row">
+            <div class="glm-small-12 glm-medium-2 glm-columns admin-item-label">
+                Item Expiration    
+            </div>
+            <div class="glm-small-12 glm-medium-5 glm-columns admin-item-input">
+                <select id="item_expiration" data-id="item_expiration" name="item_expiration">
+                    <option value="">Number of Days</option>
+                    {foreach $item.fieldData.item_expiration.list as $exp}
+                        {if 'fieldData'|array_key_exists:$item}
+                                <option value="{$exp.value}" {if $item.fieldData.item_expiration.value == {$exp.value}} selected="selected"{/if}>
+                            {else if}
+                                <option value="{$exp.value}">
+                            {/if}
+                            {$exp.name}
+                        </option>
+                    {/foreach}
+                </select>
+            </div>
+        </div>
+        
+        
+        <input id="updateItem" type="submit" value="{if $haveItem}Update Item{else}Save New Item{/if}">
+    </form>
+
+{else} <!-- Can just display -->
+
+    <h3>Sorry, no Item found or permission not granted.</h3>
+
+{/if}
+
+    <!-- Delete Item Dialog Box -->
+
+    <div id="deleteItemDialog" class="glm-dialog-box" title="Delete Item">
+        <center>
+            <p><a id="deleteItemCancel" class="button button-primary">Cancel</a></p>
+            <p><input id="deleteitemubmit" type="submit" value="Delete this Item"></p>
+        </center>
+        <div class="glm-item-container">
+            <p><center><span class="glm-error">WARNING:</span></center></p>
+            <p>
+                <span class="glm-warning">Clicking the "Delete this Item" button above will
+                delete all of the data and images associated with this Item.
+                </span>
+            </p>
+            <p>
+                <span class="glm-error">
+                    Once deleted, this information will no longer be available and cannot be retrieved!
+                    If you are unsure that you want to completely remove this data, consider changing the status
+                    of this Item to "Archived" instead.
+                </span>
+            </p>
+        </div>
+    </div>
+    <script type="text/javascript">
+        jQuery(document).ready(function($) {
+
+        {if $haveItem}
+            // Delete Item dialog
+            $("#deleteItemDialog").dialog({
+                autoOpen: false,
+                minWidth: 400,
+                dialogClass: "glm-dialog-no-close"
+            });
+            $('#deleteItemButton').click( function() {
+                $('#deleteItemDialog').dialog('open');
+            });
+            $('#deleteItemCancel').click( function() {
+                $("#deleteItemDialog").dialog("close");
+            });
+            $('#deleteitemubmit').click( function() {
+                window.location.replace("{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&item={$item.fieldData.id}");
+            });
+        {/if}
+            
+            // Flash certain elements for a short time after display
+            $(".glm-flash-updated").fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500);
+
+        });
+    </script>
+
+
+{include file='admin/footer.html'}
index 47b00b9..f00bf5c 100644 (file)
@@ -2,33 +2,33 @@
 {if $haveMember}
 <input type="hidden" name="member" value="{$memberID}">
 {if !$lockedToMember}
-<input type="hidden" name="glm_action" value="buySell">
+<input type="hidden" name="glm_action" value="item">
 {/if}
 <input type="hidden" name="option" value="list">
 {/if}
     {if $itemData}
-        <div class="admin-new-job">
-            <a class="admin-new-job-link" href="{$thisUrl}?page={$thisPage}&glm_action=index&option=add">New item</a>
+        <div class="admin-new-item">
+            <a class="admin-new-item-link" href="{$thisUrl}?page={$thisPage}&glm_action=index&option=add">New item</a>
         </div>
-        <div class="admin-job-list-header glm-row">
-            <div class="job-title-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Topic</div>
-            <div class="job-company-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Forsale Item</div>
-            <div class="job-date-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Item Post Date</div>
-            <div class="job-date-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Post For</div>
+        <div class="admin-item-list-header glm-row">
+            <div class="item-title-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Topic</div>
+            <div class="item-company-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Forsale Item</div>
+            <div class="item-date-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Item Post Date</div>
+            <div class="item-date-list-header glm-small-12 glm-medium-4 glm-large-3 glm-columns no-padding">Post For</div>
         </div>
         {foreach $itemData as $item=>$data}
-            <div class='glm-row admin-job-list-row'>
-                <div class="glm-small-12 glm-columns admin-job-list">
-                    <div class="glm-row admin-job-data">
-                        <div class="job-title-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.topic.name}</div>
-                        <div class="job-company-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.title}</div>
-                        <div class="job-date-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.post_date.timestamp|date_format:"%Y-%m-%d"}</div>
-                        <div class="job-date-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.item_expiration.name}</div>
+            <div class='glm-row admin-item-list-row'>
+                <div class="glm-small-12 glm-columns admin-item-list">
+                    <div class="glm-row admin-item-data">
+                        <div class="item-title-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.topic.name}</div>
+                        <div class="item-company-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.title}</div>
+                        <div class="item-date-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.post_date.timestamp|date_format:"%Y-%m-%d"}</div>
+                        <div class="item-date-list glm-small-12 glm-large-3 glm-columns no-padding">{$data.item_expiration.name}</div>
                     </div>
                 </div>
-                <div class="glm-small-12 glm-columns admin-job-list">
-                    <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=edit&job={$data.id}">Edit</a>
-                    <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&job={$data.id}">Delete</a>
+                <div class="glm-small-12 glm-columns admin-item-list">
+                    <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=edit&item={$data.id}">Edit</a>
+                    <a href="{$thisUrl}?page={$thisPage}&glm_action=index&option=delete&item={$data.id}">Delete</a>
                 </div>
             </div>
         {/foreach}