# HG changeset patch # User Marcin Kuzminski # Date 1337205772 -7200 # Node ID 9265958e33bbb24b0afce5b35ed0740c79bae42e # Parent 393c53cbd0d841616f719c6e39eaf66e3483f0fd Show changes of status inside comments - comments that change status are now associated with status object, and showed in comments blocks diff -r 393c53cbd0d8 -r 9265958e33bb rhodecode/controllers/changeset.py --- a/rhodecode/controllers/changeset.py Wed May 16 23:17:13 2012 +0200 +++ b/rhodecode/controllers/changeset.py Thu May 17 00:02:52 2012 +0200 @@ -381,10 +381,11 @@ status = request.POST.get('changeset_status') if status and request.POST.get('change_changeset_status'): ChangesetStatusModel().set_status( - c.rhodecode_db_repo.repo_id, + c.rhodecode_db_repo.repo_id, revision, status, c.rhodecode_user.user_id, + comm, ) Session.commit() diff -r 393c53cbd0d8 -r 9265958e33bb rhodecode/model/changeset_status.py --- a/rhodecode/model/changeset_status.py Wed May 16 23:17:13 2012 +0200 +++ b/rhodecode/model/changeset_status.py Thu May 17 00:02:52 2012 +0200 @@ -65,7 +65,7 @@ st = status or ChangesetStatus.DEFAULT return str(st) - def set_status(self, repo, revision, status, user): + def set_status(self, repo, revision, status, user, comment): """ Creates new status for changeset or updates the old one @@ -77,6 +77,8 @@ :type status: :param user: :type user: + :param comment: + :type comment: """ repo = self.__get_repo(repo) @@ -89,6 +91,7 @@ new_status.repo = self.__get_repo(repo) new_status.status = status new_status.revision = revision + new_status.comment = comment self.sa.add(new_status) return new_status diff -r 393c53cbd0d8 -r 9265958e33bb rhodecode/model/db.py --- a/rhodecode/model/db.py Wed May 16 23:17:13 2012 +0200 +++ b/rhodecode/model/db.py Thu May 17 00:02:52 2012 +0200 @@ -1211,6 +1211,7 @@ author = relationship('User', lazy='joined') repo = relationship('Repository') + status_change = relationship('ChangesetStatus', uselist=False) @classmethod def get_users(cls, revision): @@ -1247,10 +1248,12 @@ user_id = Column("user_id", Integer(), ForeignKey('users.user_id'), nullable=False, unique=None) revision = Column('revision', String(40), nullable=False) status = Column('status', String(128), nullable=False, default=DEFAULT) + changeset_comment_id = Column('changeset_comment_id', Integer(), ForeignKey('changeset_comments.comment_id')) modified_at = Column('modified_at', DateTime(), nullable=False, default=datetime.datetime.now) author = relationship('User', lazy='joined') repo = relationship('Repository') + comment = relationship('ChangesetComment', lazy='joined') @property def status_lbl(self): diff -r 393c53cbd0d8 -r 9265958e33bb rhodecode/public/css/style.css --- a/rhodecode/public/css/style.css Wed May 16 23:17:13 2012 +0200 +++ b/rhodecode/public/css/style.css Thu May 17 00:02:52 2012 +0200 @@ -2447,7 +2447,7 @@ font-weight: bold !important; } -.right .changeset-status-container{ +.changeset-status-container{ padding-right: 5px; margin-top:1px; float:right; @@ -2457,16 +2457,16 @@ float:left; padding:2px 0px 0px 2px; } -.right .changeset-status-container .changeset-status-lbl{ +.changeset-status-container .changeset-status-lbl{ color: rgb(136, 136, 136); float: left; - padding: 0px 4px 0px 0px; + padding: 3px 4px 0px 0px } .code-header .changeset-status-container .changeset-status-lbl{ float: left; padding: 0px 4px 0px 0px; } -.right .changeset-status-container .changeset-status-ico{ +.changeset-status-container .changeset-status-ico{ float: left; } .code-header .changeset-status-container .changeset-status-ico, .container .changeset-status-ico{ @@ -3916,6 +3916,7 @@ background: #f8f8f8; padding: 4px; border-bottom: 1px solid #ddd; + height: 18px; } .comments .comment .meta img { @@ -3924,9 +3925,13 @@ .comments .comment .meta .user { font-weight: bold; + float: left; + padding: 4px 2px 2px 2px; } .comments .comment .meta .date { + float: left; + padding:4px 4px 0px 4px; } .comments .comment .text { diff -r 393c53cbd0d8 -r 9265958e33bb rhodecode/templates/changeset/changeset_file_comment.html --- a/rhodecode/templates/changeset/changeset_file_comment.html Wed May 16 23:17:13 2012 +0200 +++ b/rhodecode/templates/changeset/changeset_file_comment.html Thu May 17 00:02:52 2012 +0200 @@ -7,17 +7,24 @@
- - +
+
${co.author.username} - - +
+
${h.age(co.modified_at)} - +
+ %if co.status_change: +
+
+
${co.status_change.status_lbl}
+
+
+ %endif %if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id: - +
${_('Delete')} - +
%endif