summaryrefslogtreecommitdiff
path: root/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/theme_drawer.html
blob: 2c77ff31f161665aa9c8cb42e1851fc863913330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{% load pagination_tags %}
{% load i18n %}
<br/><br/>
<div>
  {% autopaginate drawer 10 %}
  <!-- Row containing LHS Resources and middle Navigation and RHS Collection -->
  <div class="row">
   <!-- For collection created on RHS -->
   <div class="small-5 small-left columns resource-drawer">
    

    <ul class="pricing-table" id="collection_drawer">        
      {% if drawer != "None" %}

      {% for value in drawer %}
      <li class="bullet-item" value={{value.pk}} > 
        <input type="hidden" class="node_id" value={{value.pk}} />
        <div class="row">
          <div class="small-1 columns resource-type-image" style="background-image: url({% url 'getFileThumbnail' groupid value.pk %}), url(/static/ndf/images/doc.png); ">
          </div>

          <div class="small-11 columns">

            <div class="row">
              <!-- <div class="small-5 columns text-left"> -->
              <div class="small-12 columns text-left">
                <b> {{value.name}} </b>   
              </div>                
              <!-- <div class="small-7 columns text-right"> -->
              <div class="small-12 columns text-left" style="padding-top:3px">
                <i class="posted-by">{{ value.member_of_names_list|join:', ' }} by <a class="user" href="{% url 'dashboard' value.created_by %}" data-gnow="">{{value.user_details_dict.created_by}}</a> on {{value.created_at|date:"j F Y"}} </i>
              </div>     
            </div>

            <div class="row">
              <div class="small-12 columns text-left" style="padding-top:5px;">
		{{ value.html_content|safe|striptags|truncatechars:50 }}
              </div>
           </div>
          </div>
        </div>

      </li>
      {% endfor %}
           
      {% endif %}
      
    </ul>
  </div>
  
  <!-- End of Collection created on RHS -->

  <!-- For arrows Up, Down -->
    <div class="small-1 columns" >

      <br/><br/><br/><br/><br/><br/>
      <span id="collection_btnUp" class="fontsize-x-large">
        <i class="fi-arrow-up coll-arrows"></i>
      </span>
      <br/>
     
      <span id="collection_btnDown" class="fontsize-x-large">
        <i class="fi-arrow-down coll-arrows"></i>
      </span>
           
   </div>
   <!-- End of arrows up, down -->
   <div class="small-6 columns" >  </div>


</div>
<br/>
{% paginate %}
</div>

<input id="collection_list" type="hidden" name="collection_list" value="" />


<script type="text/javascript">

    //To allocate space of 10 resources listing for drawers.
    $(".resource-drawer").height(400);

    // To select the single as well as multiple items from list 
     $(document).on('click','#collection_drawer li.bullet-item',function(e){
      
      if (e.ctrlKey)
      {        
        $(this).toggleClass('selected-resource');
      } 
      else
      {
        $('.bullet-item').removeClass('selected-resource');           
        $(this).addClass('selected-resource');        
      }     
      
    });
    

    function checkUpDownButton()
    {
      for(var i=0; i<collSelected.length-1; i++)
      {
        var flag;
        if( (collSelected[i].nextElementSibling) == (collSelected[i+1]) ){
          flag = true;
        }
        else{
          flag = false;
        }
      }
      return flag;
    }

    //For UP Button pressed :
    $("#collection_btnUp").click(function() {

      collSelected = $("#collection_drawer li.selected-resource");

      if( collSelected ){

        //If multiple element's are selected :
        if( collSelected.length > 1 ){

          if( checkUpDownButton ){
            prevFirstSel = collSelected[0].previousElementSibling;
            lastSel = collSelected[collSelected.length-1];

            $(prevFirstSel).insertAfter(lastSel);  
          }
        } 
        
        //If only one element is selected :
        else{
          currSel =  collSelected[0];
          $(currSel).insertBefore(currSel.previousElementSibling);
        }
      }
    });

    //For DOWN Button pressed :
    $("#collection_btnDown").click(function() {

      collSelected = $("#collection_drawer li.selected-resource");

      if( collSelected ){

        //If multiple element's are selected :
        if( collSelected.length > 1 ){

          if( checkUpDownButton ){
            FirstSel = collSelected[0];
            nexttoLastSel = collSelected[collSelected.length-1].nextElementSibling;

            $(nexttoLastSel).insertBefore(FirstSel);  
          }
        } 
        
        //If only one element is selected :
        else{
          currSel =  collSelected[0];
          $(currSel).insertAfter(currSel.nextElementSibling);
        }
      }
    });

  
</script>