Commit Graph

70 Commits

Author SHA1 Message Date
Hannah Wolfe
bb490e4bbd Hide settings/apps unless apps:true is in config.js
fixes #3031

- Adds an initializer for passing config to the frontend, it's not pretty but it works
- Forwards the apps route and hides the apps menu item if apps:true is not present in config.js
2014-06-23 20:27:51 +01:00
Hannah Wolfe
4fd4cb0091 Fix warning about transitionTo being deprecated 2014-06-23 12:14:41 +01:00
Hannah Wolfe
e047013956 Merge pull request #3023 from darvelo/promise-rejection
Fix promise rejection during validation
2014-06-23 11:45:04 +01:00
David Arvelo
f6dd851ffb Fix promise rejection
fixes #3013
- bubble promise rejection on post model validation/save error so that it doesn't bubble as resolved
- prefer `.catch()` for promise handlers as per recommendations
- check if `.save()` is being called from model.destroyRecord() and forgo validation if so
- normalize output for both `.validate()` and `.save()`
2014-06-22 14:49:09 -04:00
Hannah Wolfe
3fc9075383 Merge pull request #3022 from novaugust/codemirror-shortcuts
Implement Markdown Shortcuts
2014-06-22 10:42:37 +01:00
Hannah Wolfe
93c2da55e0 Merge pull request #2967 from szelpe/settings-apps
Ported settings/apps logic to Ember.
2014-06-22 09:04:14 +01:00
Matt Enlow
8393c01be9 Implement Markdown Shortcuts
Closes #2984, #3020
Ref #1463, #3019

 #### Shortcut Values
Shortcut values can now be either strings (as before) or objects like
{action:string, options:hash}.
 #### Markdown shortcuts added
- 'ctrl+alt+u' strkethrough
- 'ctrl+alt+1' h1
- 'ctrl+alt+2' h2
- 'ctrl+alt+3' h3
- 'ctrl+alt+4' h4
- 'ctrl+alt+5' h5
- 'ctrl+alt+6' h6
- 'ctrl+shift+i' image
- 'ctrl/command+k' link
- 'ctrl+l' list

Left behind commented out stubs for additional markdown shortcuts.

 #### Editor Controllers (New and Edit)
- Moved shared init function into editor-base-controller.
- Removed MarkerManager mixin from editor controllers as it's included in
  the base.
2014-06-21 15:10:46 -06:00
Hannah Wolfe
bb88b3664f Merge pull request #3011 from darvelo/validations
Add Validations Layer and Post Validations
2014-06-21 17:41:28 +01:00
Hannah Wolfe
64b36468b4 Merge pull request #3003 from jaswilli/issue-2846-settings
Convert general settings page to ember data
2014-06-21 15:25:23 +01:00
David Arvelo
6020702462 Add Validations Layer and Post Validations
closes #2893, issue #2850, issue #2856
- this is a stable, but quick and dirty validations layer for the time constraints
- this could be replaced with a unified server/client layer later. the infrastructure is there.
- create a validation engine mixin to match validators with models
- override the save method in the mixin to perform validations first
- create a post validator
- fixup calls to .save() to make sure they catch errors properly
2014-06-21 00:12:55 -04:00
Hannah Wolfe
962accfec7 Functional tests for Ember
issue #2989

- Adds lodash for bind and isNumber - looking for a better solution for this
- Still needs the editor and flow tests porting
- Some of the tests are commented out awaiting further implementations
2014-06-20 15:20:59 +01:00
Jason Williams
1453a1d04e Convert general settings page to ember data
Issue #2846
-Implement custom RESTAdapter and serializer for settings data.
-Convert theme selector to Ember.Select.
-Finish upload modal and wire into settings page.
2014-06-20 04:38:41 +00:00
David Arvelo
b891b2b778 Fix deletion of Post Model in Editor and Content screens
fixes #2999
- handle undefined argument in openModal function
- catch whether a model is deleted in Editor routes to aid transition
- move updateTags function to the PostModel
- add call to updateTags in delete-post modal
2014-06-19 14:31:56 -04:00
Hannah Wolfe
35f7d8ac9b Merge pull request #2884 from darvelo/sort-posts-list
Get single post from API by id and query params; Auto-sort posts list
2014-06-17 23:45:53 +01:00
Hannah Wolfe
d03d2a239a Merge pull request #2985 from novaugust/featured-and-page-cleanup
Cleanup PostItemView code
2014-06-17 23:27:46 +01:00
Hannah Wolfe
4822cf99cd Merge pull request #2897 from lholmquist/modal_uploader
Modal Uploader
2014-06-17 23:22:26 +01:00
David Arvelo
85f7e1d269 Get single post from API by id and query params; Auto-sort posts list
closes #2883, closes #2951
- introduce custom findQuery in ApplicationAdapter
- posts/post route and editor/edit route now use custom findQuery to find a single post by id with query params
- create a sorting function in PostsController for out-of-order loading
- refresh updated posts in posts.index to make PostsList highlight latest draft after returning from a save in editor
2014-06-17 18:10:11 -04:00
Peter Szel
c614a652cb Ported settings/apps logic to Ember.
Closes #2423

- Created the apps route to fetch apps from server
- Created controller for a single app
- Modified the template of the apps page to use this controller
- Created the Apps model
- Created AppAdapter to use the FixtureAdapter for Ember Data
2014-06-17 23:25:24 +02:00
Matt Enlow
b04dfd52c1 Cleanup Misc Ember Code
No issue

Misc Places
- Removed expired, irrelevant, and fixed todos

FloatingHeaderPartial
- Fixed "Written" vs "Published" text logic

SettingsGeneralController
- Removed single quotes from property names

EditorBaseController, MarkerManagerMixin
- Aligned var declarations

PostItemView
- Commented out unfunctional code for feature request #2398
- Switched `isPage`, `isFeatured` to be computed properties in `Po
- use `toggleProperty` in `PostController.action.toggleFeatured`
2014-06-17 14:59:15 -06:00
Hannah Wolfe
11ab89951b Merge pull request #2981 from jaswilli/fix-observer
Fix removeObserver for title property
2014-06-17 21:56:08 +01:00
Lucas Holmquist
fab34d878c Ember Admin - Upload Modal
Issue #2547
2014-06-17 16:18:32 -04:00
Hannah Wolfe
f11a81067a Merge pull request #2972 from halfdan/2748-featured-post
Implement featured post / page
2014-06-17 20:58:25 +01:00
Jason Williams
e4a5906f70 Fix removeObserver for title property 2014-06-17 15:47:03 +00:00
Jason Williams
9dd3e90e7a Fix slug create and update logic for posts
-Remove unnecessary calls to the slug API endpoint on the
 content screen.
-Only make slug API endpoint calls in editor when the post is new.
-Improve logic for when to update the slug.
2014-06-16 14:09:46 +00:00
Fabian Becker
b1ba9f5957 Implements page class toggling.
- Toggles page class when post is marked as static/non-static
2014-06-16 17:08:58 +03:00
Fabian Becker
c649d23936 Content screen: Featured posts
fixes #2748
- Properly handle marking post as featured/non-featured
- Show correct notifications
2014-06-16 09:32:40 +00:00
Matt Enlow
e3b302676b Create boundOneWay util function
Closes #2958
- Created `boundOneWay` util to extract common pattern of having a oneWay property that doesn't break its binding after being set
- Changed `EditorControllerMixin.willPublish`,  `PostSettingsMenuController.publishedAtValue` and `.slugValue` to use the new `boundOneWay` util
2014-06-14 15:27:52 -06:00
Hannah Wolfe
9112c1f469 Merge pull request #2895 from appleYaks/editor-parity
Reach Editor parity with Ember
2014-06-14 18:43:36 +02:00
Hannah Wolfe
fd8cc542b5 Merge pull request #2946 from halfdan/fix-page
Fixes static pages when permalinks are active.
2014-06-14 18:12:39 +02:00
David Arvelo
eb949aafae Reach Editor parity with Ember
closes #2426, closes #2781, closes #2913
- Concatenate vendor files on change of js in core/shared/
- Add all the markerManager stuff to its own mixin
- make markers a shared object for all that mix it in. makes it easier to use helper functions in different modules
- add getMarkdown method, returns object with two keys holding the markdown: one with markers, the other without
- Clear markers when codemirror is destroyed
- make Editor subcomponents communicate through the Editor Controller
- Set Codemirror and html preview shared scrolling
- Set CodeMirror, html preview css scroll class with util
- Create 'scratch' property in Editor controller; prevents a model save wiping image markers due to markdown bindings
- Add editor and html preview actions to handle img upload start/finish
- disable codemirror when an image is being uploaded, enables on success or failure
- Fix editor wordcount when there are 0 words
- Add modal dialog when transitioning out of the editor with an unsaved post
- Add window.onbeforeunload handling with `.unloadDirtyMessage()` on editor controller
- and various other things
2014-06-13 18:12:03 -04:00
Matt Enlow
b1176a8a67 Refactored PostSettingsMenuController
Closes #2845.
Ref #1351.
- Refactored `PostSettingsMenuController` to appropriately set and display
  slug and publish date and their placeholders.
- Removed api spam on title change by putting `slugPlaceholder` generation
  inside of an `Ember.run.debounce` call.
- Renamed `gh-blur-text-field` to `gh-blur-input`
- Created `SlugGenerator` class to abstract slug generation.
- Added `timestampVerification` function to `utils/date-formatting`
- `utils/date-formatting` now uses `strict` parsing of dates
- Added more acceptable date formats to accommodate strict parsing
- Moved `isDraft` and `isPublished` computed properties from
  `EditorController` to `PostModel`
2014-06-13 12:14:58 -06:00
Fabian Becker
21a7e3ebb2 Fixes static pages when permalinks are active.
fixes #2938
- Fix `page === 1` occurences
- Fix ember logic
2014-06-13 01:00:18 +02:00
Matt Enlow
ca422dc1a4 Transition to editor.edit after saving a new post
Closes #2860
- `editor-base-controller`'s `save` action returns a promise with the model
  after saving
- `EditorNewController` will transition to `EditorEditController` upon a
  successful save (model has an id)
- Removed a console.log in editor's save function
2014-06-11 15:44:18 -06:00
Matt Enlow
aa54821e64 Refactored Editor Routing
- Moved `new` route into `editor` resource (`editor.new`)
- Moved the current editor controller, view, and route to `editor.edit`
- Added `editor.index`, which automatically transitions into `editor.new`
- Moved controllers, views, templates, and routes to match new router config. Also changed links to `editor` into `editor.new` and `editor.edit` as appropriate.
2014-06-11 12:18:44 -06:00
David Arvelo
4a987bfc15 Split PostController amongst new Editor/PostSettingsMenu Controllers
closes #2910
- create EditorController, PostSettingsMenuController
- remove `posts.post` controllerName dependency on EditorRoute/NewRoute
- `{{render}}` the PostSettingsMenuView with its own controller
- break up properties/methods from PostsPostController into all three controllers
- fix EditorRoute pagination options to now be comparable to PostsRoute
- add NewController to force NewRoute to refresh editor with blank model. Identical to Editor's
- EditorController and NewController are based on a shared mixin
- NewView created, templateName is 'editor'
2014-06-08 14:01:32 -04:00
Hannah Wolfe
a55bfea5b0 Merge pull request #2909 from novaugust/publish-button-reset
Fixed publish button not updating with model  change
2014-06-08 19:55:10 +02:00
Matt Enlow
f2641df0a9 Fixed publish button not updating with model change
Closes #2908
- Changes `willPublish` from `oneWay` property to computed property.
2014-06-08 11:03:12 -06:00
Jason Williams
4898f721ee Close post settings popover menu after delete post
No issue
-inject popover:service into modal component delete post
 controller so popover close can be triggered as part of
 the delete action
-remove unnecessary 'needs' from the delete post controller
2014-06-06 04:04:49 +00:00
Hannah Wolfe
afec0bc660 Merge pull request #2873 from jaswilli/2849-delete-posts
delete posts from post settings menu
2014-06-04 15:15:37 +01:00
Jason Williams
39967b02da Enable post deletion from Ember admin
Closes #2849
-wire up delete post action in ember admin
-refactor ember modal dialog
-override RESTAdapter.deleteRecord to workaround Ember expecting
 an empty response body on DELETEs
2014-06-04 13:19:57 +00:00
Matt Enlow
2d321e2f01 Removed holdover popover code in PostsPostController
Ref #2840
-Removed unused isEditingSettings and isViewingSaveTypes from PostsPostController
2014-06-03 16:30:46 -06:00
Hannah Wolfe
8836375ca6 Ember cleanup: single quotes for JS
- All JS should use single quotes
2014-06-01 21:53:16 +01:00
Hannah Wolfe
664048be4e Ember: correct editor layout and other niggles
no issue
- Fixes the editor view so that the layout is correct
- Remove default title
- Fixes a couple of scoping issues with notifications
2014-05-31 19:32:22 +01:00
David Arvelo
12e6b09943 Infinite Scroll on Posts List
closes #2414
- Add PostsController with loadNextPage action
- Collect and store pagination info from PostsRoute into PostsController
- Use `store.filter` on PostsRoute model hook to auto-update posts list template as post models are added to the store
- Add content list view and use it to check for scroll event
- Make PostRoute only load a post that's already in the store, until we figure how to load multiple pages on refresh
- Add util function from clientold that concats error messages from server response
2014-05-30 22:14:45 -04:00
Jacob Gable
5abeadf80d Ember Data with Posts
Ref #2699

- Introduce ember data dependency
- Add loadInitializers and refactor most initializers into one combined
- Add Post ember data model
- Refactor generateSlug to use title of post and ghostPaths
- Refactor post controller to not reference model.property everywhere
- Use RESTAdapter for posts, users and tags
- Setup author and tag relations in Post model
- Fix broken API calls by adding CSRF header
- Add initiaizer for csrf value
- Use actual User model for current user initializer
- Add action for setting featured post, test with actual api call
- Fix the sending of UUID's up to the server
- Refactor current-user to use ember-data store
- If a user is preloaded in the application, use pushPayload to put it
in the store
- Do a lookup on the store to get an actual User model for injection
- Fix posts/post controllerName in route/new.js
- Alter signup process to push user into ember data store
2014-05-29 07:42:51 -05:00
Hannah Wolfe
40d4cc7e55 Merge pull request #2807 from novaugust/ember-user-cover-default
Fix default user cover on ember settings pane
2014-05-25 16:48:15 +03:00
Hannah Wolfe
ef005c0d4c Merge pull request #2786 from novaugust/ember-editor-save-and-publish
Ember editor save and publish button functionality
2014-05-25 16:45:19 +03:00
Matt Enlow
b4d2f662ce Fix default user cover on settings pane
Closes #2806
- Ensures that the user's cover property is a string, otherwise uses the
  default cover.
2014-05-24 08:43:53 -06:00
Matt Enlow
cef680aa6b Ember editor save and publish button functionality
Closes #2747
- Added new 'editor-save-button' view and template.
- Added save action to post controller.
- Set a new post as the default model for the /editor/ route.
- Set the `posts/post` controller as the controller for the /editor/
  route.
- Needs ghost-popover #2418 component for full pop-up functionality
2014-05-24 07:47:55 -06:00
Jacob Gable
006aedfb84 Implement signup in Ember
Closes #2410

- Add signup action that posts to signup endpoint
- Fix nav bar showing on signup page
- Fix image link when a user hasn't set their image yet
- Redirect to the ember/signin page if requesting an ember page
2014-05-23 12:17:28 -05:00