-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP][DO NOT MERGE]Album feature #339
base: master
Are you sure you want to change the base?
Conversation
And rebasing entire atmos-18 branch. |
We talked about not rebasing the entire branch and I thought we agreed that this issue should be resolved on master and just cherry-picked on atmos-2018. |
I think we can cherry pick later. Right now rebased to be consistent with pybits commits. We can later remove the sponsors and fob commits. |
c0b3023
to
f7d5016
Compare
placeholder: "E.g: FOB,SPONS", | ||
editable: true, | ||
type: "select", | ||
options: ["FOB", "SPONSORS"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You sure about using a "select" here? Also, I suggest we keep such identifier names consistent by enforcing lowercase and hyphen separated strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. They don't have any other option , neither can they write it on their own.
label: "Title", | ||
name:"title", | ||
editable: true, | ||
type: "textarea", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Titles probably shouldn't be multiline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cons of making in multi-line ?
typeahead: false, | ||
none: true | ||
}); | ||
module.exports = fields; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline thingy.
var model = mongoose.model('images', imageSchema); | ||
var images = []; // stores image names as string. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too many blank lines?
routes/api/services/images.js
Outdated
var imagePath = (req.body.image).trim(); | ||
|
||
fs.readdir("public/static/data/images", function(err, files) { | ||
files.forEach(file => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too keen about this logic here. The image upload mixin provides the path to the image just uploaded as well, and that should then be sent by the concerned form.
.done(function (response) {
$(editor).find('.status').addClass("success");
$(editor).attr('value', response.path);
}
See static/scripts/portal.js
function submit_item()
for how to use the uploaded image name.
text: 'Images', | ||
route: '/images', | ||
}; | ||
if (superuser) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Braces around the if block.
script(type="text/javascript" src="/static/lib/jquery.uploadPreview.min.js") | ||
.immersive-wrapper | ||
#add-images-album-wrapper | ||
- var form = { fields: fields, method: "PUT", action: "/api/users/me"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidental remnant of copy-paste in the action
field. Put as blank or remove it completely, I suppose, since AJAX is handling it.
@@ -0,0 +1,10 @@ | |||
include ../mixins/form | |||
script(type="text/javascript" src="/static/lib/jquery.uploadPreview.min.js") | |||
.immersive-wrapper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure about using immersive-wrapper here? Use generic div instead, as immersive CSS might sometime later cause this particular page to look out of place from the rest of the portals.
#submit-button | ||
button Submit | ||
script(src="/static/scripts/add-images.js") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace.
@@ -4,9 +4,10 @@ mixin imgUpload(data) | |||
input(type="file" required=data.required id="field-#{data.name}" name="field-#{data.name}" class="cropit-image-input") | |||
div(class="cropit-preview", id="cropit-preview-#{data.id}") | |||
div.status | |||
i.icon-check.response(id="export-img-#{data.id}") | |||
i.icon-check.response(id="export-img-#{data.id}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a lot of minor comments, and one major one. Looks great so far, the general direction is awesome.
3e13d25
to
6eec30f
Compare
No description provided.