<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/CatalystX/Comments.pm</filename>
    </added>
    <added>
      <filename>lib/CatalystX/Comments/BaseForm.pm</filename>
    </added>
    <added>
      <filename>sql/ravlog_initial_data.sql</filename>
    </added>
    <added>
      <filename>t/comments.t</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,11 +2,7 @@ package CatalystX::Comments::Form;
 
 use HTML::FormHandler::Moose;
 
-extends 'HTML::FormHandler::Model::DBIC';
-with 'HTML::FormHandler::Render::Simple';
-#with 'HTML::FormHandler::Role::Captcha';
-
-has '+item_class' =&gt; ( default =&gt; 'Comment' );
+extends 'CatalystX::Comments::BaseForm';
 
 has_field 'name' =&gt; (
       required =&gt; 1,
@@ -22,18 +18,5 @@ has_field 'url' =&gt; (
      label =&gt; 'Website', 
      size =&gt; 25 );
 
-has_field 'comment' =&gt; (
-      type     =&gt; 'TextArea',
-      required =&gt; 1,
-      label    =&gt; 'Body',
-      cols     =&gt; 30,
-      rows     =&gt; 10
-);
-
-has_field 'submit' =&gt; ( 
-      type =&gt; 'Submit',
-      value =&gt; 'Save' 
-);
-
 no HTML::FormHandler::Moose;
 1;</diff>
      <filename>lib/CatalystX/Comments/Form.pm</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@ package RavLog::Controller::View;
 use Moose;
 BEGIN {
    extends 'Catalyst::Controller';
-   with 'CatalystX::Comments::ControllerFormRole';
+   with 'CatalystX::Comments';
 }
 
 has 'comment' =&gt; ( is =&gt; 'rw' );</diff>
      <filename>lib/RavLog/Controller/View.pm</filename>
    </modified>
    <modified>
      <diff>@@ -36,7 +36,7 @@ __PACKAGE__-&gt;add_columns(
       is_nullable   =&gt; 1,
       size          =&gt; 255,
    },
-   &quot;comment&quot;,
+   &quot;body&quot;,
    {
       data_type     =&gt; &quot;text&quot;,
       default_value =&gt; undef,
@@ -57,8 +57,8 @@ __PACKAGE__-&gt;add_columns(
       is_nullable   =&gt; 1,
       size          =&gt; undef,
    },
-   &quot;article_id&quot;,
-   { data_type =&gt; &quot;integer&quot;, default_value =&gt; undef, is_nullable =&gt; 1, size =&gt; 4 },
+   article_id =&gt; { data_type =&gt; &quot;integer&quot;, default_value =&gt; undef, is_nullable =&gt; 1, size =&gt; 4 },
+   user_id =&gt; { data_type =&gt; &quot;integer&quot;, default_value =&gt; undef, is_nullable =&gt; 1, size =&gt; 4 },
 );
 
 use Text::Textile qw(textile);
@@ -84,6 +84,7 @@ sub insert
 __PACKAGE__-&gt;set_primary_key(&quot;comment_id&quot;);
 
 __PACKAGE__-&gt;belongs_to( 'article', 'RavLog::Schema::DB::Article', 'article_id' );
+__PACKAGE__-&gt;belongs_to( 'user', 'RavLog::Schema::DB::User', 'user_id' );
 
 1;
 </diff>
      <filename>lib/RavLog/Schema/DB/Comment.pm</filename>
    </modified>
    <modified>
      <diff>@@ -40,12 +40,17 @@
 	&lt;li class=&quot;alt&quot;&gt;
 	[% IF loop.index % 2 %]
    	&lt;div class=&quot;comment&quot;&gt;
-   [% ELSE %]
+    [% ELSE %]
 	&lt;div class=&quot;comment_alt&quot;&gt;
-      [% END %]
-	&lt;h3&gt;&lt;a title=&quot;[% comment.url %]&quot; href=&quot;[% comment.url %]&quot;&gt;[% comment.name %]&lt;/a&gt;&lt;/h3&gt;
+    [% END %]
+    [% IF comment.user %] 
+    [% SET url = comment.user.website; SET name = comment.user.username; %]
+    [% ELSE %]
+    [% SET url = comment.url; SET name = comment.name; %]
+    [% END %]
+	&lt;h3&gt;&lt;a title=&quot;[% url %]&quot; href=&quot;[% url %]&quot;&gt;[% name %]&lt;/a&gt;&lt;/h3&gt;
 	&lt;small class=&quot;commentmetadata&quot;&gt;Posted [% c.render_ravlog_date(comment.created_at) %]&lt;/small&gt;
-	&lt;p&gt;[% comment.textilize('comment') %]&lt;/p&gt;
+	&lt;p&gt;[% comment.textilize('body') %]&lt;/p&gt;
 	&lt;/div&gt;
 	&lt;/li&gt;
 [% END %]</diff>
      <filename>root/templates/default/index.tt</filename>
    </modified>
    <modified>
      <diff>@@ -31,10 +31,11 @@ CREATE TABLE `comments` (
   `name` character varying(255),
   `email` character varying(255),
   `url` character varying(255),
-  `comment` text,
+  `body` text,
   `created_at` timestamp DEFAULT now(),
   `remote_ip` character varying(32),
   `article_id` integer(4),
+  `user_id` integer(4),
   INDEX comments_idx_article_id (`article_id`),
   PRIMARY KEY (`comment_id`),
   CONSTRAINT `comments_fk_article_id` FOREIGN KEY (`article_id`) REFERENCES `articles` (`article_id`) ON DELETE CASCADE ON UPDATE CASCADE</diff>
      <filename>sql/ravlog_mysql.sql</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/CatalystX/Comments/ControllerFormRole.pm</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>2c88dd45416b4ad15a7ec6ca7309d72aa6181279</id>
    </parent>
  </parents>
  <author>
    <name>Zbigniew Lukasiak</name>
    <email>zby@zby.aster.net.pl</email>
  </author>
  <url>http://github.com/gshank/ravlog/commit/8b7ec1493324212cde91927c15fc54cd2c9db25d</url>
  <id>8b7ec1493324212cde91927c15fc54cd2c9db25d</id>
  <committed-date>2009-06-21T11:23:48-07:00</committed-date>
  <authored-date>2009-06-21T11:23:48-07:00</authored-date>
  <message>different comment form for logged in users</message>
  <tree>9eec2e8e685b4bcf86cb1e7fedcb74bc13473b2a</tree>
  <committer>
    <name>Zbigniew Lukasiak</name>
    <email>zby@zby.aster.net.pl</email>
  </committer>
</commit>
