added app frame to todo list
This commit is contained in:
		
							parent
							
								
									95a822c701
								
							
						
					
					
						commit
						c6fce634cf
					
				| @ -59,8 +59,7 @@ class DocType: | |||||||
| 			if cstr(d.uom) in check_list: | 			if cstr(d.uom) in check_list: | ||||||
| 				msgprint("UOM %s has been entered more than once in Conversion Factor Details." % cstr(d.uom)) | 				msgprint("UOM %s has been entered more than once in Conversion Factor Details." % cstr(d.uom)) | ||||||
| 				raise Exception | 				raise Exception | ||||||
| 
 | 			else: | ||||||
| 			if not cstr(d.uom) in check_list: |  | ||||||
| 				check_list.append(cstr(d.uom)) | 				check_list.append(cstr(d.uom)) | ||||||
| 
 | 
 | ||||||
| 			if cstr(d.uom) == cstr(self.doc.stock_uom): | 			if cstr(d.uom) == cstr(self.doc.stock_uom): | ||||||
|  | |||||||
| @ -14,8 +14,7 @@ | |||||||
| // You should have received a copy of the GNU General Public License
 | // You should have received a copy of the GNU General Public License
 | ||||||
| // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | ||||||
| 
 | 
 | ||||||
| pscript.onload_questions = function(wrapper) {	 | pscript.onload_questions = function(wrapper) { | ||||||
| 	console.log(1); |  | ||||||
| 	body = $(wrapper).find('.layout-main-section').get(0); | 	body = $(wrapper).find('.layout-main-section').get(0); | ||||||
| 	 | 	 | ||||||
| 	wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.layout-appframe')); | 	wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.layout-appframe')); | ||||||
|  | |||||||
| @ -47,4 +47,9 @@ | |||||||
| 
 | 
 | ||||||
| .todo-content { | .todo-content { | ||||||
| 	padding-right: 15px; | 	padding-right: 15px; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .layout-main { | ||||||
|  | 	background-color: #FFFDC9; | ||||||
|  | 	min-height: 300px; | ||||||
| } | } | ||||||
| @ -1,9 +1,6 @@ | |||||||
| <div class="layout-wrapper" style="min-height: 300px; background-color: #FFFDC9"> | <div class="layout-wrapper layout-wrapper-background"> | ||||||
| 	<div class="appframe-area"></div> | 	<div class="appframe-area"></div> | ||||||
| 	<div> | 	<div class="layout-main"> | ||||||
| 		<a class="close" onclick="window.history.back();">×</a> |  | ||||||
| 		<h1>To Do</h1> |  | ||||||
| 		<br> |  | ||||||
| 		<div> | 		<div> | ||||||
| 			<div id="todo-list"> | 			<div id="todo-list"> | ||||||
| 				<h4>My List</h4><br> | 				<h4>My List</h4><br> | ||||||
| @ -14,8 +11,6 @@ | |||||||
| 				<div class="todo-content"></div> | 				<div class="todo-content"></div> | ||||||
| 			</div> | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
| 		<div style="margin-top: 21px; clear: both"> | 		<div style="clear: both"></div> | ||||||
| 			<button id="add-todo" class="btn btn-small"><i class="icon-plus"></i> Add</button> |  | ||||||
| 		</div> |  | ||||||
| 	</div> | 	</div> | ||||||
| </div> | </div> | ||||||
| @ -48,11 +48,6 @@ erpnext.todo.refresh = function() { | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	}); | 	}); | ||||||
| 	 |  | ||||||
| 	$('#add-todo').click(function() { |  | ||||||
| 		erpnext.todo.make_dialog({ |  | ||||||
| 			date:get_today(), priority:'Medium', checked:0, description:''}); |  | ||||||
| 	}) |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| erpnext.todo.ToDoItem = Class.extend({ | erpnext.todo.ToDoItem = Class.extend({ | ||||||
| @ -196,7 +191,15 @@ erpnext.todo.save = function(btn) { | |||||||
| 	}); | 	}); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| wn.pages.todo.onload = function() { | wn.pages.todo.onload = function(wrapper) { | ||||||
|  | 	// create app frame
 | ||||||
|  | 	wrapper.appframe = new wn.ui.AppFrame($(wrapper).find('.appframe-area'), 'To Do'); | ||||||
|  | 	wrapper.appframe.add_button('Refresh', erpnext.todo.refresh, 'icon-refresh'); | ||||||
|  | 	wrapper.appframe.add_button('Add', function() { | ||||||
|  | 		erpnext.todo.make_dialog({ | ||||||
|  | 			date:get_today(), priority:'Medium', checked:0, description:''}); | ||||||
|  | 	}, 'icon-plus'); | ||||||
|  | 
 | ||||||
| 	// load todos
 | 	// load todos
 | ||||||
| 	erpnext.todo.refresh(); | 	erpnext.todo.refresh(); | ||||||
| } | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user