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