Commit Graph

851 Commits

Author SHA1 Message Date
Hannah Wolfe
3027c9fcdc Merge pull request #3277 from PaulAdamDavis/link-href-fixes
Replace anchors with no real href with buttons
2014-07-15 18:34:50 +01:00
Hannah Wolfe
3b66ff5d58 Merge pull request #3276 from sebgie/issue#3252
Move image upload to API
2014-07-15 18:09:32 +01:00
Paul Adam Davis
705aea63ee Replace anchors with no real href with buttons
Closes #3101 & #916
2014-07-15 17:43:21 +01:00
Hannah Wolfe
c9357b8937 Merge pull request #3278 from jaswilli/prod-prep
Move inline templates to standalone template file
2014-07-15 17:00:01 +01:00
Hannah Wolfe
cf7985c508 Merge pull request #3259 from novaugust/settings-mobile-routing
Refactor Settings routing and mobile interactions
2014-07-15 16:55:02 +01:00
Jason Williams
3d3b999995 Move inline templates to standalone template file
Refs #3161
- Move two inline template snippets from the post tags input
  component into the .hbs template file so they can be
  pre-compiled.  Needed when shipping only the handlebars runtime
  in production mode.
2014-07-15 15:21:44 +00:00
Matt Enlow
f80f2e1a24 Remove minor notifications; Close persistent notifications even on error
Closes #3105, Closes #3175

- Removed notification on successful post's `page` status change
- Removed notification on successful post `featured` status change
- Added `closePassive()` notifications on error in the post-settings-menu
- Persistent notifications will close whether their `DELETE` request was
  successful or not.

 #### Misc
- Added `name` attribute to `post-setting-menu.hbs` inputs to facilitate testing
- Removed `return <Promise>` from action in `PostSettingsMenuController`. Actions should only return `true`
- Toggling `post.featured` won't fire NProgress.
2014-07-15 09:03:18 -06:00
Sebastian Gierlinger
5c97e50980 Move image upload to API
closes #3252
- added `/ghost/api/v0.1/uploads/` endpoint
- removed upload method from `controller/admin.js`
- moved removal of temporary files from storage to endpoint (needed to
account for failed uploads)
- changed and moved tests
- Oversight: I think that we use `.otherwise()` and `.catch()` a bit
too extensive and mask the real error objects. We probably need an
error handling strategy at some point in the future.
2014-07-15 12:40:14 +02:00
Matt Enlow
14f29f5139 Refactor settings routing and mobile interactions
Closes #3254, closes #3138, closes #3245
 ### Settings Routing and View refactoring
- Refactored `SettingsView` to handle transitions between mobile and desktop layouts
- `SettingsRoute` will only transition to `settings.general` if the screen is large enough to show both the menu and the content
- Added `SettingsIndexView` to handle showing the settings menu on mobile screens
- Added `SettingsContentBaseView` to be inherited by any settings view that is not index.
- Updated Settings templates appropriately to work with new views
- Removed extraneous `active` class from `settings-content`
- Changed settings menu to use `gh-activating-list-item`
- Retooled settings tests

 ### Mobile Utils
- Renamed file to `mobile.js`, since it's inside of `utils/`
- Added `mobileQuery` MediaQueryList to help detect layout changes
- Removed unused `hasTouchScreen`, `device.js` should be used instead.
- Removed unused `smallScreen` function
- Moved FastClickInit to codemirror-mobile
2014-07-14 17:36:48 -06:00
Jason Williams
7cc818d262 Fix validations on user settings page
Closes #3271
- Change validations on both server and client to allow the
  Website field to be empty or a valid URL.
- Add new schema validation helper isEmptyOrURL.
- Remove duplicate call to UserValidator in the save action
  of the SettingsUser controller.
- User.last_login and User.created_at are already Moment objects
  so Moment#fromNow can be called on them directly.
2014-07-14 18:12:57 +00:00
Harry Wolff
45ccad58f9 Settings: Admin User Tab
closes #2422

- updated to use new change password method
- have all save settings use notifications
- create assetUrl helper for creating asset paths with subdir's properly
 prefixed
- move all url based helpers onto a url object in ghost-paths
2014-07-14 08:52:06 -04:00
Matt Enlow
0122ecd593 Fire NProgress on User, Post, and Settings save
Closes #3037
- Created `NProgressSaveMixin`, which extends the `save` method of a model
  to fire NProgress.
- Extended `UserModel`, `PostModel`, and `SettingModel` with the new
  mixin.
