- 11 Dec, 2015 2 commits
-
-
Robert Knight authored
* Split out the header and footer of the design into their own templates to facilitate re-use in WordPress and other pages on the site * Rename the existing logo-only header to logo-header. * Rename 'nav-bar' to 'header' since that is a better description for how it is used * Move inline styles and scripts out of the template and into appropriate JS/SCSS files
-
Robert Knight authored
Update the style of the navigation bar on the homepage to the new design from https://trello.com/c/h6kQMQG8/
-
- 10 Dec, 2015 8 commits
-
-
Sean Hammond authored
Consolidate API validation
-
Sean Hammond authored
Move all templates into `templates/` directory
-
Nick Stenning authored
It would be nice if each module could be responsible for their own templates, but in reality nearly every template forms part of a large tree of templates, extending base layouts, and so on. In the interests of consistency, it makes sense to have all templates in the `h/templates/` directory rather than some being in `h/templates/` and some being in their respective module directories.
-
Sean Hammond authored
Don't 500 when non-object JSON is POSTed to API create
-
Sean Hammond authored
Fix standalone annotation page realtime updates for replies to replies
-
Sean Hammond authored
Fix standalone reply pages
-
Nick Stenning authored
This commit fixes a bug where a standalone annotation page only receives realtime updates for replies on that page if the top-level annotation on the page is also the root of its message thread. The annotation `references` field contains the ids of all ancestors in the message thread, from oldest to newest -- that is, the earlier in the references field an id appears, the higher it is in the message tree. In order to receive realtime updates for all messages in the part of the thread displayed on a standalone annotation page, we need to ask for: - all updates in which the id in the URL matches the id in the annotation (i.e. updates to the top-most displayed annotation, which may itself be a reply). - all updates in which the id in the URL *is contained in* the `references` field of an annotation (i.e. updates for any annotation lower in the message thread) Previously, this code requested all updates in which the id *was the first entry* in the references field, which is only ever true for the root of a message thread, meaning that it only ever worked on standalone annotation pages for top-level annotations, and not on pages for replies.
-
Nick Stenning authored
This commit is a partial revert of 4628b26, affecting standalone annotation pages only. That commit changed the AnnotationViewerController (the component responsible for standalone annotation pages) to make a single request to the search API to load an annotation and all its replies, rather than two requests -- for the annotation and then for its replies. This works just fine so long as the top-level annotation is not itself a reply. In that case, however, the search endpoint returns nothing, as the (temporary) `_separate_replies` parameter ensures that only top-level annotations are matched. This commit switches back to making two requests to populate the client-side data structures for the standalone annotation page: 1. To fetch the annotation referenced in the URL (which may itself be a reply). 2. To fetch any replies to the annotation referenced in the URL. Fixes #2775.
-
- 07 Dec, 2015 14 commits
-
-
Sean Hammond authored
Add a robots.txt
-
Nick Stenning authored
This adds a basic robots.txt which prevents indexing of pages under `/groups`.
-
Nick Stenning authored
2728 misc annotation controller refactors part 2
-
Sean Hammond authored
This one needs to be of the `var` form because it gets redefined later.
-
Sean Hammond authored
Better for each property to have its own docstring where it's defined, than to try and keep them in sync.
-
Sean Hammond authored
This function isn't part of the view model, it's never called by the templates, only by code in annotation.js itself.
-
Sean Hammond authored
-
Sean Hammond authored
Move the public method vm.render() out of AnnotationController, making it a private function and renaming it to updateViewModel(). This function is not part of the view model (it's never called by the templates, only by code in annotation.js and tests) and its tests don't need to be part of the annotation controller/directive tests. Move it out. All the function does is copy some fields from the domain model to the view model, the opposite of what the updateDomainModel() function does, so rename it to updateViewModel() and put it next to updateDomainModel(), clarifying its role.
-
Sean Hammond authored
Private functions first, then public methods, and each section in alphabetical order. This also means that all `on*()` event listener functions are together (except for vm.onKeydown()). Also always use the `function foo() {}` form instead of mixing it with `var foo = function() {}`.
-
Sean Hammond authored
-
Sean Hammond authored
Public properties first, then private ones, then event listeners and watchers, then initialization logic, and each group in alphabetical order. Also added/improved some docstrings.
-
Sean Hammond authored
It isn't necessary.
-
Sean Hammond authored
Collect all AnnotationController init code together in an init() function. Previously it was spread around at the top, middle and bottom of the AnnotationController() function, some of it even hiding between method definitions. Now it's all in one place.
-
Nick Stenning authored
Remove USER_CHANGED event from AnnotationController
-
- 04 Dec, 2015 11 commits
-
-
Nick Stenning authored
Add groups report to admin dashboard
-
Sean Hammond authored
When the user logs out or logs in we throw away all the AnnotationController instances and create new ones. So everything it needs to do "when the user logs in" (or out) AnnotationController can do on Initialization, it doesn't need the event.
-
Robert Knight authored
Refactor saving highlights in AnnotationController
-
Sean Hammond authored
-
Sean Hammond authored
Remove the global variable `annotation` from annotation-test.js. This paves the way for having different helper functions for creating different kinds of annotation and passing them in to the directive initialization. Some describe()s still use their own global annotation objects, these should be factored out as well.
-
Sean Hammond authored
Simply having no content does not make an annotation a highlight (it also has to not be a page note or reply).
-
Sean Hammond authored
-
Sean Hammond authored
-
Sean Hammond authored
Clarify the logic a little.
-
Sean Hammond authored
-
Sean Hammond authored
-
- 03 Dec, 2015 5 commits
-
-
Sean Hammond authored
-
Sean Hammond authored
* Rename local variable `highlight` to `newlyCreatedByHighlightButton` and add a docstring - clarify what this piece of state actually means. * Fix `vm.isHighlight()`: It now returns `false` for new annotations that the user hasn't entered any text or tags for yet (instead of `true`). * Move the code for saving new highlights to the server into a `saveNewHighlight()` function that's called on AnnotationController instantiation instead of having it in a `$watch()` function that's called every time the local variable `model` changes. Also use the presence of `model.id` to avoid re-saving highlights that have already been saved - instead of abusing the `highlight` (now `newlyCreatedByHighlightButton`) variable and confusing what it represents. * Don't automatically open the annotation editor on Annotationcontroller instantiation if the annotation is a highlight. This fixes this bug: 1. Create a new highlight while logged out 2. Log in 3. Your highlight is saved to the server, but also the annotation editor is open on your highlight. The intention is that highlights are simply saved to the server, not opened for editing. _Annotations_ created while logged out, on the other hand, are _not_ saved to the server on login but _are_ opened for editing on login.
-
Robert Knight authored
Refactor annotation controller tests
-
Sean Hammond authored
-
Sean Hammond authored
-