Revision: 2257c82ae1e2
Author: Emanuel Sartor <ema...@menttes.com>
Date: Sat Mar 17 13:15:22 2012
Log: Fixed default values for some fields in the task and project
models.
http://code.google.com/p/merlot/source/detail?r=2257c82ae1e2
Revision: b3a253baff54
Author: Emanuel Sartor <ema...@menttes.com>
Date: Sat Mar 17 13:16:51 2012
Log: Styling tweaks for the JS date range widget.
http://code.google.com/p/merlot/source/detail?r=b3a253baff54
==============================================================================
Revision: 2257c82ae1e2
Author: Emanuel Sartor <ema...@menttes.com>
Date: Sat Mar 17 13:15:22 2012
Log: Fixed default values for some fields in the task and project
models.
http://code.google.com/p/merlot/source/detail?r=2257c82ae1e2
Modified:
/merlot/doctests/functional_simpleproject.rst
/merlot/interfaces.py
=======================================
--- /merlot/doctests/functional_simpleproject.rst Wed Mar 23 23:51:59 2011
+++ /merlot/doctests/functional_simpleproject.rst Sat Mar 17 13:15:22 2012
@@ -62,6 +62,11 @@
>>> 'Required input is missing' in browser.contents
True
+The project status defaults to In progress::
+
+ >>> browser.getControl(name='form.status').value
+ ['In progress']
+
Also, the start date is automatically set to today::
>>> from datetime import datetime, timedelta
@@ -99,12 +104,21 @@
>>> 'Project view: Develop a web app' in browser.contents
True
-Projects can contain tasks, so let's create a task. Once again, lets if we
set
-an end date prior to the start date, we get a validation error::
+Projects can contain tasks, so let's create a task, but first let's verify
that
+the `priority` field defaults to `Normal`, that the `status` field
defaults to
+`In progress` and that `start_date` default to the current date::
>>> browser.getLink('Add new Task').click()
+ >>> browser.getControl(name='form.priority').value
+ ['Normal']
+ >>> browser.getControl(name='form.status').value
+ ['In progress']
>>> browser.getControl(name='form.start_date').value == today
True
+
+No we will fill some fields and submit the form. Once again, if we set an
end
+date prior to the start date, we get a validation error::
+
>>> browser.getControl(name="form.title").value = u'Define
requirements'
>>> browser.getControl(name='form.end_date').value = yesterday
>>> browser.getControl("Add task").click()
=======================================
--- /merlot/interfaces.py Wed Mar 23 23:51:59 2011
+++ /merlot/interfaces.py Sat Mar 17 13:15:22 2012
@@ -156,12 +156,17 @@
"""A simple project"""
title = schema.TextLine(title=_(u'Title'), required=True)
description = schema.Text(title=_(u'Description'), required=False)
+ client = RelationChoice(
+ title=_(u'Client'),
+ source=ClientSource(),
+ required=True
+ )
status = schema.Choice(
title=_(u'Status'),
- required=False,
+ required=True,
description=_(u'The status the project is in'),
vocabulary='merlot.ProjectStatusVocabulary',
- default=u'in progress',
+ default=u'In progress',
)
# chronic = schema.Bool(title=u'Chronic', required=True)
start_date = schema.Date(
@@ -169,9 +174,6 @@
required=True,
)
end_date = schema.Date(title=_(u'End date'), required=False)
- client = RelationChoice(title=_(u'Client'),
- source=ClientSource(),
- required=True)
@invariant
def startBeforeEnd(project):
@@ -197,16 +199,16 @@
description = schema.Text(title=_(u'Description'), required=False)
priority = schema.Choice(
title=_(u'Priority'),
- required=False,
+ required=True,
vocabulary='merlot.TaskPriorityVocabulary',
- default=u'normal',
+ default=u'Normal',
)
status = schema.Choice(
title=_(u'Status'),
- required=False,
+ required=True,
description=_(u'The status the task is in'),
vocabulary='merlot.ProjectStatusVocabulary',
- default=u'in progress',
+ default=u'In progress',
)
start_date = schema.Date(
title=_(u'Start date'),
@@ -315,6 +317,7 @@
"""The logs report form"""
project_or_client = schema.Choice(
title=_(u'Project'),
+ description=_('Select a project'),
required=True,
vocabulary='merlot.ProjectVocabulary',
default=u'All projects',
@@ -329,6 +332,7 @@
)
user = schema.Choice(
title=_(u'User'),
+ description=_('Select a user'),
required=True,
vocabulary='merlot.UserVocabulary',
default='All users',
@@ -339,6 +343,7 @@
"""The tasks report form"""
projects = schema.Choice(
title=_(u'Project'),
+ description=_('Select a project'),
required=True,
vocabulary='merlot.ProjectVocabulary',
default=u'All projects',
@@ -353,6 +358,7 @@
)
user = schema.Choice(
title=_(u'User'),
+ description=_('Select a user'),
required=True,
vocabulary='merlot.UserVocabulary',
default='All users',
==============================================================================
Revision: b3a253baff54
Author: Emanuel Sartor <ema...@menttes.com>
Date: Sat Mar 17 13:16:51 2012
Log: Styling tweaks for the JS date range widget.
http://code.google.com/p/merlot/source/detail?r=b3a253baff54
Modified:
/merlot/app_templates/head.pt
/merlot/static/merlot.js
/merlot/static/style.css
=======================================
--- /merlot/app_templates/head.pt Wed Mar 23 23:51:59 2011
+++ /merlot/app_templates/head.pt Sat Mar 17 13:16:51 2012
@@ -1,6 +1,6 @@
<meta tal:attributes="http-equiv string:Content-Type; content
string:text/html;;charset=utf-8" />
<title tal:content="context/title|nothing">Merlot</title>
-<link rel="stylesheet" type="text/css" href="" tal:attributes="href
static/style.css" />
<link rel="stylesheet" type="text/css" href="" tal:attributes="href
static/jquery-ui/css/ui-lightness/jquery-ui-1.8.7.custom.css" />
<link rel="stylesheet" tal:attributes="href
static/datepicker/css/ui.daterangepicker.css" type="text/css" />
+<link rel="stylesheet" type="text/css" href="" tal:attributes="href
static/style.css" />
<link rel="shortcut icon" tal:attributes="href static/images/favicon.ico"/>
=======================================
--- /merlot/static/merlot.js Sun Apr 3 16:23:56 2011
+++ /merlot/static/merlot.js Sat Mar 17 13:16:51 2012
@@ -7,7 +7,7 @@
function dateTranslatorSetup(input) {
- input.before('<span
class="date-translated">'+merlot.i18n.TYPE_DATE_BELOW_I18N+'</span>');
+ input.before('<div class="hint
date-translated">'+merlot.i18n.TYPE_DATE_BELOW_I18N+'</div>');
};
$("#form\\.date").datepicker({"dateFormat": dateFormat});
@@ -240,7 +240,7 @@
}
function dateTranslator(date_input, date_translated) {
// code from http://www.datejs.com/ demos
- var messages = "no match";
+ var messages = "No match";
var input = date_input, date_string = date_translated, date = null;
var input_empty = (date_input.val() === '') ? '' : date_input.val(),
empty_string = merlot.i18n.TYPE_DATE_BELOW_I18N;
input.val(input_empty);
@@ -248,6 +248,7 @@
input.keyup(
function (e) {
date_string.removeClass();
+ date_string.addClass('hint');
date_string.addClass('date-translated');
if (input.val().length > 0) {
date = Date.parse(input.val());
=======================================
--- /merlot/static/style.css Wed Mar 23 23:51:59 2011
+++ /merlot/static/style.css Sat Mar 17 13:16:51 2012
@@ -496,6 +496,19 @@
.messages .ui-icon {
background-image:url(jquery-ui/css/ui-lightness/images/ui-icons_228ef1_256x240.png);
}
+
+/* Report forms tweaks */
+#tasks-report-form #form\.project_or_client,
+#tasks-report-form #form\.user,
+#logs-report-form #form\.project_or_client,
+#logs-report-form #form\.user {
+ margin-top:2px;
+}
+
+#logs-report-form #form\.actions\.submit,
+#tasks-report-form #form\.actions\.submit {
+ margin-top:35px;
+}
/*TABLES STYLE*/
.data-table {
@@ -566,6 +579,10 @@
font-size:12px;
}
+.ui-daterangepicker li.preset_0 {
+ margin-top: 0.5em !important;
+}
+
/*LAYOUT HELPERS*/
.row {
@@ -614,16 +631,16 @@
#dashboard .field-container .error,
.log-row .field-container .error,
.widget .date-translated.error{
- background:url("images/problem.png") no-repeat scroll 0 4px
transparent;
+ background:url("images/problem.png") no-repeat scroll 0 0 transparent;
+ padding-left: 18px;
}
#dashboard .field-container .accept,
.log-row .field-container .accept,
.widget .date-translated.accept{
- background:url("images/accept.png") no-repeat scroll 0 4px transparent;
-}
-.date-translated {
- padding-left:18px;
-}
+ background:url("images/accept.png") no-repeat scroll 0 0 transparent;
+ padding-left: 18px;
+}
+
/*ajax log box*/
.log-row {
display:none;
@@ -727,3 +744,4 @@
.tipsy-east { background-position: right center; }
.tipsy-west { background-position: left center; }
+