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(express.bodyParser());
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(flash());
// 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
*/
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().post('/api/v0.1/posts/create', auth, api.requestHandler(api.posts.add));
ghost.app().put('/api/v0.1/posts/edit', auth, api.requestHandler(api.posts.edit));
ghost.app()['delete']('/api/v0.1/posts/:id', auth, api.requestHandler(api.posts.destroy));
ghost.app().put('/api/v0.1/posts/:id', auth, api.requestHandler(api.posts.edit));
ghost.app().del('/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/: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..

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -66,7 +66,7 @@ form {
line-height: 1.4em;
background: #fff;
border: darken($lightbrown, 5%) 1px solid;
@include border-radius;
box-shadow: $shadow;
@include transition;
}
@ -156,7 +156,7 @@ form {
letter-spacing: 1px;
text-transform: uppercase;
text-shadow: none;
@include border-radius(0.2em);
border-radius: 0.2em;
border: rgba(0,0,0,0.05) 0.1em solid;
@include transition(background 0.3s ease, border-color 0.3s ease);
@ -251,8 +251,7 @@ input[type="reset"] {
button {
font-size: 11px; // hack to restore font size
@include border-top-right-radius(0);
@include border-bottom-right-radius(0);
@include border-right-radius(0);
}
// This is the additional dropdown arrow, to the right of the button.
@ -266,7 +265,7 @@ input[type="reset"] {
text-align: center;
color: #fff;
background: #e5e5e5;
@include border-radius(0 2px 2px 0);
border-radius: 0 2px 2px 0;
@include box-shadow(
rgba(0,0,0,0.02) 0 1px 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;
float: right;
background: $lightbrown;
@include border-radius(3px);
border-radius: 3px;
}
// Headings
@ -264,7 +264,7 @@ pre {
font-family: $font-family-mono;
font-size: 0.9em;
overflow: auto;
@include border-radius(3px);
border-radius: 3px;
code, tt {
font-size: inherit;
@ -284,7 +284,7 @@ kbd {
font-size: 0.9em;
font-weight: bold;
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);
}
@ -539,7 +539,7 @@ nav {
.avatar {
height:18px;
width:18px;
@include border-radius(50px);
border-radius: 50px;
position:absolute;
top:11px;
left:15px;
@ -706,7 +706,7 @@ nav {
list-style: none;
color: $lightgrey;
background: $darkgrey;
@include border-radius(3px);
border-radius: 3px;
@include box-shadow(rgba(0,0,0,0.5) 0 1px 15px);
// The triangle chiclet that points to where the menu came from
@ -835,7 +835,7 @@ nav {
color: rgba(255,255,255,0.9);
background: $orange;
position:relative;
@include box-shadow;
box-shadow: $shadow;
@include icon($i-notification) {
position: absolute;
@ -1086,12 +1086,12 @@ main {
font-family: $font-family;
display: block;
width:100px;
@include opacity(0.6);
opacity: 0.6;
@include transition;
}
&:hover small {
@include opacity(1);
opacity: 1;
@include transition;
}
}

View File

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

View File

@ -89,6 +89,9 @@
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) {

View File

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

View File

@ -17,7 +17,7 @@
<li class="usermenu-help"><a href="#">Help / Support</a></li>
<li class="usermenu-shortcuts"><a href="#">Keyboard Shortcuts</a></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>
</li>
</ul>

View File

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