Skip to content
Permalink
Browse files

Updated photo page

  • Loading branch information...
davidmerfield committed Mar 9, 2019
1 parent 8151fe6 commit e657c2934aafb9edd4c4255671059b96596b5816
@@ -57,18 +57,19 @@ settings.get("/settings/urls", function(req, res, next) {
next();
});

settings.get(
settings.use(
"/settings/profile",
load.menu,
load.timezones,
load.dates,
function(req, res, next) {
res.locals.breadcrumbs.add("Profile", "profile");
res.locals.setup_title = true;
next();
}
);

settings.get("/settings/menu", load.menu);
settings.get("/settings/profile/menu", load.menu);
settings.get("/settings/date", load.timezones, load.dates);
settings.get("/settings/services", load.plugins);
settings.get("/settings/urls", load.permalinkFormats);
@@ -127,14 +128,29 @@ settings
res.render("theme/past", { title: "Past templates" });
});


settings.get("/settings/:section/:view", function(req, res) {
var uppercaseName = req.params.view;

uppercaseName = uppercaseName[0].toUpperCase() + uppercaseName.slice(1);

res.locals.breadcrumbs.add(uppercaseName, req.params.view);
res.locals.partials.subpage = "settings/" + req.params.view;
res.render("settings/subpage", { host: process.env.BLOT_HOST });
});


settings.get("/settings/:view", function(req, res) {
var uppercaseName = req.params.view;

uppercaseName = uppercaseName[0].toUpperCase() + uppercaseName.slice(1);

if (uppercaseName === "Urls") uppercaseName = "URLs";

res.locals.breadcrumbs.add(uppercaseName, req.params.view);
if (uppercaseName !== "Profile") {
res.locals.breadcrumbs.add(uppercaseName, req.params.view);
}

res.locals.partials.subpage = "settings/" + req.params.view;
res.render("settings/subpage", { host: process.env.BLOT_HOST });
});
@@ -24,6 +24,10 @@
<span class="label">Profile</span>
<span class="center">