- NProgress can be disabled by passing an options hash to the save function with the `{disableNProgress:true}`
- Now that the ValidationEngine isn't the only thing playing with options inside of `model#save`, refactored it to pass the options down the super chain.
2014-07-13 14:19:27 -06:00
Hannah Wolfe
728054d5e4 Merge pull request #3256 from PaulAdamDavis/fix-notification-flicker
Check the end of notification fade-out animation
2014-07-13 21:14:31 +01:00
Hannah Wolfe
41fcf2661c Merge pull request #3248 from jaswilli/issue-3246
Add validation to invite new user form.
2014-07-13 21:13:33 +01:00
Paul Adam Davis
aea16e7ef4 Check the end of notification fade-out animation 2014-07-13 15:00:25 +01:00
Paul Adam Davis
61abd5771e Re-add back to Users button and make whole user item a link. 2014-07-13 13:33:21 +01:00
Jason Williams
faf6832cab Add validation to invite new user form.
Closes #3246
- Add a UserValidator to the validation engine that runs a set
  of validations based on the user status.
- Added validations for invited users and active users.
2014-07-11 19:09:34 +00:00
Jason Williams
48b0ba6ca9 Turn on update notifications for Ember admin
Issue #3160
- Use notifications API to display available update notification.
- Remove update_notification handlebars helper as now both the
  check for an available update and the notification handling
  is run from the server's admin controller index method.
- Bind the notification's location property to a css class
  for styling.
- Refactor Ember notifications to better handle notification
  objects.  Move responsibility for css class generation onto
  the notification component.
- Refactor gh-notifications component to take a location argument
  that's used to assign a css class and filter notifications.
2014-07-11 15:02:26 +00:00
Sebastian Gierlinger
e22e1f340b Move setup to API
closes #3136
- moved setup to authentication API
- added `POST /ghost/api/v0.1/authentication/setup` to execute the
setup process
- added `GET /ghost/api/v0.1/authentication/setup` to check if blog is
already set up (needed for #3145)
- removed unused methods from api/users.js
2014-07-11 14:17:09 +02:00
Jason Williams
a0dc639a38 Fix active theme selector. Add validation to API.
Closes #3226
- Remove dependent property from the computed content property
  that is used to build the active theme selector.
- Add validation to the Settings model so that it rejects
  attempts to set an activeTheme that is not installed.
2014-07-09 22:14:33 +00:00
Hannah Wolfe
e5e5cf1310 Merge pull request #3219 from JohnONolan/email
New HTML email template
2014-07-08 17:06:48 +01:00
Maurice Williams
2b13a054d3 Wiring up "resend" and "revoke" button on user management screen
fixes #3214
- new ```resendInvite``` method on the User model encapsulates all logic
- only sending users email address when re-inviting, since the user already exists on the back-end
- ```revoke``` calls DELETE on /ghost/api/v0.1/users/:user_id
2014-07-08 11:32:34 -04:00
John O'Nolan
6858385b00 New HTML email template
See #3082
2014-07-07 22:47:34 +02:00
Hannah Wolfe
233bebc59e Merge pull request #3217 from PaulAdamDavis/new-form-style
New form styles
2014-07-07 20:38:22 +01:00
Hannah Wolfe
19a6dd1dff Merge pull request #3216 from novaugust/mobile-menu
Fix mobile sidebar menu
2014-07-07 20:38:04 +01:00
Hannah Wolfe
f00a745062 Merge pull request #3211 from novaugust/yearless-date-parsing
Add yearless date as an acceptable format for moment parsing
2014-07-07 20:13:13 +01:00
Paul Adam Davis
4dccf97418 Aditional classes in settings and invite user modal for the new form style 2014-07-07 17:00:47 +01:00
Matt Enlow
1089cdb036 Fix mobile sidebar menu
Closes #3110
- Created `ApplicationView`
- Added `js-close-sidebar` classes to navbar navigation links
- Clicking on a navigation link in the sidebar will close it
2014-07-07 08:55:22 -06:00
Hannah Wolfe
e72b3af4b6 Merge pull request #3207 from morficus/invite-new-user-modal
Implementation of "invite a new user" modal
2014-07-07 15:05:35 +01:00
Matt Enlow
0898ae6432 Add yearless date as an acceptable format for moment parsing
Closes #2331
2014-07-06 20:49:15 -06:00
Maurice Williams
b2d4dd4f17 Implementation of "invite a new user" modal
Closes #3079
- new controller and template for invite-new-user-modal
- actually triggers email invite via POST /ghost/api/v0.1/users/
- setting default language value (on the client) when creating a user
- only available role is "Author" - pending 3196
- updates to UsersIndexController to allow dynamic property calculation and template rending
2014-07-06 16:18:51 -04:00
Matt Enlow
177be064fa Add access_token to debug screen's export link
Closes #3177
2014-07-05 14:48:39 -06:00
Maurice Williams
51ed2868f7 Removing old "user settings" screen and putting in new MU "users settings" screen and updating functional test cases.
Fixes #3078
- new "users" resource, with matching controller and template
- fetching real data from /ghost/api/v0.1/users/
- updated "user" route to accept a :slug as a URL parameter
- updated labels everywhere (from "user" to "users")
- updated "profile" link to header to point to proper "users/:slug" route
- updated core/client/.jshintrc to recognize moment as a valid global function
- adjusted DOM selector used in Casper to properly identify the new screen
- adding "slug" as a new property of the user data used during the Casper functional tests
2014-07-05 11:33:03 -04:00
Hannah Wolfe
387b838bf6 Merge pull request #3194 from novaugust/title-scratch
Indirect post title in editor
2014-07-04 23:19:44 +01:00
Hannah Wolfe
bbfac57030 Merge pull request #3192 from sebgie/issue#3081
Allow user to accept invitation
2014-07-04 23:18:47 +01:00
Hannah Wolfe
69cbf9f9d6 Merge pull request #3178 from novaugust/popover-fadeout
Added fadeout to gh-popover
2014-07-04 23:17:29 +01:00
Matt Enlow
9013bcc908 Added fadeout to gh-popover
Closes #2868
- Uses jQuery's `.fadeOut` whenever a popover is closed.

- Reordered `gh-popover`'s code into something a bit more logical and, if
  I may, pretty
- Renamed `open` property into `isOpen`. `isOpen` should only be
  manipulated via `close()` and `open()`
- Added `closing` property to help track state in the case of rapid clicks
  on a popover's button, allowing us to abort
` Added `open()` function
2014-07-03 13:13:18 -06:00
Matt Enlow
15f1591383 Indirect post title in editor
Closes #3179
- Add `titleScratch` property to `PostModel`.
- Changed references to `title` to `titleScratch`
2014-07-03 11:09:05 -06:00
Sebastian Gierlinger
aceb63c973 Allow user to accept invitation
closes #3081
- added route `/ghost/api/v0.1/authentication/invitation`
- added accept invitation
- added signup with token
- removed check() from users api
- fixed promise in resetPassword()
2014-07-03 17:06:07 +02:00
Jason Williams
2dbc97e9b4 Fix server-side validation
Closes #3122
-Fix validation so that all values are validated instead
 of just values that evaluate to true.
-Ensure validation methods consistently return promises
 and switch error handling from try/catch to promise.catch
 to get rid of unhandled rejection warnings.
-Add 0 and 1 to list of acceptable values in boolean validation.
2014-07-03 14:57:57 +00:00
Hannah Wolfe
8a4b96aaef Merge pull request #3174 from kevinansfield/session-user
Fix direct access to settings/user using session.user CP
2014-07-03 08:44:03 +01:00
Hannah Wolfe
ee289c444d Merge pull request #3180 from novaugust/psm-reset-on-error
PostSettingsMenu: Don't save new posts, reset values on failure
2014-07-02 23:07:46 +01:00
Matt Enlow
ccd319b426 PostSettingsMenu: Don't save new posts, reset values on failure
Closes #3158, Closes #3143, Closes #3134
- Added `model.rollback()` when PSM fails to save.
- Added `showErrors` and `showSuccess` helper functions to PSM to abstract
  closing and showing of notifications.
- Added `togglePage` action to indirect the setting of `page`.
- Removed `isStaticPage` property in favor of `togglePage` action
- moved `updateSlug` error catching to outer promise (slugGenerator promise)
- modifying the `page` and `published_at` properties will no longer cause a new post to save
- Close passive notifications on published date parse fail
- Removed promise creation in catch statements

- Changed tests to click on label, rather than the input for
  .post-setting-static-page.
2014-07-02 15:29:15 -06:00
Hannah Wolfe
cf576ebc18 Merge pull request #3184 from jaswilli/issue-3169
Fix up route parameter validation
2014-07-02 21:37:00 +01:00
Hannah Wolfe
c6de0978be Merge pull request #3181 from jaswilli/ember-misc
Prevent stacking notifications during rapid toggle
2014-07-02 21:36:40 +01:00
Hannah Wolfe
3770d7086a Merge pull request #3176 from PaulAdamDavis/2422-edit-user-ui
New edit user UI
2014-07-02 21:32:54 +01:00
Kevin Ansfield
c28d8e6044 Fix direct access to settings/user
closes #3162
- removes injection of user object in application route's beforeModel
- removes injection/cleanup of user object in signedIn/signedOut actions
- removes loading of user and passing to signedIn action in signup/setup controllers
- adds 'user' property to session object
- updates header nav to reference session.user
- sets model of settings/user route to session.user and forces reload
- on leaving settings/user, rollback any unsaved changes
2014-07-02 17:45:21 +02:00
Jason Williams
f9e57bfb70 Fix up route parameter validation
Closes #3169
-Replace javascript methods that are not available on all
 supported browsers with lodash methods.
-Add returns to transitionTo calls in cases where the model
 hook should stop executing immediately.
2014-07-02 14:13:07 +00:00
Jason Williams
383b657e7e Prevent stacking notifications during rapid toggle
No issue
-Call notifications.closePassive after the resolution of the
 promise that generates the notifications. Otherwise multiple
 promises can stack up after notifications have been cleared,
 which results in a bunch of stacked notifications.
-Remove some unnecessary propagation of rejected promises from
 action handlers that can result in unhandled reject errors.
2014-07-02 03:42:27 +00:00
Paul Adam Davis
d6cb4bd48c New edit user UI 2014-07-01 18:42:13 +01:00