Skip to content

Commit

Permalink
Merge pull request #145 from maurizi/topic/recentUserEdits
Browse files Browse the repository at this point in the history
Topic/recent user edits
  • Loading branch information
maurizi committed Aug 7, 2013
2 parents 875cafa + 567d836 commit b769b8a
Show file tree
Hide file tree
Showing 11 changed files with 590 additions and 156 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = function(grunt) {
src: [],
dest: 'static/js/treemap.js',
options: {
alias: ['js/src/app.js:treemap'],
alias: ['js/src/app.js:app','js/src/user.js:user'],
aliasMappings: {
cwd: 'js/lib/',
src: ['*.js'],
Expand Down
6 changes: 4 additions & 2 deletions opentreemap/opentreemap/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.views.generic import RedirectView

from treemap.views import (user_view, root_settings_js_view,
profile_to_user_view)
profile_to_user_view, user_audits_view)

from django.contrib import admin
admin.autodiscover()
Expand All @@ -29,7 +29,9 @@
url(r'^(?P<instance_id>\d+)/', include('treemap.urls')),
url(r'^(?P<instance_id>\d+)/eco/', include('ecobenefits.urls')),
url(r'^config/settings.js$', root_settings_js_view),
url(r'^users/(?P<username>\w+)/', user_view),
url(r'^users/(?P<username>\w+)/?$', user_view),
url(r'^users/(?P<username>\w+)/recent_edits$', user_audits_view,
name='user_audits'),
url(r'^api/v2/', include('api.urls')),
# The profile view is handled specially by redirecting to
# the page of the currently logged in user
Expand Down
14 changes: 14 additions & 0 deletions opentreemap/treemap/js/src/user.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"use strict";

var $ = require('jquery');

exports.init = function(options) {
var $container = $(options.container),
links = [options.prevLink, options.nextLink].join(',');

$container.on('click', links, function(e) {
e.preventDefault();

$container.load(this.href);
});
};
Loading

0 comments on commit b769b8a

Please sign in to comment.