summaryrefslogtreecommitdiff
path: root/gnowsys-ndf/gnowsys_ndf
diff options
context:
space:
mode:
authorAnuja G <anuja.gk@gmail.com>2013-12-05 18:05:57 +0530
committerAnuja G <anuja.gk@gmail.com>2013-12-05 18:05:57 +0530
commit33c595af047319d9cb4bc9e22a8ef77e8c215836 (patch)
tree112e03964117a4fc513bc4c03598fa463221d687 /gnowsys-ndf/gnowsys_ndf
parentb1a7c244ad6f534a425724d9ce40abf2c932e04c (diff)
downloadgnowsys-33c595af047319d9cb4bc9e22a8ef77e8c215836.tar.gz
Minor changes in page save and edit urls
Diffstat (limited to 'gnowsys-ndf/gnowsys_ndf')
-rw-r--r--gnowsys-ndf/gnowsys_ndf/ndf/static/ndf/css/default.css12
-rw-r--r--gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/edit_page.html2
-rw-r--r--gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/group.html2
-rw-r--r--gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/groupdashboard.html30
-rw-r--r--gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/page.html2
-rw-r--r--gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py9
-rw-r--r--gnowsys-ndf/gnowsys_ndf/ndf/urls/__init__.py8
-rw-r--r--gnowsys-ndf/gnowsys_ndf/ndf/urls/page.py2
-rw-r--r--gnowsys-ndf/gnowsys_ndf/ndf/views/page.py12
9 files changed, 59 insertions, 20 deletions
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/static/ndf/css/default.css b/gnowsys-ndf/gnowsys_ndf/ndf/static/ndf/css/default.css
index eff4a356..322b5500 100644
--- a/gnowsys-ndf/gnowsys_ndf/ndf/static/ndf/css/default.css
+++ b/gnowsys-ndf/gnowsys_ndf/ndf/static/ndf/css/default.css
@@ -2972,6 +2972,18 @@ padding-left:3px;
padding-top:3px;
color:#BAC1C8;
}
+
+.sidebar {
+float:right;
+margin-right:2px;
+margin-top:62px;
+top:10px;
+background-color:#BAC1C8;
+vertical-align:top;
+position:fixed;
+right:133px;
+
+}
.footer {
background-color: #0B6580;
color: #bac1c8;
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/edit_page.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/edit_page.html
index d492ad16..9673181b 100644
--- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/edit_page.html
+++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/edit_page.html
@@ -13,7 +13,7 @@
{% block body_content %}
{% get_group_name request.path as group_name %}
-<form id="form_edit_page" method="POST" action="{% url 'edit_page' group_name node.name node.id %}">
+<form id="form_edit_page" method="POST" action="{% url 'edit_page' group_name node_id %}">
{% csrf_token %}
<div style="display:inline-block;">
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/group.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/group.html
index 703c963b..19a3b03d 100644
--- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/group.html
+++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/group.html
@@ -20,7 +20,7 @@
<h5>Number Of Nodes : {{ group_nodes_count }} </h5>
{% endif %}
<div>
- <p><strong><a href="">{{ node }}</a></strong><br>
+ <p><strong><a href="/{{node}}">{{ node }}</a></strong><br>
<!--
Created at : {{ node.created_at|date:"j F Y" }}<br>
Member Of : {{ node.member_of }}<br>
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/groupdashboard.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/groupdashboard.html
index 57859c24..b73cb8b0 100644
--- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/groupdashboard.html
+++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/groupdashboard.html
@@ -1,15 +1,37 @@
{% extends "ndf/base.html" %}
-
+{% load ndf_tags %}
{% block title %} Group Dashboard {% endblock %}
{% block body_content %}
+{% get_group_name request.path as group %}
<div>
-<font size="4px" color="#BAC1C8"> {{request.path|cut:"/"|cut:"dashboard"}} </font>
+<font size="4px" color="#BAC1C8"> {{group}} </font>
</div>
<font size="2px" color="black"> Members in this group : 0 </font>
-{% if user.is_authenticated %}
-{% endif %}
+{% get_group_policy group request.user as policy %}
+{{policy}}
+
+<div class="sidebar">
+ <div style='display:table; border:1px; border-spacing:10px; '>
+ <div style='display:table-row;' >
+ {% ifequal policy "OPEN" %}
+
+ <div style='display:table-cell;' colspan='2' align="middle">
+
+ <input type="submit" value="Join" class="btn btn-primary btn-small btn-block" align="center">
+ </div>
+ {% else %}
+
+ <div style='display:table-cell;' colspan='2' align="middle">
+ <input type="submit" value="Invite" class="btn btn-primary btn-small btn-block" align="center">
+ </div>
+ {% endifequal %}
+ </div>
+
+ </div>
+</div>
{% endblock %}
+
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/page.html b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/page.html
index 57299d14..7ff7f7ac 100644
--- a/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/page.html
+++ b/gnowsys-ndf/gnowsys_ndf/ndf/templates/ndf/page.html
@@ -21,7 +21,7 @@
<h5>Number Of Nodes : {{ page_nodes_count }} </h5>
{% endif %}
<div>
- <p><strong><a href="{% url 'edit_page' group_name node %}">{{ node.name }}</a></strong><br>
+ <p><strong><a href="{% url 'page' group_name node %}">{{ node.name }}</a></strong><br>
<!--
Created at : {{ node.created_at|date:"j F Y" }}<br>
Member Of : {{ node.member_of }}<br>
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py b/gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py
index 5340e68c..36c4ad10 100644
--- a/gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py
+++ b/gnowsys-ndf/gnowsys_ndf/ndf/templatetags/ndf_tags.py
@@ -123,3 +123,12 @@ def get_existing_groups():
group.append(items.name)
return group
+@register.assignment_tag
+def get_group_policy(group_name,user):
+ policy =""
+ col_Group = db[Group.collection_name]
+ colg=col_Group.Group.one({"name":group_name})
+ if colg:
+ policy=str(colg.sub_policy)
+ return policy
+
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/urls/__init__.py b/gnowsys-ndf/gnowsys_ndf/ndf/urls/__init__.py
index e09f3038..64ded8cb 100644
--- a/gnowsys-ndf/gnowsys_ndf/ndf/urls/__init__.py
+++ b/gnowsys-ndf/gnowsys_ndf/ndf/urls/__init__.py
@@ -11,22 +11,14 @@ admin.autodiscover()
urlpatterns = patterns('',
(r'^$', RedirectView.as_view(url= '/home/')),
-# (r'^(?P<gp_id>[\w-]+)/', include('gnowsys_ndf.ndf.urls.group')),
(r'^(?P<group_name>[\w-]+)/file/', include('gnowsys_ndf.ndf.urls.file')),
(r'^(?P<group_name>[\w-]+)/image/', include('gnowsys_ndf.ndf.urls.image')),
(r'^(?P<group_name>[\w-]+)/page/', include('gnowsys_ndf.ndf.urls.page')),
(r'^(?P<group_name>[\w-]+)/group/', include('gnowsys_ndf.ndf.urls.group')),
-
-# (r'^page/', include('gnowsys_ndf.ndf.urls.wiki')),
-
(r'^(?P<group_name>[\w-]+)/',include('gnowsys_ndf.ndf.urls.group')),
(r'^home/', 'gnowsys_ndf.ndf.views.home.homepage'),
-#
-# (r'^ndf/', include('gnowsys_ndf.ndf.urls')),
(r'^benchmarker/', include('gnowsys_ndf.benchmarker.urls')),
-
(r'^admin/', include(admin.site.urls)),
-
url(r'^accounts/password/change/done/', auth_views.password_change_done),
url(r'^accounts/password/change/', auth_views.password_change, {'password_change_form': UserChangeform}),
url(r'^accounts/password/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', auth_views.password_reset_confirm, {'set_password_form':UserResetform}),
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/urls/page.py b/gnowsys-ndf/gnowsys_ndf/ndf/urls/page.py
index 90cd0af8..8457f72d 100644
--- a/gnowsys-ndf/gnowsys_ndf/ndf/urls/page.py
+++ b/gnowsys-ndf/gnowsys_ndf/ndf/urls/page.py
@@ -8,6 +8,6 @@ from gnowsys_ndf.ndf.views import *
urlpatterns = patterns('gnowsys_ndf.ndf.views.page',
url(r'^(?P<app_id>[\w-]+)$', 'page', name='page'),
url(r'^create_page/', 'create_page', name='create_page'),
- url(r'^(?P<node_id>[\w-]+)$', 'edit_page', name='edit_page'),
+ url(r'^(?P<node_id>[\w-]+)/edit$', 'edit_page', name='edit_page'),
)
diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/views/page.py b/gnowsys-ndf/gnowsys_ndf/ndf/views/page.py
index 5c49c7ae..665b4154 100644
--- a/gnowsys-ndf/gnowsys_ndf/ndf/views/page.py
+++ b/gnowsys-ndf/gnowsys_ndf/ndf/views/page.py
@@ -40,6 +40,8 @@ def page(request, group_name,app_id):
"""
* Renders a list of all 'Page-type-GSystems' available within the database.
"""
+ page_node = gs_collection.GSystem.one({"_id": ObjectId(app_id)})
+ print app_id,"appid"
page_id=app_id
print "aa",app_id,gst_page._id
if gst_page._id == ObjectId(page_id):
@@ -51,7 +53,9 @@ def page(request, group_name,app_id):
return render_to_response("ndf/page.html", {'title': title, 'page_nodes': page_nodes, 'page_nodes_count': page_nodes_count}, context_instance=RequestContext(request))
- return HttpResponseRedirect(reverse('homepage'))
+# edit_page(request, group_name,app_id)
+ return render_to_response("ndf/edit_page.html",{'node':page_node,'node_id':app_id},context_instance=RequestContext(request))
+# return HttpResponseRedirect(reverse('edit_page',kwargs={'node_id':app_id,'group_name':group_name}))
def create_page(request,group_name):
@@ -145,7 +149,7 @@ def edit_page(request, group_name,node_id):
"""
* Displays/Modifies details about the given page.
"""
-
+ print "inside edit_page"
page_node = gs_collection.GSystem.one({"_id": ObjectId(node_id)})
if request.user.is_authenticated():
@@ -248,14 +252,14 @@ def edit_page(request, group_name,node_id):
return render_to_response("ndf/edit_page.html",
{ 'node': page_node, 'user_details': user_details,
'pn_drawer1': pn_drawer1, 'pn_drawer2': pn_drawer2, 'prior_node_obj_dict': prior_node_obj_dict,
- 'c_drawer1': c_drawer1, 'c_drawer2': c_drawer2, 'collection_obj_dict': collection_obj_dict
+ 'c_drawer1': c_drawer1, 'c_drawer2': c_drawer2, 'collection_obj_dict': collection_obj_dict,'group_name':group_name,'node_id':node_id
},
context_instance = RequestContext(request)
)
else:
return render_to_response("ndf/edit_page.html",
- { 'node': page_node
+ { 'node': page_node,'group_name':group_name,'node_id':node_id
},
context_instance = RequestContext(request)
)