0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-04 02:01:58 -05:00

Merge branch 'master' of github.com:TryGhost/Ghost into usersAPI

This commit is contained in:
Jacob Gable 2013-05-24 16:10:19 -05:00
commit cc45be636f
15 changed files with 50 additions and 47 deletions

10
app.js
View file

@ -30,7 +30,7 @@
ghost.app().use(I18n.load(ghost)); ghost.app().use(I18n.load(ghost));
ghost.app().use(express.bodyParser()); ghost.app().use(express.bodyParser());
ghost.app().use(express.cookieParser('try-ghost')); ghost.app().use(express.cookieParser('try-ghost'));
ghost.app().use(express.cookieSession({ cookie: { maxAge: 60000 }})); ghost.app().use(express.cookieSession({ cookie: { maxAge: 60000000 }}));
ghost.app().use(ghost.initTheme(ghost.app())); ghost.app().use(ghost.initTheme(ghost.app()));
ghost.app().use(flash()); ghost.app().use(flash());
// bind locals - options which appear in every view - perhaps this should be admin only // bind locals - options which appear in every view - perhaps this should be admin only
@ -63,13 +63,13 @@
* @todo auth should be public auth not user auth * @todo auth should be public auth not user auth
*/ */
ghost.app().get('/api/v0.1/posts', auth, api.requestHandler(api.posts.browse)); ghost.app().get('/api/v0.1/posts', auth, api.requestHandler(api.posts.browse));
ghost.app().post('/api/v0.1/posts', auth, api.requestHandler(api.posts.add));
ghost.app().get('/api/v0.1/posts/:id', auth, api.requestHandler(api.posts.read)); ghost.app().get('/api/v0.1/posts/:id', auth, api.requestHandler(api.posts.read));
ghost.app().post('/api/v0.1/posts/create', auth, api.requestHandler(api.posts.add)); ghost.app().put('/api/v0.1/posts/:id', auth, api.requestHandler(api.posts.edit));
ghost.app().put('/api/v0.1/posts/edit', auth, api.requestHandler(api.posts.edit)); ghost.app().del('/api/v0.1/posts/:id', auth, api.requestHandler(api.posts.destroy));
ghost.app()['delete']('/api/v0.1/posts/:id', auth, api.requestHandler(api.posts.destroy));
ghost.app().get('/api/v0.1/settings', auth, api.requestHandler(api.settings.browse)); ghost.app().get('/api/v0.1/settings', auth, api.requestHandler(api.settings.browse));
ghost.app().get('/api/v0.1/settings/:key', auth, api.requestHandler(api.settings.read)); ghost.app().get('/api/v0.1/settings/:key', auth, api.requestHandler(api.settings.read));
ghost.app().put('/api/v0.1/settings/edit', auth, api.requestHandler(api.settings.edit)); ghost.app().put('/api/v0.1/settings', auth, api.requestHandler(api.settings.edit));
/** /**
* Admin routes.. * Admin routes..

View file

@ -61,9 +61,9 @@
urlSegments = window.location.pathname.split('/'); urlSegments = window.location.pathname.split('/');
if (urlSegments[2] === 'editor' && urlSegments[3] && /^[a-zA-Z0-9]+$/.test(urlSegments[2])) { if (urlSegments[2] === 'editor' && urlSegments[3] && /^[a-zA-Z0-9]+$/.test(urlSegments[2])) {
entry.id = urlSegments[3]; var id = urlSegments[3];
$.ajax({ $.ajax({
url: '/api/v0.1/posts/edit', url: '/api/v0.1/posts/' + id,
method: 'PUT', method: 'PUT',
data: entry, data: entry,
success: function (data) { success: function (data) {
@ -75,7 +75,7 @@
}); });
} else { } else {
$.ajax({ $.ajax({
url: '/api/v0.1/posts/create', url: '/api/v0.1/posts',
method: 'POST', method: 'POST',
data: entry, data: entry,
success: function (data) { success: function (data) {

View file

@ -48,7 +48,7 @@
var data = getSettings(); var data = getSettings();
$.ajax({ $.ajax({
method: 'PUT', method: 'PUT',
url: '/api/v0.1/settings/edit', url: '/api/v0.1/settings',
data: data, data: data,
success: function (res, xhr, c) { success: function (res, xhr, c) {
console.log(xhr, c); console.log(xhr, c);

View file

@ -8,7 +8,7 @@
width:341px; width:341px;
height:300px; height:300px;
background:#fff; background:#fff;
@include box-shadow; box-shadow: $shadow;
float:left; float:left;
margin:0 15px 15px 0; margin:0 15px 15px 0;
display:none; display:none;

View file

@ -56,7 +56,7 @@
bottom:40px; // height of the publish bar bottom:40px; // height of the publish bar
top:69px; // height of the post title + margin top:69px; // height of the post title + margin
background: #fff; background: #fff;
@include box-shadow; box-shadow: $shadow;
@include breakpoint($mobile) { @include breakpoint($mobile) {
@include box-shadow(none); @include box-shadow(none);
@ -337,7 +337,7 @@ body.zen {
background: lighten($lightbrown, 3%); background: lighten($lightbrown, 3%);
#usermenu {display:none;} #usermenu {display:none;}
#global-header, #publish-bar { #global-header, #publish-bar {
@include opacity(0); opacity: 0;
height:0; height:0;
overflow: hidden; overflow: hidden;
@include transition(all 0.5s ease-out); @include transition(all 0.5s ease-out);
@ -459,7 +459,7 @@ body.zen {
padding: 0 5px; padding: 0 5px;
color: $lightgrey; color: $lightgrey;
background: lighten($grey, 15%); background: lighten($grey, 15%);
@include border-radius; border-radius: $rounded;
@include box-shadow( @include box-shadow(
rgba(255,255,255,0.2) 0 1px 0 inset, rgba(255,255,255,0.2) 0 1px 0 inset,
#000 0 1px 3px #000 0 1px 3px

View file

@ -23,9 +23,9 @@
padding: 0; padding: 0;
text-align: center; text-align: center;
background: #fff; background: #fff;
@include border-radius(4px); border-radius: 4px;
border-top: $darkgrey 15px solid; border-top: $darkgrey 15px solid;
@include box-shadow; box-shadow: $shadow;
@include breakpoint(630px) { @include breakpoint(630px) {
max-width: 264px; max-width: 264px;
@ -48,7 +48,7 @@
max-width: 530px; max-width: 530px;
padding: 15px; padding: 15px;
background: $darkgrey; background: $darkgrey;
@include border-radius(0 0 4px 4px); border-radius: 0 0 4px 4px;
@include breakpoint(630px) { @include breakpoint(630px) {
max-width: 264px; max-width: 264px;
@ -91,11 +91,11 @@
position:relative; position:relative;
@include icon($i-mail, 12px) {position:absolute;bottom:8px;left:8px;z-index:100;}; @include icon($i-mail, 12px) {position:absolute;bottom:8px;left:8px;z-index:100;};
margin-right: 2px; margin-right: 2px;
@include border-radius(2px 0 0 2px); border-radius: 2px 0 0 2px;
@include breakpoint(630px) { @include breakpoint(630px) {
margin-right:0; margin-right:0;
@include border-radius(2px); border-radius: 2px;
} }
.email { .email {
@ -106,10 +106,10 @@
.password-wrap { .password-wrap {
position:relative; position:relative;
@include icon($i-lock, 10px) {position:absolute;bottom:9px;left:11px;z-index:100;}; @include icon($i-lock, 10px) {position:absolute;bottom:9px;left:11px;z-index:100;};
@include border-radius(0 2px 2px 0); border-radius: 0 2px 2px 0;
@include breakpoint(630px) { @include breakpoint(630px) {
@include border-radius(2px); border-radius: 2px;
} }
.password { .password {

View file

@ -26,7 +26,7 @@
left:0; left:0;
border-right:$lightbrown 2px solid; border-right:$lightbrown 2px solid;
background: #fff; background: #fff;
@include box-shadow; box-shadow: $shadow;
@include breakpoint(900px) { @include breakpoint(900px) {
width:300px; width:300px;
@ -174,7 +174,7 @@
right:0; right:0;
border-left:$lightbrown 2px solid; border-left:$lightbrown 2px solid;
background: #fff; background: #fff;
@include box-shadow; box-shadow: $shadow;
@include breakpoint(900px) { @include breakpoint(900px) {
width: auto; width: auto;
left: 300px; left: 300px;

View file

@ -18,7 +18,7 @@
// The main white bg for the page // The main white bg for the page
.wrapper { .wrapper {
background: #fff; background: #fff;
@include box-shadow; box-shadow: $shadow;
position:absolute; position:absolute;
top:0; top:0;
bottom:0; bottom:0;
@ -264,12 +264,12 @@
height: 40px; height: 40px;
margin-right: 17px; margin-right: 17px;
background-color: #ccc; background-color: #ccc;
@include border-radius(20px); border-radius: 20px;
img{ img{
width: 40px; width: 40px;
height: 40px; height: 40px;
@include border-radius(20px); border-radius: 20px;
} }
} }

View file

@ -66,7 +66,7 @@ form {
line-height: 1.4em; line-height: 1.4em;
background: #fff; background: #fff;
border: darken($lightbrown, 5%) 1px solid; border: darken($lightbrown, 5%) 1px solid;
@include border-radius; box-shadow: $shadow;
@include transition; @include transition;
} }
@ -156,7 +156,7 @@ form {
letter-spacing: 1px; letter-spacing: 1px;
text-transform: uppercase; text-transform: uppercase;
text-shadow: none; text-shadow: none;
@include border-radius(0.2em); border-radius: 0.2em;
border: rgba(0,0,0,0.05) 0.1em solid; border: rgba(0,0,0,0.05) 0.1em solid;
@include transition(background 0.3s ease, border-color 0.3s ease); @include transition(background 0.3s ease, border-color 0.3s ease);
@ -251,8 +251,7 @@ input[type="reset"] {
button { button {
font-size: 11px; // hack to restore font size font-size: 11px; // hack to restore font size
@include border-top-right-radius(0); @include border-right-radius(0);
@include border-bottom-right-radius(0);
} }
// This is the additional dropdown arrow, to the right of the button. // This is the additional dropdown arrow, to the right of the button.
@ -266,7 +265,7 @@ input[type="reset"] {
text-align: center; text-align: center;
color: #fff; color: #fff;
background: #e5e5e5; background: #e5e5e5;
@include border-radius(0 2px 2px 0); border-radius: 0 2px 2px 0;
@include box-shadow( @include box-shadow(
rgba(0,0,0,0.02) 0 1px 0 inset, rgba(0,0,0,0.02) 0 1px 0 inset,
rgba(0,0,0,0.02) -1px 0 0 inset, rgba(0,0,0,0.02) -1px 0 0 inset,

View file

@ -88,7 +88,7 @@ article aside {
margin: 0 2.2em 1.6em 2.2em; margin: 0 2.2em 1.6em 2.2em;
float: right; float: right;
background: $lightbrown; background: $lightbrown;
@include border-radius(3px); border-radius: 3px;
} }
// Headings // Headings
@ -264,7 +264,7 @@ pre {
font-family: $font-family-mono; font-family: $font-family-mono;
font-size: 0.9em; font-size: 0.9em;
overflow: auto; overflow: auto;
@include border-radius(3px); border-radius: 3px;
code, tt { code, tt {
font-size: inherit; font-size: inherit;
@ -284,7 +284,7 @@ kbd {
font-size: 0.9em; font-size: 0.9em;
font-weight: bold; font-weight: bold;
background: #f4f4f4; background: #f4f4f4;
@include border-radius(4px); border-radius: 4px;
@include box-shadow(0 1px 0 rgba(0, 0, 0, 0.2),0 1px 0 0 #fff inset); @include box-shadow(0 1px 0 rgba(0, 0, 0, 0.2),0 1px 0 0 #fff inset);
} }
@ -539,7 +539,7 @@ nav {
.avatar { .avatar {
height:18px; height:18px;
width:18px; width:18px;
@include border-radius(50px); border-radius: 50px;
position:absolute; position:absolute;
top:11px; top:11px;
left:15px; left:15px;
@ -706,7 +706,7 @@ nav {
list-style: none; list-style: none;
color: $lightgrey; color: $lightgrey;
background: $darkgrey; background: $darkgrey;
@include border-radius(3px); border-radius: 3px;
@include box-shadow(rgba(0,0,0,0.5) 0 1px 15px); @include box-shadow(rgba(0,0,0,0.5) 0 1px 15px);
// The triangle chiclet that points to where the menu came from // The triangle chiclet that points to where the menu came from
@ -835,7 +835,7 @@ nav {
color: rgba(255,255,255,0.9); color: rgba(255,255,255,0.9);
background: $orange; background: $orange;
position:relative; position:relative;
@include box-shadow; box-shadow: $shadow;
@include icon($i-notification) { @include icon($i-notification) {
position: absolute; position: absolute;
@ -1086,12 +1086,12 @@ main {
font-family: $font-family; font-family: $font-family;
display: block; display: block;
width:100px; width:100px;
@include opacity(0.6); opacity: 0.6;
@include transition; @include transition;
} }
&:hover small { &:hover small {
@include opacity(1); opacity: 1;
@include transition; @include transition;
} }
} }

View file

@ -15,19 +15,18 @@
/* ============================================================================= /* =============================================================================
Compass Imports Bourbon Imports
============================================================================= */ ============================================================================= */
// Compass - http://compass-style.org/ // Bourbon - http://bourbon.io/
@import "compass"; @import "bourbon";
$default-border-radius: 2px; $rounded: 2px;
$default-box-shadow-color: rgba(0,0,0,0.05); $shadow: rgba(0,0,0,0.05) 0 1px 5px;
$default-box-shadow-v-offset: 1px;
$default-transition-duration: 0.3s; $default-transition-duration: 0.3s;
/* ============================================================================= /* =============================================================================
Compass Plugins Plugins
============================================================================= */ ============================================================================= */
// Breakpoint - http://breakpoint-sass.com/ // Breakpoint - http://breakpoint-sass.com/
@ -152,7 +151,7 @@ $green: #9FBB58;
margin-bottom: 15px; margin-bottom: 15px;
background: #fff; background: #fff;
position: relative; position: relative;
@include box-shadow; box-shadow: $shadow;
header { header {
height:14px; height:14px;

View file

@ -89,6 +89,9 @@
res.redirect('/ghost/login/'); res.redirect('/ghost/login/');
}); });
} else {
req.flash('error', "The password is too short. Have at least 6 characters in there");
res.redirect('/ghost/register/');
} }
}, },
'logout': function (req, res) { 'logout': function (req, res) {

View file

@ -8,4 +8,5 @@
<input class="password" type="password" placeholder="Password" name="password"> <input class="password" type="password" placeholder="Password" name="password">
</div> </div>
<button class="button-save" type="submit">Log in</button> <button class="button-save" type="submit">Log in</button>
<a href="/ghost/register/">Register</a>
</form> </form>

View file

@ -17,7 +17,7 @@
<li class="usermenu-help"><a href="#">Help / Support</a></li> <li class="usermenu-help"><a href="#">Help / Support</a></li>
<li class="usermenu-shortcuts"><a href="#">Keyboard Shortcuts</a></li> <li class="usermenu-shortcuts"><a href="#">Keyboard Shortcuts</a></li>
<li class="divider"></li> <li class="divider"></li>
<li class="usermenu-signout"><a href="#">Sign Out</a></li> <li class="usermenu-signout"><a href="/logout/">Sign Out</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>

View file

@ -8,4 +8,5 @@
<input class="password" type="password" placeholder="Password" name="password"> <input class="password" type="password" placeholder="Password" name="password">
</div> </div>
<button class="button-save" type="submit">Register</button> <button class="button-save" type="submit">Register</button>
<a href="/ghost/login/">Log in</a>
</form> </form>