# HG changeset patch # User Lennard de Rijk # Date 1247133155 -7200 # Node ID cd3b42f52b215d3fdbbedc24b063da3576b8e999 # Parent 0d4ffe73a01947b9444a1c8c09a61957017a4f94 Added skeleton view and templates for GradingSurveyGroup. diff -r 0d4ffe73a019 -r cd3b42f52b21 app/soc/templates/soc/grading_survey_group/list/heading.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/grading_survey_group/list/heading.html Thu Jul 09 11:52:35 2009 +0200 @@ -0,0 +1,5 @@ + + Name + Last update started + Last update completed + diff -r 0d4ffe73a019 -r cd3b42f52b21 app/soc/templates/soc/grading_survey_group/list/row.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/grading_survey_group/list/row.html Thu Jul 09 11:52:35 2009 +0200 @@ -0,0 +1,9 @@ + +
{{ list.item.name }} +
+ +
{{ list.item.last_update_started|date:"jS F Y H:i" }}
+
{{ list.item.last_update_complete|date:"jS F Y H:i" }}
+ diff -r 0d4ffe73a019 -r cd3b42f52b21 app/soc/templates/soc/grading_survey_group/public.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/templates/soc/grading_survey_group/public.html Thu Jul 09 11:52:35 2009 +0200 @@ -0,0 +1,25 @@ +{% extends "soc/base.html" %} +{% comment %} +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +{% endcomment %} +{% load forms_helpers %} + +{% block body %} +

+ + {% readonly_field_as_table_row entity.fields.title.label entity.title %} + {% readonly_field_as_table_row entity.fields.last_update_started.label entity.last_update_started %} + {% readonly_field_as_table_row entity.fields.last_update_complete.label entity.last_update_complete %} +
+

+{% endblock %} diff -r 0d4ffe73a019 -r cd3b42f52b21 app/soc/views/models/grading_survey_group.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/views/models/grading_survey_group.py Thu Jul 09 11:52:35 2009 +0200 @@ -0,0 +1,73 @@ +#!/usr/bin/python2.5 +# +# Copyright 2009 the Melange authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Views for GradingSurveyGroup. +""" + +__authors__ = [ + '"Lennard de Rijk" ', + ] + + +from soc.logic import dicts +from soc.views.helper import access +from soc.views.models import base + +import soc.logic.models.grading_survey_group + + +class View(base.View): + """View methods for the GradingSurveyGroup model. + """ + + def __init__(self, params=None): + """Defines the fields and methods required for the base View class + to provide the user with list, public, create, edit and delete views. + + Params: + params: a dict with params for this View + """ + + rights = access.Checker(params) + rights['create'] = ['checkIsDeveloper'] + rights['edit'] = ['checkIsDeveloper'] + rights['delete'] = ['checkIsDeveloper'] + rights['show'] = ['checkIsDeveloper'] + rights['list'] = ['checkIsDeveloper'] + + new_params = {} + new_params['logic'] = soc.logic.models.grading_survey_group.logic + new_params['rights'] = rights + new_params['name'] = "Grading Survey Group" + + new_params['no_admin'] = True + new_params['no_create_raw'] = True + new_params['no_create_with_key_fields'] = True + + patterns = [] + + params = dicts.merge(params, new_params) + + super(View, self).__init__(params=params) + + +view = View() + +create = decorators.view(view.create) +delete = decorators.view(view.delete) +edit = decorators.view(view.edit) +list = decorators.view(view.list) +public = decorators.view(view.public)