]> git.mxchange.org Git - friendica.git/blob - view/smarty3/admin_remoteupdate.tpl
e14a679d8a89e089ebf8ae0d841dbb420677dd12
[friendica.git] / view / smarty3 / admin_remoteupdate.tpl
1 {{*
2  *      AUTOMATICALLY GENERATED TEMPLATE
3  *      DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
4  *
5  *}}<script src="js/jquery.htmlstream.js"></script>
6 <script>
7         /* ajax updater */
8         function updateEnd(data){
9                 //$("#updatepopup .panel_text").html(data);
10                 $("#remoteupdate_form").find("input").removeAttr('disabled');
11                 $(".panel_action_close").fadeIn()       
12         }
13         function updateOn(data){
14                 
15                 var patt=/§([^§]*)§/g; 
16                 var matches = data.match(patt);
17                 $(matches).each(function(id,data){
18                         data = data.replace(/§/g,"");
19                         d = data.split("@");
20                         console.log(d);
21                         elm = $("#updatepopup .panel_text #"+d[0]);
22                         html = "<div id='"+d[0]+"' class='progress'>"+d[1]+"<span>"+d[2]+"</span></div>";
23                         if (elm.length==0){
24                                 $("#updatepopup .panel_text").append(html);
25                         } else {
26                                 $(elm).replaceWith(html);
27                         }
28                 });
29                 
30                 
31         }
32         
33         $(function(){
34                 $("#remoteupdate_form").submit(function(){
35                         var data={};
36                         $(this).find("input").each(function(i, e){
37                                 name = $(e).attr('name');
38                                 value = $(e).val();
39                                 e.disabled = true;
40                                 data[name]=value;
41                         });
42
43                         $("#updatepopup .panel_text").html("");
44                         $("#updatepopup").show();
45                         $("#updatepopup .panel").hide().slideDown(500);
46                         $(".panel_action_close").hide().click(function(){
47                                 $("#updatepopup .panel").slideUp(500, function(){
48                                         $("#updatepopup").hide();
49                                 });                             
50                         });
51
52                         $.post(
53                                 $(this).attr('action'), 
54                                 data, 
55                                 updateEnd,
56                                 'text',
57                                 updateOn
58                         );
59
60                         
61                         return false;
62                 })
63         });
64 </script>
65 <div id="updatepopup" class="popup">
66         <div class="background"></div>
67         <div class="panel">
68                 <div class="panel_in">
69                         <h1>Friendica Update</h1>
70                         <div class="panel_text"></div>
71                         <div class="panel_actions">
72                                 <input type="button" value="{{$close}}" class="panel_action_close">
73                         </div>
74                 </div>
75         </div>
76 </div>
77 <div id="adminpage">
78         <dl> <dt>Your version:</dt><dd>{{$localversion}}</dd> </dl>
79 {{if $needupdate}}
80         <dl> <dt>New version:</dt><dd>{{$remoteversion}}</dd> </dl>
81
82         <form id="remoteupdate_form" method="POST" action="{{$baseurl}}/admin/update">
83         <input type="hidden" name="{{$remotefile.0}}" value="{{$remotefile.2}}">
84
85         {{if $canwrite}}
86                 <div class="submit"><input type="submit" name="remoteupdate" value="{{$submit}}" /></div>
87         {{else}}
88                 <h3>Your friendica installation is not writable by web server.</h3>
89                 {{if $canftp}}
90                         <p>You can try to update via FTP</p>
91                         {{include file="field_input.tpl" field=$ftphost}}
92                         {{include file="field_input.tpl" field=$ftppath}}
93                         {{include file="field_input.tpl" field=$ftpuser}}
94                         {{include file="field_password.tpl" field=$ftppwd}}
95                         <div class="submit"><input type="submit" name="remoteupdate" value="{{$submit}}" /></div>
96                 {{/if}}
97         {{/if}}
98         </form>
99 {{else}}
100 <h4>No updates</h4>
101 {{/if}}
102 </div>