Changeset - 6a4f13866fe6
[Not reviewed]
default
0 2 0
Mads Kiilerich - 11 years ago 2015-03-25 20:17:35
madski@unity3d.com
gists: add missing formencode.htmlfill import
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/gists.py
Show inline comments
 
@@ -19,25 +19,25 @@ gist controller for Kallithea
 

	
 
This file was forked by the Kallithea project in July 2014.
 
Original author and date, and relevant copyright and licensing information is below:
 
:created_on: May 9, 2013
 
:author: marcink
 
:copyright: (c) 2013 RhodeCode GmbH, and others.
 
:license: GPLv3, see LICENSE.md for more details.
 
"""
 

	
 
import time
 
import logging
 
import traceback
 
import formencode
 
import formencode.htmlfill
 

	
 
from pylons import request, response, tmpl_context as c, url
 
from pylons.controllers.util import redirect
 
from pylons.i18n.translation import _
 

	
 
from kallithea.model.forms import GistForm
 
from kallithea.model.gist import GistModel
 
from kallithea.model.meta import Session
 
from kallithea.model.db import Gist, User
 
from kallithea.lib import helpers as h
 
from kallithea.lib.base import BaseController, render
 
from kallithea.lib.auth import LoginRequired, NotAnonymous
kallithea/templates/admin/gists/new.html
Show inline comments
 
@@ -48,26 +48,26 @@
 
                    <select id="mimetype" name="mimetype"/>
 
                </div>
 
                <div id="editor_container">
 
                    <pre id="editor_pre"></pre>
 
                    <textarea id="editor" name="content" style="display:none"></textarea>
 
                </div>
 
            </div>
 
            <div style="padding-top: 5px">
 
            ${h.submit('private',_('Create Private Gist'),class_="btn btn-mini btn-success")}
 
            ${h.submit('public',_('Create Public Gist'),class_="btn btn-mini")}
 
            ${h.reset('reset',_('Reset'),class_="btn btn-mini")}
 
            </div>
 
            ${h.end_form()}
 
            <script type="text/javascript">
 
          ${h.end_form()}
 
          <script type="text/javascript">
 
            var myCodeMirror = initCodeMirror('editor', '');
 

	
 
            //inject new modes
 
            var $modes_select = $('#mimetype');
 
            $modes_select.each(function(){
 
                var modes_select = this;
 
                var index = 1;
 
                for(var i=0;i<CodeMirror.modeInfo.length;i++) {
 
                    var m = CodeMirror.modeInfo[i];
 
                    var opt = new Option(m.name, m.mime);
 
                    $(opt).attr('mode', m.mode);
 
                    if (m.mime == 'text/plain') {
 
@@ -96,18 +96,18 @@
 

	
 
            // on type the new filename set mode
 
            $filename.keyup(function(e){
 
                var file_data = CodeMirror.getFilenameAndExt(this.value);
 
                if(file_data['ext'] != null){
 
                    var detected_mode = CodeMirror.findModeByExtension(file_data['ext']) || CodeMirror.findModeByMIME('text/plain');
 
                    if (detected_mode){
 
                        setCodeMirrorMode(myCodeMirror, detected_mode);
 
                        $modes_select.val(detected_mode.mime);
 
                    }
 
                }
 
            });
 
            </script>
 
          </script>
 
        </div>
 
    </div>
 

	
 
</div>
 
</%def>
0 comments (0 inline, 0 general)