Skip to content

Commit 9a17e5a

Browse files
committed
fixed merges
2 parents 46fe829 + 2e4bfba commit 9a17e5a

File tree

8 files changed

+44
-28
lines changed

8 files changed

+44
-28
lines changed

README.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Description
32
===========
43

@@ -24,9 +23,9 @@ License: GPL v3
2423
Links
2524
=====
2625

27-
Homepage (roadmap, bug reports, etc.): http://redmine.djity.net/projects/djityportal
28-
Git page (forks, patches, etc.): https://github.com/djity/djity
29-
Official documentation: http://pypi.python.org/pypi/djity
26+
* Homepage (roadmap, bug reports, etc.): http://redmine.djity.net/projects/djityportal
27+
* Git page (forks, patches, etc.): https://github.com/djity/djity
28+
* Official documentation: http://doc.djity.net/djity/
3029

3130
Features
3231
========

djity/locale/en/LC_MESSAGES/django.mo

1 Byte
Binary file not shown.

djity/project/tests.py

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,43 @@
1+
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
12
"""
23
This file demonstrates two different styles of tests (one doctest and one
34
unittest). These will both pass when you run "manage.py test".
45
56
Replace these with more appropriate tests for your application.
67
"""
8+
import json
9+
from django.utils import unittest
10+
from django.test.client import Client
11+
from djity.project.models import Project
12+
import djity
713

8-
from django.test import TestCase
14+
class ProjectTest(unittest.TestCase):
15+
fixtures = [djity.__path__[0]+'/fixtures/test_project.json']
916

10-
class SimpleTest(TestCase):
11-
def test_basic_addition(self):
17+
def setUp(self):
18+
# Every test needs a client.
19+
self.client = Client()
20+
21+
22+
def test_login(self):
1223
"""
13-
Tests that 1 + 1 always equals 2.
24+
Test the login
1425
"""
15-
self.failUnlessEqual(1 + 1, 2)
26+
argv = {
27+
'js_traget':'document',
28+
'path':'',
29+
'username':'admin',
30+
'password':'admin',
31+
'project_name':'root',
32+
'module_name':'home',
33+
'LANGUAGE_CODE':'fr'
34+
}
35+
Project.objects.get(name='root')
36+
response = self.client.post('/dajaxice/djity.portal.login/',{'callback':'Dajax.process','argv':json.dumps(argv)})
37+
self.assertEqual(response.status_code, 200)
38+
self.assertEqual(response.context['username'], 'admin')
39+
40+
1641

17-
__test__ = {"doctest": """
18-
Another way to test that 1 + 1 is equal to 2.
1942

20-
>>> 1 + 1 == 2
21-
True
22-
"""}
2343

djity/static/djity/js/widgets/editable.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ $.widget("ui.editable",{
1414
get_function:undefined,
1515
//send the id of the div to the save and get function
1616
send_divid:false,
17+
1718
toolbar:'maxi',
1819
},
1920
_create: function() {
@@ -59,6 +60,7 @@ $.widget("ui.editable",{
5960
*/
6061
if(! self.options.simple)
6162
{
63+
6264
self.editor_button = $('<button title="'+gettext('Rich Edit')+'">'+gettext('Rich Edit')+'</button>')
6365
.button({
6466
icons:{
@@ -143,12 +145,12 @@ $.widget("ui.editable",{
143145
editorBox = self.editorBox;
144146

145147
editorBox.hide(options.effect);
148+
146149
self._isOpen = false;
147150
if(self.is_editor){
148151
self.close_editor();
149152
}
150153
self.close();
151-
152154

153155
},
154156

@@ -182,6 +184,7 @@ $.widget("ui.editable",{
182184

183185
},
184186

187+
185188
save : function(close){
186189
var self = this,
187190
options = self.options,
@@ -355,8 +358,4 @@ $.widget("ui.editable",{
355358
document.execCommand ('insertLineBreak', false, null);
356359
},
357360

358-
359-
360-
361-
362361
});

djity/static/djity/js/widgets/register.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ dj.widgets.register =
3131
dj.widgets.register.close();
3232
};
3333

34-
3534
this.dialog = $('<div id="register_dialog" class="ui-helper-hidden" title="' + gettext('Create an account') +'"></div>')
3635
.keyup(function(e)
3736
{

djity/templates/djity/simplepage/page.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
{% endblock %}
99

1010
{% block module_onload %}
11+
if(dj.context.perm.edit){
1112
$('#simple_page_content').editable(
1213
{
1314
save_function:'djity.simplepage.save_simple_page',
1415
get_function:'djity.simplepage.get_simple_page',
1516
lang:dj.context.simple_page_lang
1617
});
17-
18+
}
1819
{% endblock %}
1920
{% block body %}
2021
<div id="simple_page_content" >

djity/utils/decorators.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,8 @@ def _new_func(*args,**kwargs):
119119
if module_name and not 'module' in context:
120120
context.message(_("This page does not exist on this project !"))
121121
context["module"] = {'label':_('Page not found')}
122-
return render_to_response('djity/base.html',context)
123-
#t = loader.get_template('djity/base.html')
124-
#r = t.render(context)
125-
#return HttpResponseNotFound(r)
122+
templ = loader.get_template('djity/base.html')
123+
return HttpResponseNotFound(templ.render(context))
126124

127125
if 'js_target' in context:
128126
func(*args,**kwargs)

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
'templates/djity/*.html',
1616
'templates/djity/*/*.html',
1717
'templates/djity/style/*.css',
18-
'media/*/*.*',
19-
'media/*/*/*.*',
20-
'media/*/*/*/*.*',
18+
'static/*/*.*',
19+
'static/*/*/*.*',
20+
'static/*/*/*/*.*',
2121
'project_skeleton/*_tmpl',
2222
'project_skeleton/data/cache/setup_trap',
2323
'project_skeleton/media/setup_trap',

0 commit comments

Comments
 (0)