{{#blog.avatar}}<span class="photo-holder" style="margin-right:6px">
<img src="{{blog.avatar}}?handle={{handle}}">

</span> {{/blog.avatar}}


{{blog.title}}
@@ -0,0 +1,25 @@
<input type="hidden" name="redirect" value="/settings/profile/photo">

<label>Photo</label>
{{#blog.avatar}} <span>
<img style="max-width:64px;max-height:64px;margin:6px 6px 0 0 ;" src="{{blog.avatar}}" class="{{#blog.roundAvatar}}rounded{{/blog.roundAvatar}}" />
</span>
<br>

<button type="submit" style="font-size:14px;color:#365899;" name="avatar" value="">Remove current photo</button>

{{/blog.avatar}}

<section style="flex-grow:1">

{{#blog.avatar}}
<span style="border-top:1px solid rgba(0,0,0,0.05);display:block;padding: 0 0 6px;margin-bottom:6px">
<span style="margin-top:0;color:rgb(158, 154, 152);font-size:14px;display:inline;margin-right:10px">Select new photo:</span>
{{/blog.avatar}}
<input type='file' id="avatarUpload" style="display:inline;margin:0" name='avatar' />
</span>
{{#blog.avatar}}

{{/blog.avatar}}
</section>
</div>
@@ -1,50 +1,42 @@
<style type="text/css">
form label {text-transform:none;letter-spacing:0;color:rgb(158, 154, 152);font-size:16px}
p a{color:#365899;text-decoration:none}
p a:hover{text-decoration: underline;}</style>
<label for="title">Title</label>
<input type="hidden" name="redirect" value="/settings/profile">
<input type="text" autofocus name="title" value="{{blog.title}}">

<hr>

<label>Photo</label>

{{#blog.avatar}}
<div style="float:left;margin-right:20px;border-right:1px solid rgba(0,0,0,0.03)">
<img style="max-width:82px;max-height:82px;float:left" src="{{blog.avatar}}" class="{{#blog.roundAvatar}}rounded{{/blog.roundAvatar}}" />

</div>

<div style="float:left;">

<label style="margin-top:0">
<!-- <input type='hidden' value='off' name='roundAvatar'>
<input {{#blog.roundAvatar}}checked{{/blog.roundAvatar}} type="checkbox" name="roundAvatar"/> Make my photo rounded
--></label>


form label {
text-transform: none;
letter-spacing: 0;
color: rgb(158, 154, 152);
font-size: 16px
}
form .line {padding-top: 16px;padding-bottom: 16px}
p a {
color: #365899;
text-decoration: none
}
p a:hover {
text-decoration: underline;
}
</style>
<div class="line">
<label for="title">Title</label>
<input type="hidden" name="redirect" value="/settings/profile">
<input type="text" name="title" value="{{blog.title}}">
</div>

{{/blog.avatar}}

<section class="imageUpload" style="width:50%;float:left;">
{{#blog.avatar}}
<span style="margin-top:0;color:#aaa">Select new photo:</span>
{{/blog.avatar}}
<input type='file' id="avatarUpload" name='avatar' />
{{#blog.avatar}}
<button type="submit" name="avatar" value="">Remove photo</button>

{{/blog.avatar}}
</section>
<div class="clear"></div>
<a class="line" href="/settings/profile/photo">
<span class="label">Photo</span>
{{#blog.avatar}} <span>
<img style="max-width:48px;max-height:48px;margin:6px 6px 0 0 ;" src="{{blog.avatar}}" class="{{#blog.roundAvatar}}rounded{{/blog.roundAvatar}}" />
</span>
<span class="right">Edit</span>

{{/blog.avatar}}
{{^blog.avatar}}
<span class="right">Upload a photo</span>
{{/blog.avatar}}

<hr>


<a class="line" href="/settings/menu" style="margin:0 -20px">
</section>
</a>
<a class="line" href="/settings/profile/menu" style="">
<label>Menu</label>
<span class="center">
{{#blog.menu}}<span class="tablet">{{label}}</span>{{/blog.menu}}
@@ -54,26 +46,23 @@
<span class="right" style="padding-left:0">Edit</span>
</a>

<label>
Timezone<br />
<select name="timeZone" style="max-width:300px">
{{#timeZones}}
<option value="{{value}}" {{selected}}>{{time}} {{value}}</option>
{{/timeZones}}
</select>
</label>

<label>
In what order do you write your dates?<br />
<select name="dateFormat">
{{#dateFormats}}
<option value="{{value}}" {{selected}}>{{date}}</option>
{{/dateFormats}}
</select>
</label>





<div class="clear"></div><br>
<div class="line" style="border-bottom:none">
<label>
In what order do you write your dates?<br />
<select style="color:#000;margin-top:11px" name="dateFormat">
{{#dateFormats}}
<option value="{{value}}" {{selected}}>{{date}}</option>
{{/dateFormats}}
</select>
</label>
<label style="margin-top:20px">
Your timezone<br />
<select style="color:#000;margin-top:11px" name="timeZone" style="max-width:300px">
{{#timeZones}}
<option value="{{value}}" {{selected}}>{{time}} {{value}}</option>
{{/timeZones}}
</select>
</label>


</div>
@@ -1,5 +1,6 @@

<form method='post' {{^setup}}style="padding: 20px 20px"{{/setup}} {{#setup}}style="padding:20px 0"{{/setup}} action='/settings' enctype='multipart/form-data'>
<style type="text/css">form label {padding-top: 0} hr {margin: 20px 0}
</style>
<form method='post' {{^setup}}style="padding: 0 0"{{/setup}} {{#setup}}style="padding:20px 0"{{/setup}} action='/settings' enctype='multipart/form-data'>


<input type="hidden" name="_csrf" value="{{csrftoken}}">
@@ -10,7 +11,7 @@
<br>
<div class="buttons">
<button type="submit"onclick="this.form.submit();this.disabled=true">Save changes</button>
<a href="/">Cancel</a>
<a href="/settings">Cancel</a>
</div>
<br>
</form>

0 comments on commit e657c29

Please sign in to comment.
You can’t perform that action at this time.