diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/app.py | 30 | ||||
-rw-r--r-- | app/static/css/main.css | 2 | ||||
-rw-r--r-- | app/templates/filer.html | 17 | ||||
-rw-r--r-- | app/templates/split-view.html | 4 |
4 files changed, 43 insertions, 10 deletions
@@ -61,7 +61,7 @@ def edit(filename=None): session.modified = True if filename: try: - if len(session['edit_history'])==6: + if len(session['edit_history'])==8: session['edit_history'].pop(0) if not filename in session['edit_history']: session['edit_history'].append(filename) @@ -106,6 +106,7 @@ def chdir(): session['project_name']=line[7:-1] session['pwd']=session['project_home_dir']="." os.chdir(session['project_dir']) + #flash('Acabo de cambiar a: '+os.path.realpath(".")) session['project_home']='/help' session['edit_history']=[] if os.path.isdir('app'): @@ -128,6 +129,7 @@ def browse_home(): @app.route('/files/<path:directory>') def browse(directory='.'): session['pwd']=directory + #flash('estoy en: '+os.path.realpath(".")) filelist = list_files(directory) try: @@ -157,7 +159,8 @@ def browse(directory='.'): return render_response('filer.html', dict(files=files, absdir=os.path.normpath(directory), width=len(files)*94+10,# 94px is each file and 10px margin - project_name=project_name + project_name=project_name, + float="left" )) @app.route('/delete/<path:filename>') @@ -198,6 +201,29 @@ def help(): activities=activities, project_name=project_name, edit_history=files)) +@app.route('/history') +def history(): + files = [] + try: + for filename in session['edit_history']: + icon, mode, href = identify(filename) + files.append( { 'name': os.path.basename(filename), + 'icon': icon, + 'mode': mode, + 'href': href } ) + except: + pass + try: + project_name=session['project_name'] + except KeyError: + project_name='None'; + return render_response('filer.html', dict(files=files, + absdir="Last editing sessions", + width=len(files)*94+10,# 94px is each file and 10px margin + project_name=project_name, + float="right" + )) + def vsplit(frame1='/help', frame2='/files/'): return render_response('split-view.html', dict(frame1=frame1, frame2=frame2)) diff --git a/app/static/css/main.css b/app/static/css/main.css index d672508..7a95f7b 100644 --- a/app/static/css/main.css +++ b/app/static/css/main.css @@ -52,6 +52,7 @@ hr { div#filer { display: none; + padding-top: 32px; } #filer ul{ @@ -97,6 +98,7 @@ div#filer { padding-bottom: 7px; /* padding-left: 15px; */ width: 100%; + position:fixed; } #filer-header div{ diff --git a/app/templates/filer.html b/app/templates/filer.html index 2aefc5b..7667ae7 100644 --- a/app/templates/filer.html +++ b/app/templates/filer.html @@ -27,22 +27,23 @@ <body> <div style="position:absolute; height:24px; z-index: -1;width:${width}px;" class="filer-header"> </div> - <div style="height:24px;" class="filer-header"> - <ul py:if="files != []" id="icons" style="float:left;padding-left:7px;" class="ui-widget ui-helper-clearfix"> + <div style="height:24px;position:fixed;" class="filer-header"> + <ul py:if="files != [] or project_name.startswith('Last')" id="icons" style="float:left;padding-left:7px;" class="ui-widget ui-helper-clearfix"> <li onclick="location='/fileshome/'" class="ui-state-default ui-corner-all" title="Project Home"><span class="ui-icon ui-icon-home"></span></li> <li class="ui-state-default ui-corner-all" title="New Directory"><span class="ui-icon ui-icon-folder-open"></span></li> <li onclick="parent.frame1.location='/edit/'" class="ui-state-default ui-corner-all" title="New File"><span class="ui-icon ui-icon-document"></span></li> </ul> + <ul style="float:right;margin-right:10px;" id="icons" class="ui-widget ui-helper-clearfix"> + <li onclick="toggle_files()" class="ui-state-default ui-corner-all" title="New Directory"><span class="ui-icon ui-icon-arrowstop-1-n"></span></li> + <li onclick="location='/history'" class="ui-state-default ui-corner-all" title=".ui-icon-clock"><span class="ui-icon ui-icon-clock"></span></li> + </ul> <div style="padding-top:7px;width:100%;"> <span style="padding-left:10px;color:gray;">[${project_name}]</span> /${absdir} </div> - <!-- ul id="icons" class="ui-widget ui-helper-clearfix"> - <li class="ui-state-default ui-corner-all" title=".ui-icon-home"><span class="ui-icon ui-icon-home"></span></li> - </ul--> </div> - <div style="width:${width}px;" id="filer" > + <div style="width:${width}px;float:${float}" id="filer" > <div id="noproject" py:if="files == []" style="color:gray;"> no active project </div> @@ -60,6 +61,10 @@ </ul> </div> <script> +function toggle_files() { + var fm = top.document.getElementsByTagName("FRAMESET").item(0); + fm.rows = (fm.rows != '*,32px' ? '*,32px' : '*,155px' ); +} jQuery.fn.center = function () { this.css("position","absolute"); this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px"); diff --git a/app/templates/split-view.html b/app/templates/split-view.html index 7884a82..b2092bb 100644 --- a/app/templates/split-view.html +++ b/app/templates/split-view.html @@ -3,7 +3,7 @@ <title>Construct Activity</title> </head> <frameset rows="*, 155px"> - <frame name="frame1" src="${frame1}" /> - <frame name="frame2" src="${frame2}" /> + <frame name="frame1" id="frame1" src="${frame1}" /> + <frame name="frame2" id="frame2" src="${frame2}" /> </frameset> </html> |