Skip to content

Commit

Permalink
Merge branch 'master' into 3016-template-tweaks
Browse files Browse the repository at this point in the history
Conflicts:
	ckan/config/routing.py

icons added and dashboard url changed
  • Loading branch information
tobes committed Nov 27, 2012
2 parents 9b766b6 + 7f630a9 commit 4eadae6
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ckan/config/routing.py
Expand Up @@ -303,7 +303,7 @@ def make_map():
# in the route.
m.connect('user_activity_stream', '/user/activity/{id}',
action='activity', ckan_icon='time')
m.connect('/user/dashboard', action='dashboard')
m.connect('/dashboard', action='dashboard')
m.connect('user_follow', '/user/follow/{id}', action='follow')
m.connect('/user/unfollow/{id}', action='unfollow')
m.connect('user_followers', '/user/followers/{id:.*}',
Expand Down
1 change: 0 additions & 1 deletion ckan/templates/user/dashboard.html
Expand Up @@ -5,7 +5,6 @@
{% block subtitle %}{{ _('Dashboard') }}{% endblock %}

{% block breadcrumb_content %}
<li>{% link_for _('Users'), controller='user', action='index' %}</li>
<li class="active"><a href="">{{ _('Dashboard') }}</a></li>
{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions ckan/tests/functional/test_user.py
Expand Up @@ -187,8 +187,8 @@ def test_login(self):
# then get redirected to user's dashboard
res = res.follow()
assert_equal(res.status, 302)
assert res.header('Location').startswith('http://localhost/user/dashboard') or \
res.header('Location').startswith('/user/dashboard')
assert res.header('Location').startswith('http://localhost/dashboard') or \
res.header('Location').startswith('/dashboard')
res = res.follow()
assert_equal(res.status, 200)
assert 'testlogin is now logged in' in res.body
Expand Down
5 changes: 5 additions & 0 deletions doc/contributing.rst
Expand Up @@ -109,6 +109,11 @@ branch and it will become part of CKAN!
see `Feature Branches`_.
- Your branch should contain new or changed tests for any new or changed
code, see :ref:`Testing`.
- Your branch should contain updates to the
`CHANGELOG file <https://github.com/okfn/ckan/blob/master/CHANGELOG.txt>`_
briefly summarising your code changes.
- Your branch should contain new or updated documentation for any new or
updated code, see :doc:`contributing-docs`.
- Your branch should be up to date with the master branch of the central
CKAN repo, see `Keeping Up with master`_.
- All the CKAN tests should pass on your branch, see :doc:`test`.
Expand Down
88 changes: 88 additions & 0 deletions doc/frontend-testing.rst
@@ -0,0 +1,88 @@
Front-end Testing
=================

All new CKAN features should be coded so that they work in the
following browsers:

* Internet Explorer: 9, 8 and 7
* Firefox: Latest + previous version
* Chrome: Latest + previous version

These browsers are determined by whatever has >= 1% share with the
latest months data from: http://data.gov.uk/data/site-usage

Install browser virtual machines
--------------------------------

In order to test in all the needed browsers you'll need access to
all the above browser versions. Firefox and Chrome should be easy
whatever platform you are on. Internet Explorer is a little trickier.
You'll need Virtual Machines.

We suggest you use https://github.com/xdissent/ievms to get your
Internet Explorer virtual machines.

Testing methodology
-------------------

Firstly we have a primer page. If you've touched any of the core
front-end code you'll need to check if the primer is rendering
correctly. The primer is located at:
http://localhost:5000/testing/primer

Secondly whilst writing a new feature you should endeavour to test
in at least in your core browser and an alternative browser as often
as you can.

Thirdly you should fully test all new features that have a front-end
element in all browsers before making your pull request into
CKAN master.

Common pitfulls & their fixes
=============================

Here's a few of the most common front end bugs and a list of their
fixes.

Reserved JS keywords
--------------------

Since IE has a stricter language definition in JS it really doesn't
like you using JS reserved keywords method names, variables, etc...
This is a good list of keywords not to use in your JavaScript:

https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Reserved_Words

::

/* These are bad */
var a = {
default: 1,
delete: function() {}
};

/* These are good */
var a = {
default_value: 1,
remove: function() {}
};

Unclosed JS arrays / objects
----------------------------

Internet Explorer doesn't like it's JS to have unclosed JS objects
and arrays. For example:

::

/* These are bad */
var a = {
b: 'c',
};
var a = ['b', 'c', ];

/* These are good */
var a = {
c: 'c'
};
var a = ['b', 'c'];
12 changes: 10 additions & 2 deletions doc/python-coding-standards.rst
Expand Up @@ -23,8 +23,16 @@ avoid spurious merge conflicts, and aid in reading pull requests.
Use Single Quotes
-----------------

Use the single-quote character, ``'``, rather than the double-quote character,
``"``, for string literals.
Use single-quotes for string literals, e.g. ``'my-identifier'``, *but* use
double-quotes for strings that are likely to contain single-quote characters as
part of the string itself (such as error messages, or any strings containing
natural language), e.g. ``"You've got an error!"``.

Single-quotes are easier to read and to type, but if a string contains
single-quote characters then double-quotes are better than escaping the
single-quote characters or wrapping the string in double single-quotes.

We also use triple single-quotes for docstrings, see `Docstrings`_.


Imports
Expand Down

0 comments on commit 4eadae6

Please sign in to comment.