Skip to content

Commit

Permalink
updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ninapavlich committed Jan 13, 2016
1 parent e605689 commit 62bab62
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
42 changes: 41 additions & 1 deletion README.md
@@ -1,2 +1,42 @@
# django-ace-overlay
Ace editor for Django admin
This is an implementation of the Ace Editor for Django, which uses an overlay to edit code instead of editing it directly. This is particularly useful when you are using a code editor in conjunction with inlines -- which gives you a scrolling window inside a scrolling window, enough to drive a person insane.

![CKEditor Dialog](https://raw.github.com/ninapavlich/django-ace-overlay/master/docs/screenshots/overlay.png)

By default, all code is visible in the admin as read-only text. Clicking the text opens the editor overlay.
![CKEditor Dialog](https://raw.github.com/ninapavlich/django-ace-overlay/master/docs/screenshots/readonly.png)


## Example Usage
```
$ pip install django-ace-overlay
```

```
#settings.py
INSTALLED_APPS = (
...
ace_overlay,
...
)
```


```python

#forms.py

from django import forms
from ace_overlay.widgets import AceOverlayWidget
from .models import Template


class TemplateAdminForm(forms.ModelForm):

custom_template = forms.CharField(widget=AceOverlayWidget(mode='html', wordwrap=False, theme='twilight', width="850px", height="800px", showprintmargin=True), required=False)

class Meta:
model = Template

```
3 changes: 2 additions & 1 deletion ace_overlay/static/ace_overlay/widget.js
Expand Up @@ -32,7 +32,8 @@
var editor = ace.edit(widget);
editor.setTheme("ace/theme/"+theme);
editor.getSession().setMode("ace/mode/"+mode);
editor.getSession().setUseWrapMode(true);
editor.getSession().setUseWrapMode(wordwrap);
editor.setShowPrintMargin(printmargin);
editor.setOptions({
readOnly: false,
highlightActiveLine: false,
Expand Down

0 comments on commit 62bab62

Please sign in to comment.