Github user benkeen commented on a diff in the pull request:
https://github.com/apache/couchdb-fauxton/pull/207#discussion_r22626976
--- Diff: app/addons/compaction/routes.js ---
@@ -11,49 +11,77 @@
// the License.
define([
- "app",
-
- "api",
-
- // Modules
- "addons/compaction/views",
- "addons/databases/resources"
+ 'app',
+ 'api',
+ 'addons/compaction/views',
+ 'addons/databases/resources',
+ 'addons/documents/shared-resources',
+ 'addons/documents/shared-views',
+ 'addons/fauxton/components'
],
-function(app, FauxtonAPI, Compaction, Databases) {
-
- var CompactionRouteObject = FauxtonAPI.RouteObject.extend({
- layout: "one_pane",
+function(app, FauxtonAPI, Compaction, Databases, Documents, SharedViews,
Components) {
- crumbs: function () {
- return [
- {"name": this.database.id, "link":
Databases.databaseUrl(this.database)},
- {"name": "Compact & Clean", "link": "compact"}
- ];
- },
+ function getCrumbs (database) {
+ return [
+ { "type": "back", "link": "/_all_dbs" },
+ { "name": database.id, "link": Databases.databaseUrl(database),
className: "lookahead-tray-link" }
+ ];
+ }
+ var CompactionRouteObject = FauxtonAPI.RouteObject.extend({
+ layout: "with_tabs_sidebar",
+ overrideBreadcrumbs: true,
routes: {
- "database/:database/compact": "compaction"
+ 'database/:database/compact': 'compaction'
},
- initialize: function(route, masterLayout, options) {
+ initialize: function (route, masterLayout, options) {
var databaseName = options[0];
-
- this.database = this.database || new Databases.Model({id:
databaseName});
+ this.database = this.database || new Databases.Model({ id:
databaseName });
--- End diff --
Hey @garrensmith, agreed that makes total sense. Do you have an example of
either a mixin or inheritance done on the route objects? Not sure how to
approach that & I was just wondering if something like this has been done
before that I can model it on.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---