Monticello+Suggestion

karl karl.ramberg at chello.se
Sun Dec 18 11:48:53 UTC 2005


karl wrote:

> Cees De Groot wrote:
>
>> On 12/16/05, nicolas cellier <ncellier at ifrance.com> wrote:
>>  
>>
>>> I suggest one can search for keywords in project descriptions rather 
>>> than just
>>> in project names.
>>>
>>>   
>>
>> Monticello is a versioning system. What you want, would be best
>> implemented in SqueakMap. Which is of course already possible (Google
>> 'foo site:map.squeak.org' ;-)) but maybe a search box on SM could help
>> a bit there.
>>
>>
>>  
>>
> I would like this feature on SqueakSource.
>
> karl
>
I added searching the project description. See attachment.
Could something like this be added to SqueakSource ? Please ? :-)

Karl

-------------- next part --------------
'From Squeak3.9alpha of 4 July 2005 [latest update: #6705] on 18 December 2005 at 12:40:30 pm'!
SSComponent subclass: #SSProjects
	uses: {}
	instanceVariableNames: 'report searchText'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'SqueakSource-View'!

!SSProjects methodsFor: 'actions' stamp: 'lr 3/15/2004 19:50'!
registerProject
	super registerProject.
	self resetModel.! !

!SSProjects methodsFor: 'actions' stamp: 'kfr 12/18/2005 12:40'!
search
	self searchText isEmptyOrNil ifTrue: [
		self searchText: '*' ].
	(self searchText includes: $*) ifFalse: [
		self searchText: '*' , self searchText , '*'].
	report rows: (self model projects select: [ :each |
		self searchText match: each title.
		self searchText match: each description]).! !


!SSProjects methodsFor: 'rendering' stamp: 'pmm 7/9/2005 09:52'!
renderContentOn: html
	html heading: 'Projects'.
	self renderSearchOn: html.
	html render: report! !

!SSProjects methodsFor: 'rendering' stamp: 'pmm 7/9/2005 09:56'!
renderSearchOn: html
	html form: [
		html textInputOn: #searchText of: self.
		html submitButtonWithAction: [ self search ] text: 'Search'  ].
	html break.! !


!SSProjects methodsFor: 'accessing' stamp: 'pmm 7/9/2005 09:57'!
searchText
	^searchText! !

!SSProjects methodsFor: 'accessing' stamp: 'pmm 7/9/2005 09:57'!
searchText: aString
	searchText := aString
! !


!SSProjects methodsFor: 'initialization' stamp: 'pmm 7/9/2005 10:03'!
setModel: aModel
	| maxActivity renderMember sort |
	super setModel: aModel.
	maxActivity _ aModel maxActivity.
	renderMember _ [ :item :html |
		item
			do: [ :each | html anchorWithAction: [ self call: each view ] text: each initials ]
			separatedBy: [ html text: ', ' ] ].
	report _ SSTableReport new
		rowPeriod: 1;
		rows: aModel projects;
		columns: {
			sort _ WAReportColumn 
				selector: #title 
				title: 'Project' 
				onClick: [ :item | self call: item view ].
			(WAReportColumn			
				selector: #admins
				title: 'Admins')
				formatBlock: renderMember;
				sortBlock: nil;
				yourself.
			(WAReportColumn
				selector: #developers
				title: 'Developers')
				formatBlock: renderMember;
				sortBlock: nil;
				yourself.
			(WAReportColumn
				selector: #guests
				title: 'Guests')
				formatBlock: renderMember;
				sortBlock: nil;
				yourself.
			(WAReportColumn
				selector: #activity
				title: 'Activity')
				formatBlock: [ :each :html |
					html attributes cellspacing: 0; cellpadding: 0; align: #center.
					html table: [
						html tableRow: [
							html attributes bgcolor: '#' , (Color activity: each / maxActivity) hex.
							html tableData: '&nbsp;&nbsp;&nbsp' ] ] ];
				yourself.
			(WAReportColumn
				selector: #numberOfTotalDownloads
				title: 'Downloads')
				yourself };
		sortColumn: sort;
		yourself.! !


More information about the Squeak-dev mailing list