Skip to content

Commit

Permalink
some link fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bryngo committed Dec 3, 2018
1 parent cce5012 commit 3203d1f
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 3 deletions.
2 changes: 2 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@ app.use(function(err, req, res, next) {
res.render('error');
});



module.exports = app;
29 changes: 29 additions & 0 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ var multer = require('multer');
var mime = require('mime');
var ObjectID = require('mongodb').ObjectID;
var dateFormat = require('dateformat');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

// HTML to md or md to HTML
var showdown = require('showdown');
Expand All @@ -22,6 +24,13 @@ var animequeries = require('./animeQueries');
var animeEpQueries = require('./animeEpQueries');
var variableQueries = require('./variablesQueries');

// schema for storing images
var Item = new Schema({
img: { data: Buffer, contentType: String }
});

var PhotoSchema = mongoose.model('PhotoSchema', Item);

/**
* @route: /
*/
Expand Down Expand Up @@ -429,6 +438,26 @@ router.get('/single-anime', function(req, res) {

});


/**
* @route: /photosEdit
* @requires: permission: 1
*/
router.get('/photosEdit', (req, res, next) => {

// if(!isAdmin(req)) {
// res.render('error', {
// title: "uh oh.",
// reason: "You don't have permission to view this page!"
// });
// }

res.render('admin/photosEdit', {
title : 'Photos Edit'
});
});


/* For submitting a message from the home page */
router.post('/wallsubmit', function(req, res) {

Expand Down
77 changes: 77 additions & 0 deletions views/admin/photosEdit.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
doctype html
//
Story by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
html
head
title #{title}
meta(charset='utf-8')
meta(name='viewport', content='width=device-width, initial-scale=1')
link(rel='stylesheet', href='css/main.css')
script(src='js/animeEdit.js', type="text/javascript")
script(src='js/jquery.min.js')


body
// Seven
section.wrapper.style1.align-center
.inner.medium
h2 Photo Post

- var formCaption = '';
- var formDescription = '';
- var pictureID = '';

form
.field.half.first
label(for='caption') Caption
input#caption(type='text', name='caption', value='#{formCaption}')
.field.half.first
label(for='description') Description
input#description(type='text', name='description', value='#{formDescription}')
.field.half.first
input#copy(type='checkbox', name='copy')
label(for='copy') Email me a copy of this message
.field.half
input#human(type='checkbox', name='human', checked='')
label(for='human') I am a human and not a robot
ul.actions
li
button#submit(type='submit', onclick="animeSubmit(\'#{pictureID}\')", value='Post') Post
//section.wrapper.style1.align-center
.inner.medium
h2 Anime Titles
div.table-wrapper
table.alt
thead
tr
th Title
th Rating
th Favorite Character
th Review
td Wallpaper Path
th Modify
tbody
each anime in animes
- var anime_title = anime['title'];
- var rating = anime['rating'];
- var fav_char = anime['fav_char'];
- var review = anime['review'];
- if (review.length > 50) review = review.substr(0, 50) + '...';
- var id = anime['_id'];
- var wallpaper = anime['wallpaper'];
tr
td #{anime_title}
td #{rating}
td #{fav_char}
td #{review}
td #{wallpaper}
img(src='#{wallpaper}', alt='')
td
button#animeDelete(type='submit', onclick="animeDelete(\'#{id}\')", value='Post') Delete
button#animeEdit(type='submit', target='_blank', onclick="animeModify(\'#{id}\')", value='Post') Modify
button#animeAddEp(type='submit', onclick="animeEpSubmitRedirect(\'#{id}\')", value='Get') Add Episode
6 changes: 3 additions & 3 deletions views/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ html
a.icon.style2.fa-facebook(href='https://www.facebook.com/bryan.ngo.7', target='_blank')
span.label Facebook
.image
img(src='images/banner.jpg', alt='')
img(src='images/banner2.JPG', alt='')
// Two
section#first.spotlight.style1.orient-right.invert.content-align-left.image-position-center.onscroll-image-fade-in
.content
h2 Portfolio / Resume
ul.actions.vertical
li
a.button(href='#') hire-me-?.pdf
a.button(href='assets/resume.pdf') hire-me-?.pdf
.image
img(src='images/spotlight01.jpg', alt='')
// Three
Expand All @@ -101,7 +101,7 @@ html
h2 Photography
ul.actions.vertical
li
a.button(href='#') Needs more bokeh
a.button(href='https://www.instagram.com/bryngo.jpg/') Needs more bokeh
.image
img(src='images/spotlight02.jpg', alt='')
// Four
Expand Down

0 comments on commit 3203d1f

Please sign in to comment.