- Editable group fields
authorOlga Brani <olgabrani@grnet.gr>
Tue, 11 Sep 2012 13:46:36 +0000 (16:46 +0300)
committerOlga Brani <olgabrani@grnet.gr>
Tue, 11 Sep 2012 13:46:36 +0000 (16:46 +0300)
- Show all feature in search
-

snf-astakos-app/astakos/im/static/im/css/modules.css
snf-astakos-app/astakos/im/static/im/js/common.js
snf-astakos-app/astakos/im/templates/im/astakosgroup_detail.html
snf-astakos-app/astakos/im/templates/im/astakosgroup_list.html

index ac48aab..eda79f3 100644 (file)
@@ -327,4 +327,7 @@ table.alt-style tr td.info-td                                       { padding:5px; }
 table.alt-style tr td.info-td div                              { padding:15px; border:1px dashed #000 }\r
 table.alt-style tr td a.more-info                              { display:block; float:left; width:17px; height:16px; background:url(../images/plus-minus.png) no-repeat 0 0; margin-right:5px; }\r
 table.alt-style tr td a.more-info:hover                        { background-image:url(../images/plus-minus-hover.png); text-decoration:none;}\r
-table.alt-style tr td a.open                                   { background-position:-16px 0} 
\ No newline at end of file
+table.alt-style tr td a.open                                   { background-position:-16px 0} \r
+\r
+.projects .details a.edit                                              { float:right; }\r
+.projects .editable form textarea                              { width:70%; height:50px; max-width:70%;}\r
index e8a4add..4d02e61 100644 (file)
@@ -209,6 +209,13 @@ $(document).ready(function() {
                $(this).toggleClass('open');\r
                $(this).parents('tr').next('tr').toggle();\r
                 \r
+       });\r
+       \r
+       $('.projects .details .edit').click( function(e){\r
+               e.preventDefault();\r
+               $(this).parents('.details').children('.data').hide();\r
+               $(this).parents('.details').children('.editable').show();\r
+               $(this).hide();\r
        })\r
        \r
 });\r
index c639979..8fadbe0 100644 (file)
@@ -7,22 +7,65 @@
        
        <h2>
                {% if request.user in object.members %}
-                       <em>[ ENROLLED ]</em>           
+                       <em>
+                               {% if request.user in object.owner.all %}
+                                       [ADMINISTRATOR]
+                               {%  else %}
+                                       [ ENROLLED ]
+                               {% endif %}
+                       </em>           
                {% endif %}
                <span>[ {{object.kind|upper}} ]</span>  
         </h2>
+        
         <div class="details">
-               <p>{{ object.desc }}</p>
-                <dl class="alt-style">
-                       <dt>Homepage url</dt>
-                       <dd>
-                               {% if object.homepage%}
-                                       <a href="{{ object.homepage }}">{{ object.homepage }}</a>
-                               {% else %}
-                                       Not set yet
-                               {% endif %}
-                       </dd>
-                </dl>
+               {% if request.user in object.owner.all %}
+                       <a href="#" class="edit">[ EDIT GROUP INFO ]</a>
+               {% endif %}
+               <div class="data">
+                       <p>{{ object.desc }}</p>
+                       <dl class="alt-style">
+                               <dt>Homepage url</dt>
+                               <dd>
+                                       {% if object.homepage%}
+                                               <a href="{{ object.homepage }}">{{ object.homepage }}</a>
+                                       {% else %}
+                                               Not set yet
+                                       {% endif %}
+                               </dd>
+                        </dl>
+               </div>
+               <div class="editable" style="display:none;">
+                       <!-- demo form-->
+                       <form class="innerlabels" method="post" action=""><div style="display:none"><input type="hidden" value="d1d4677634f858843ca84e2cac5bbebc" name="csrfmiddlewaretoken" autocomplete="off"></div>
+                  
+                   <div class="form-errors all"></div>
+                               <div class="form-row   ">
+                                       
+                                    <p class="clearfix ">
+                                       <label for="id_homepage">Homepage</label>
+                                       <input type="text" id="id_homepage" name="homepage" autocomplete="off" value="{{ object.homepage }}">
+                                       <span class="extra-img">&nbsp;</span>
+                                       
+                                    </p>
+                               </div>
+                               
+                               <div class="form-row   ">
+                                       
+                                    <p class="clearfix ">
+                                       <label for="id_desc">Description</label>
+                                       <textarea name="desc" cols="40" rows="10" id="id_desc">{{ object.desc }}</textarea>
+                                       <span class="extra-img">&nbsp;</span>
+                                       
+                                    </p>
+                               </div>
+                                
+                               <div class="form-row submit">
+                                    <input type="submit" value="SUBMIT" class="submit altcol" autocomplete="off">
+                               </div>
+                               </form>
+                       <!-- end of demo form-->
+               </div>
         </div>
         <div class="full-dotted">
                 <h3>DETAILS:</h3>
index 43d76a4..b2e4ff3 100644 (file)
@@ -13,6 +13,8 @@
                 <input type="submit" class="submit altcol" value="SEARCH" />
             </div>
     </form>
+    
+       <p><a href="">Show all groups</a></p>
     {% else %}
     <div class="projects">
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. <br />You can <a href="{% url group_create_list %}">create a new group</a> or <a href="{% url group_search %}">join</a> to an existing one.</p>