[WIP][DO NOT MERGE]Album feature#339
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.
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.
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.
Titles probably shouldn't be multiline.
There was a problem hiding this comment.
Cons of making in multi-line ?
| typeahead: false, | ||
| none: true | ||
| }); | ||
| module.exports = fields; No newline at end of file |
| var model = mongoose.model('images', imageSchema); | ||
| var images = []; // stores image names as string. | ||
|
|
||
|
|
| 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.
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) |
| 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.
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.
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") | ||
|
No newline at end of file |
| 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}") |
aero31aero
left a comment
There was a problem hiding this comment.
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.