From 6b0791b0b119aed3a122aa228db463790f3b1cac Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 19 Sep 2017 13:16:16 -0400 Subject: [PATCH] setting up gulp and basic list and edit view files setting up the vasic edit and list view pages for admin --- .gitignore | 1 + css/admin.css | 3 + css/admin.css.map | 1 + css/front.css | 3 + css/front.css.map | 1 + gulpfile.js | 53 +++++ package.json | 21 ++ scss/admin.scss | 43 ++++ scss/front.scss | 66 ++++++ views/admin/buySell/edit.html | 390 ++++++++++++++++++++++++++++++++++ views/admin/buySell/list.html | 36 ++-- 11 files changed, 600 insertions(+), 18 deletions(-) create mode 100644 .gitignore create mode 100644 css/admin.css create mode 100644 css/admin.css.map create mode 100644 css/front.css create mode 100644 css/front.css.map create mode 100644 gulpfile.js create mode 100644 package.json create mode 100644 scss/admin.scss create mode 100644 scss/front.scss diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/css/admin.css b/css/admin.css new file mode 100644 index 0000000..c033154 --- /dev/null +++ b/css/admin.css @@ -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 index 0000000..6bd1f39 --- /dev/null +++ b/css/admin.css.map @@ -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 index 0000000..16f0cb3 --- /dev/null +++ b/css/front.css @@ -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 index 0000000..4b05f66 --- /dev/null +++ b/css/front.css.map @@ -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 index 0000000..4d14218 --- /dev/null +++ b/gulpfile.js @@ -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 index 0000000..b25296d --- /dev/null +++ b/package.json @@ -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 index 0000000..24a178e --- /dev/null +++ b/scss/admin.scss @@ -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 index 0000000..31b1485 --- /dev/null +++ b/scss/front.scss @@ -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 diff --git a/views/admin/buySell/edit.html b/views/admin/buySell/edit.html index e69de29..b9f8713 100644 --- a/views/admin/buySell/edit.html +++ b/views/admin/buySell/edit.html @@ -0,0 +1,390 @@ +{include file='admin/header.html'} + +{if ($option == 'add' || $haveItem)} + Return to items List + + {if $option == 'edit' || $option == 'update'} + Delete this Item +

Edit Item Posting + {else} +

Add New Item Posting + {/if} +     + {if $itemUpdated}Item Updated{/if} + {if $itemUpdateError}Item Update Error{/if} + {if $itemAdded}Item Added{/if} + {if $itemAddError}Item Add Error{/if} +

+ + {if $itemUpdateError || $itemAddError} +

NOTICE: Your Item has not yet been submitted.
Please select the tabs indicating a problem, correct the indicated fields and resubmit.

+ {else} + {/if} +
+ + {if $haveItem} + + + {else} + + {/if} + + + +
+
+ Item +
+
+ +
+
+ + +
+
+ + {if !$lockedToMember} +
+
+ Member +
+
+ +
+
+ {else} + + + {/if} + + +
+
+ Company +
+
+ +
+
+ +
+
+ Facility Operation +
+ +
+ {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} +
+
+ +
+
+ Description +
+
+ {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} +
+
+ +
+
+ Item Requirements +
+
+ {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} +
+
+ +
+
+ Item Benefits +
+
+ {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} +
+
+ +
+
+ Salary +
+
+ +
+
+ +
+
+ Position Available +
+
+ +
+
+ +
+
+ Item Duration +
+
+ +
+
+ +
+
+ Deadline +
+
+ +
+
+ +
+
+ Item Location +
+
+ {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} +
+
+ +
+
+ Send Resume To +
+
+ {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} +
+
+ +
+
+ Contact Name +
+
+ +
+
+ +
+
+ Contact Email +
+
+ +
+
+ +
+
+ Contact Phone +
+
+ +
+
+ +
+
+ Visible +
+
+ +
+
+ +
+
+ Item Expiration +
+
+ +
+
+ + + +
+ +{else} + +

Sorry, no Item found or permission not granted.

+ +{/if} + + + +
+
+

Cancel

+

+
+
+

WARNING:

+

+ Clicking the "Delete this Item" button above will + delete all of the data and images associated with this Item. + +

+

+ + 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. + +

+
+
+ + + +{include file='admin/footer.html'} diff --git a/views/admin/buySell/list.html b/views/admin/buySell/list.html index 47b00b9..f00bf5c 100644 --- a/views/admin/buySell/list.html +++ b/views/admin/buySell/list.html @@ -2,33 +2,33 @@ {if $haveMember} {if !$lockedToMember} - + {/if} {/if} {if $itemData} -
- New item + -
-
Topic
-
Forsale Item
-
Item Post Date
-
Post For
+
+
Topic
+
Forsale Item
+
Item Post Date
+
Post For
{foreach $itemData as $item=>$data} -
-
-
-
{$data.topic.name}
-
{$data.title}
-
{$data.post_date.timestamp|date_format:"%Y-%m-%d"}
-
{$data.item_expiration.name}
+
+
+
+
{$data.topic.name}
+
{$data.title}
+
{$data.post_date.timestamp|date_format:"%Y-%m-%d"}
+
{$data.item_expiration.name}
-
- Edit - Delete +
+ Edit + Delete
{/foreach} -- 2.17.1