]> git.mxchange.org Git - friendica.git/blobdiff - templates/contacts-template.tpl
hovercard: some polishing
[friendica.git] / templates / contacts-template.tpl
index e33855b6d54f20af65c334049f54a35f3e1ed43b..e8870e830748fb79a57d351ace3d6f792a977af5 100644 (file)
 
        {{* The search input field to search for contacts *}}
        <div id="contacts-search-wrapper">
-               <form id="contacts-search-form" class="navbar-form" action="{{$cmd}}" method="get" >
-                       <label for="contacts-search" class="contacts-search-desc">{{$desc}}</label><br/>
-                       <div class="input-group">
-                               <input type="text" name="search" id="contacts-search" class="search-input form-control" onfocus="this.select();" value="{{$search|escape:'html'}}" />
-                               <div class="input-group-btn">
-                                       <button class="btn btn-default" type="submit" name="submit" id="contacts-search-submit" value="{{$submit|escape:'html'}}"><i class="fa fa-search"></i></button>
+               <form id="contacts-search-form" class="navbar-form" role="search" action="{{$cmd}}" method="get" >
+                       <div class="row">
+                               <div class="col-md-2"></div>
+                               <div class="col-md-8 ">
+                                       <div class="form-group form-group-search">
+                                               <input type="text" name="search" id="contacts-search" class="search-input form-control form-search" onfocus="this.select();" value="{{$search|escape:'html'}}" placeholder="{{$desc}}"/>
+                                               <button class="btn btn-default btn-sm form-button-search" type="submit" name="submit" id="contacts-search-submit" value="{{$submit|escape:'html'}}">{{$submit}}</button>
+                                       </div>
                                </div>
+                               <div class="col-md-2"></div>
                        </div>
                </form>
        </div>
        <div id="contacts-search-end"></div>
 
        {{* we need the form container to make batch actions work *}}
-       <form action="{{$baseurl}}/contacts/batch/" method="POST">
+       <form name="batch_actions_submit" action="{{$baseurl}}/contacts/batch/" method="POST">
+
+               {{* we put here a hidden input element. This is needed to transmit the batch actions with javascript*}}
+               <input type="hidden" class="batch-action no-input fakelist" name="batch_submit" value="{{$l|escape:'html'}}">
+
                {{* We put the contact batch actions in a dropdown menu *}}
                <ul class="nav nav-pills preferences">
                        <li class="dropdown pull-right">
-                               <a class="btn btn-link dropdown-toggle" type="button" id="BatchActionDropdownMenuTools" data-toggle="dropdown" aria-expanded="true">
-                                       <i class="fa fa-angle-down"></i>
+                               <a class="btn btn-link btn-sm dropdown-toggle" type="button" id="BatchActionDropdownMenuTools" data-toggle="dropdown" aria-expanded="true">
+                                       <i class="fa fa-angle-down"></i> Batch Actions{{* Does need a Translation and a Variable in core*}}
                                </a>
                                <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="BatchActionDropdownMenuTools">
                                {{foreach $batch_actions as $n=>$l}}
-                                       <li role="presentation">
-                                               <input class="batch-action no-input fakelist" name="{{$n}}" value="{{$l|escape:'html'}}" type="submit">
+                                       <li role="menuitem">
+                                               {{* call the js batch_submit_handler. Have a look at the buttom of this file *}}
+                                               <a onclick="batch_submit_handler('{{$n}}', '{{$l}}')">{{$l}}</a>
                                        </li>
                                {{/foreach}}
                                </ul>
                        </li>
                </ul>
-               <div class="clear">
-
-               {{* format each contact with the contact_template.tpl *}}
-               <ul id="viewcontact_wrapper" class="viewcontact_wrapper media-list">
-               {{foreach $contacts as $contact}}
-                       <li>{{include file="contact_template.tpl"}}</li>
-               {{/foreach}}
-               </ul>
+               <div class="clear"></div>
+               <div id="contact-list">
+                       {{* format each contact with the contact_template.tpl *}}
+                       <ul id="viewcontact_wrapper" class="viewcontact_wrapper media-list">
+                       {{foreach $contacts as $contact}}
+                               <li>{{include file="contact_template.tpl"}}</li>
+                       {{/foreach}}
+                       </ul>
+               </div>
                <div id="contact-edit-end"></div>
        </form>
 
        {{$paginate}}
 </div>
 
-{{* The modals for Poke and Messages
-this needs to be removed and do it with js *}}
-<div class="modal" id="PokeModal" tabindex="-1" role="dialog" aria-labelledby="PokeModal" aria-hidden="true">
-       <div class="modal-dialog">
-               <div class="modal-content">
-               </div> <!-- /.modal-content -->
-       </div> <!-- /.modal-dialog -->
-</div> <!-- /.modal -->
-
-<div class="modal" id="MailModal" tabindex="-1" role="dialog" aria-labelledby="MailModal" aria-hidden="true">
-       <div class="modal-dialog">
-               <div class="modal-content">
-               </div> <!-- /.modal-content -->
-       </div> <!-- /.modal-dialog -->
-</div> <!-- /.modal -->
-
 <script>
  $(document).ready(function() {
-  // replace data target for poke & private Message to make Modal Dialog possible
-  $('li a[href^="{{$baseurl}}/poke/?f"]').attr('data-target','#PokeModal').attr('data-toggle', 'modal');
-  $('li a[href^="{{$baseurl}}/message/new"]').attr('data-target','#MailModal').attr('data-toggle', 'modal');
   // javascript dialog to batch actions
   $(".batch-action").click(function(e){
     if (confirm($(this).attr('value')+" ?")) {
@@ -101,5 +90,21 @@ this needs to be removed and do it with js *}}
    
   });
  });
+
+/**
+ * @brief This function submits the form with the batch action values
+ *
+ * @param string name The name of the batch action
+ * @param string value If it isn't empty the action will be posted
+ */
+function batch_submit_handler(name, value) {
+    // set the value of the hidden input element with the name batch_submit
+    document.batch_actions_submit.batch_submit.value=value;
+    // change the name of the input element from batch_submit according to the
+    // name which is transmitted to this function
+    document.batch_actions_submit.batch_submit.name=name;
+    // transmit the form
+    document.batch_actions_submit.submit() ;
+}
  </script>