Add button to re-import Harvest cache time entry from API
This commit is contained in:
		
							parent
							
								
									a1c9199416
								
							
						
					
					
						commit
						f388f2d6cf
					
				
					 2 changed files with 92 additions and 1 deletions
				
			
		
							
								
								
									
										45
									
								
								tailbone_harvest/templates/harvest/time-entries/view.mako
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								tailbone_harvest/templates/harvest/time-entries/view.mako
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,45 @@ | |||
| ## -*- coding: utf-8; -*- | ||||
| <%inherit file="/master/view.mako" /> | ||||
| 
 | ||||
| <%def name="object_helpers()"> | ||||
|   ${parent.object_helpers()} | ||||
|   ${self.render_import_helper()} | ||||
| </%def> | ||||
| 
 | ||||
| <%def name="render_import_helper()"> | ||||
|   % if master.has_perm('import_from_harvest'): | ||||
|       <nav class="panel"> | ||||
|         <p class="panel-heading">Re-Import</p> | ||||
|         <div class="panel-block buttons"> | ||||
|           <div style="display: flex; flex-direction: column;"> | ||||
|             % if master.has_perm('import_from_harvest'): | ||||
|                 ${h.form(master.get_action_url('import_from_harvest', instance), **{'@submit': 'importFromHarvestSubmitting = true'})} | ||||
|                 ${h.csrf_token(request)} | ||||
|                 <b-button type="is-primary" | ||||
|                           native-type="submit" | ||||
|                           icon-pack="fas" | ||||
|                           icon-left="redo" | ||||
|                           :disabled="importFromHarvestSubmitting"> | ||||
|                   {{ importFromHarvestSubmitting ? "Working, please wait..." : "Re-Import from Harvest" }} | ||||
|                 </b-button> | ||||
|                 ${h.end_form()} | ||||
|             % endif | ||||
|           </div> | ||||
|         </div> | ||||
|       </nav> | ||||
|   % endif | ||||
| </%def> | ||||
| 
 | ||||
| <%def name="modify_this_page_vars()"> | ||||
|   ${parent.modify_this_page_vars()} | ||||
|   % if master.has_perm('import_from_harvest'): | ||||
|       <script type="text/javascript"> | ||||
| 
 | ||||
|         ThisPageData.importFromHarvestSubmitting = false | ||||
| 
 | ||||
|       </script> | ||||
|   % endif | ||||
| </%def> | ||||
| 
 | ||||
| 
 | ||||
| ${parent.body()} | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar