Switch to unified view

a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
...
...
210
        These fields & values will be stored by solr.  Subclasses should call the
210
        These fields & values will be stored by solr.  Subclasses should call the
211
        super() index() and then extend it with more fields.
211
        super() index() and then extend it with more fields.
212
212
213
        The _s and _t suffixes, for example, follow solr dynamic field naming
213
        The _s and _t suffixes, for example, follow solr dynamic field naming
214
        pattern.
214
        pattern.
215
        You probably want to override at least title, title_s and text to have
215
        You probably want to override at least title and text to have
216
        meaningful search results and email senders.
216
        meaningful search results and email senders.
217
        """
217
        """
218
218
219
        project = self.project
219
        project = self.project
220
        return dict(
220
        return dict(
221
            id=self.index_id(),
221
            id=self.index_id(),
222
            mod_date_dt=self.mod_date,
222
            mod_date_dt=self.mod_date,
223
            title_s='Artifact %s' % self._id,
224
            title='Artifact %s' % self._id,
223
            title='Artifact %s' % self._id,
225
            project_id_s=str(project._id),
224
            project_id_s=str(project._id),
226
            project_name_t=project.name,
225
            project_name_t=project.name,
227
            project_shortname_t=project.shortname,
226
            project_shortname_t=project.shortname,
228
            tool_name_s=self.app_config.tool_name,
227
            tool_name_s=self.app_config.tool_name,
...
...
266
        if t is None:
265
        if t is None:
267
            idx = self.index()
266
            idx = self.index()
268
            t = Thread.new(
267
            t = Thread.new(
269
                discussion_id=self.app_config.discussion_id,
268
                discussion_id=self.app_config.discussion_id,
270
                ref_id=idx['id'],
269
                ref_id=idx['id'],
271
                subject='%s discussion' % idx['title_s'])
270
                subject='%s discussion' % h.get_first(idx, 'title'))
272
        parent_id = None
271
        parent_id = None
273
        if data:
272
        if data:
274
            in_reply_to = data.get('in_reply_to', [])
273
            in_reply_to = data.get('in_reply_to', [])
275
            if in_reply_to:
274
            if in_reply_to:
276
                parent_id = in_reply_to[0]
275
                parent_id = in_reply_to[0]
...
...
314
        result = Artifact.index(self)
313
        result = Artifact.index(self)
315
        original = self.original()
314
        original = self.original()
316
        if original:
315
        if original:
317
            original_index = original.index()
316
            original_index = original.index()
318
            result.update(original_index)
317
            result.update(original_index)
319
            result['title_s'] = 'Version %d of %s' % (
318
            result['title'] = 'Version %d of %s' % (
320
                    self.version, original_index['title_s'])
319
                    self.version, h.get_first(original_index, 'title'))
321
        result.update(
320
        result.update(
322
            id=self.index_id(),
321
            id=self.index_id(),
323
            version_i=self.version,
322
            version_i=self.version,
324
            author_username_t=self.author.username,
323
            author_username_t=self.author.username,
325
            author_display_name_t=self.author.display_name,
324
            author_display_name_t=self.author.display_name,
...
...
638
        if author is None:
637
        if author is None:
639
            author = c.user
638
            author = c.user
640
        if author_name is None:
639
        if author_name is None:
641
            author_name = author.get_pref('display_name')
640
            author_name = author.get_pref('display_name')
642
        if title is None:
641
        if title is None:
643
            title='%s modified by %s' % (idx['title_s'], author_name)
642
            title='%s modified by %s' % (h.get_first(idx, 'title'), author_name)
644
        if description is None: description = title
643
        if description is None: description = title
645
        if pubdate is None:
644
        if pubdate is None:
646
            pubdate = datetime.utcnow()
645
            pubdate = datetime.utcnow()
647
646
648
        if link is None:
647
        if link is None: