Quantcast

Tracker customization help

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Tracker customization help

Richard Feltstykket
Hi list,

My goal is to have the ability to specify different classes of messages
which have different actions.  For example, I would like to support a
msg list which would not be emailed to the nosy list (or at least, not
everyone on the list, which I would like to fix later)

To start I have added this to schema.py:

comment = FileClass(db, "comment",
                author=Link("user", do_journal='no'),
                recipients=Multilink("user", do_journal='no'),
                date=Date(),
                summary=String(),
                files=Multilink("file"),
                messageid=String(),
                inreplyto=String())

and added this to the IssueClass:
issue = IssueClass(db, "issue",
                assignedto=Link("user"),
                keyword=Multilink("keyword"),
                priority=Link("priority"),
                status=Link("status"),
                comments=Multilink("comment"))

then, to issue.item.html I have added an additional table:
<table class="messages" tal:condition="context/comments">
 <tr><th colspan="4" class="header" i18n:translate="">Comments</th></tr>
 <tal:block tal:repeat="comment context/comments/reverse">
  <tr>
   <th><a tal:attributes="href string:comments${comment/id}"
    i18n:translate="">comment<tal:x replace="comment/id" i18n:name="id"
/> (view)</a></th>
   <th i18n:translate="">Author: <tal:x replace="comment/author"
       i18n:name="author" /></th>
   <th i18n:translate="">Date: <tal:x replace="comment/date"
       i18n:name="date" /></th>
   <th>
    <form style="padding:0" method="POST"
tal:condition="context/is_edit_ok"
          tal:attributes="action string:issue${context/id}">
     <input type="hidden" name="@remove@comments" tal:attributes="value
comment/id">
     <input type="hidden" name="@action" value="edit">
     <input type="submit" value="remove" i18n:attributes="value">
    </form>
   </th>
  </tr>
  <tr>
   <td colspan="4" class="content">
    <pre tal:content="structure
comment/content/hyperlinked">content</pre>
   </td>
  </tr>
 </tal:block>
</table>

However, I am unclear on how to now put a new comment in this structure,
I was looking at Change Note:

<tr tal:condition="context/is_edit_ok">
 <th i18n:translate="">Change Note</th>
 <td colspan=3>
  <textarea tal:content="request/form/@note/value | default"
            name="@note" wrap="hard" rows="5" cols="80"></textarea>
 </td>
</tr>

Which doesn't seem to touch msg at all.  What's the best way to add
content to this new class from the web interface?

I was also considering modifying the message class itself and adding a
type to it, and then checking the type in the nosy email detector?
Perhaps this is a better strategy?  If so, how to do that from the
current change note form?

Thanks for the help!
Richard

------------------------------------------------------------------------------

_______________________________________________
Roundup-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/roundup-users

signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tracker customization help

Ralf Schlatterbeck-3
On Thu, Sep 01, 2016 at 10:18:38AM -0700, Richard Feltstykket wrote:

> However, I am unclear on how to now put a new comment in this structure,
> I was looking at Change Note:
>
> <tr tal:condition="context/is_edit_ok">
>  <th i18n:translate="">Change Note</th>
>  <td colspan=3>
>   <textarea tal:content="request/form/@note/value | default"
>             name="@note" wrap="hard" rows="5" cols="80"></textarea>
>  </td>
> </tr>
[...]
> Which doesn't seem to touch msg at all.  What's the best way to add
> content to this new class from the web interface?

@note is special in that it implicitly uses 'messages' and the 'msg'
class.

See the customization docs at
http://roundup.sourceforge.net/docs/customizing.html#web-interface
and search for @note.

You may want to try:
comment-1@content=value
And in a hidden input field:
@link@comment=comment-1

This explicitly uses your new class names.
In addition the docs say:
"If both the “@note” and “@file” form variables are specified, the
action:
@link@msg-1@files=file-1
is also performed."

This would translate to
@link@comment-1@files=file-1
for your schema. Which should also be put into a hidden input field.
Note that all the @link stuff is only performed if the new item
(e.g. msg-1 or file-1) is non-empty.

> I was also considering modifying the message class itself and adding a
> type to it, and then checking the type in the nosy email detector?
> Perhaps this is a better strategy?  If so, how to do that from the
> current change note form?

This depends on if you need both, the msg class *and* the new comment
class. If you don't need msg (and the default nosy behaviour that goes
with it) you're probably better off modifying the nosy auditor/reactors
to do what you need.

Ralf
--
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: [hidden email]

------------------------------------------------------------------------------
_______________________________________________
Roundup-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/roundup-users
Loading...