File tree Expand file tree Collapse file tree 8 files changed +44
-28
lines changed
templates/djity/simplepage Expand file tree Collapse file tree 8 files changed +44
-28
lines changed Original file line number Diff line number Diff line change 1
-
2
1
Description
3
2
===========
4
3
@@ -24,9 +23,9 @@ License: GPL v3
24
23
Links
25
24
=====
26
25
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/
30
29
31
30
Features
32
31
========
Original file line number Diff line number Diff line change
1
+ # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
1
2
"""
2
3
This file demonstrates two different styles of tests (one doctest and one
3
4
unittest). These will both pass when you run "manage.py test".
4
5
5
6
Replace these with more appropriate tests for your application.
6
7
"""
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
7
13
8
- from django .test import TestCase
14
+ class ProjectTest (unittest .TestCase ):
15
+ fixtures = [djity .__path__ [0 ]+ '/fixtures/test_project.json' ]
9
16
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 ):
12
23
"""
13
- Tests that 1 + 1 always equals 2.
24
+ Test the login
14
25
"""
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
+
16
41
17
- __test__ = {"doctest" : """
18
- Another way to test that 1 + 1 is equal to 2.
19
42
20
- >>> 1 + 1 == 2
21
- True
22
- """ }
23
43
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ $.widget("ui.editable",{
14
14
get_function :undefined ,
15
15
//send the id of the div to the save and get function
16
16
send_divid :false ,
17
+
17
18
toolbar :'maxi' ,
18
19
} ,
19
20
_create : function ( ) {
@@ -59,6 +60,7 @@ $.widget("ui.editable",{
59
60
*/
60
61
if ( ! self . options . simple )
61
62
{
63
+
62
64
self . editor_button = $ ( '<button title="' + gettext ( 'Rich Edit' ) + '">' + gettext ( 'Rich Edit' ) + '</button>' )
63
65
. button ( {
64
66
icons :{
@@ -143,12 +145,12 @@ $.widget("ui.editable",{
143
145
editorBox = self . editorBox ;
144
146
145
147
editorBox . hide ( options . effect ) ;
148
+
146
149
self . _isOpen = false ;
147
150
if ( self . is_editor ) {
148
151
self . close_editor ( ) ;
149
152
}
150
153
self . close ( ) ;
151
-
152
154
153
155
} ,
154
156
@@ -182,6 +184,7 @@ $.widget("ui.editable",{
182
184
183
185
} ,
184
186
187
+
185
188
save : function ( close ) {
186
189
var self = this ,
187
190
options = self . options ,
@@ -355,8 +358,4 @@ $.widget("ui.editable",{
355
358
document . execCommand ( 'insertLineBreak' , false , null ) ;
356
359
} ,
357
360
358
-
359
-
360
-
361
-
362
361
} ) ;
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ dj.widgets.register =
31
31
dj . widgets . register . close ( ) ;
32
32
} ;
33
33
34
-
35
34
this . dialog = $ ( '<div id="register_dialog" class="ui-helper-hidden" title="' + gettext ( 'Create an account' ) + '"></div>' )
36
35
. keyup ( function ( e )
37
36
{
Original file line number Diff line number Diff line change 8
8
{% endblock %}
9
9
10
10
{% block module_onload %}
11
+ if(dj.context.perm.edit){
11
12
$('#simple_page_content').editable(
12
13
{
13
14
save_function:'djity.simplepage.save_simple_page',
14
15
get_function:'djity.simplepage.get_simple_page',
15
16
lang:dj.context.simple_page_lang
16
17
});
17
-
18
+ }
18
19
{% endblock %}
19
20
{% block body %}
20
21
< div id ="simple_page_content " >
Original file line number Diff line number Diff line change @@ -119,10 +119,8 @@ def _new_func(*args,**kwargs):
119
119
if module_name and not 'module' in context :
120
120
context .message (_ ("This page does not exist on this project !" ))
121
121
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 ))
126
124
127
125
if 'js_target' in context :
128
126
func (* args ,** kwargs )
Original file line number Diff line number Diff line change 15
15
'templates/djity/*.html' ,
16
16
'templates/djity/*/*.html' ,
17
17
'templates/djity/style/*.css' ,
18
- 'media /*/*.*' ,
19
- 'media /*/*/*.*' ,
20
- 'media /*/*/*/*.*' ,
18
+ 'static /*/*.*' ,
19
+ 'static /*/*/*.*' ,
20
+ 'static /*/*/*/*.*' ,
21
21
'project_skeleton/*_tmpl' ,
22
22
'project_skeleton/data/cache/setup_trap' ,
23
23
'project_skeleton/media/setup_trap' ,
You can’t perform that action at this time.
0 commit comments