1 # redMine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 module ApplicationHelper
22 include Redmine::WikiFormatting::Macros::Definitions
24 include GravatarHelper::PublicMethods
27 def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
29 # Return true if user is authorized for controller/action, otherwise false
30 def authorize_for(controller, action)
31 User.current.allowed_to?({:controller => controller, :action => action}, @project)
34 # Display a link if user is authorized
35 def link_to_if_authorized(name, options = {}, html_options = nil, *parameters_for_method_reference)
36 link_to(name, options, html_options, *parameters_for_method_reference) if authorize_for(options[:controller] || params[:controller], options[:action])
39 # Display a link to remote if user is authorized
40 def link_to_remote_if_authorized(name, options = {}, html_options = nil)
41 url = options[:url] || {}
42 link_to_remote(name, options, html_options) if authorize_for(url[:controller] || params[:controller], url[:action])
45 # Displays a link to user's account page if active
46 def link_to_user(user, options={})
48 name = h(user.name(options[:format]))
50 link_to name, :controller => 'users', :action => 'show', :id => user
59 # Displays a link to +issue+ with its subject.
62 # link_to_issue(issue) # => Defect #6: This is the subject
63 # link_to_issue(issue, :truncate => 6) # => Defect #6: This i...
64 # link_to_issue(issue, :subject => false) # => Defect #6
65 # link_to_issue(issue, :project => true) # => Foo - Defect #6
67 def link_to_issue(issue, options={})
70 if options[:subject] == false
71 title = truncate(issue.subject, :length => 60)
73 subject = issue.subject
75 subject = truncate(subject, :length => options[:truncate])
78 s = link_to "#{issue.tracker} ##{issue.id}", {:controller => "issues", :action => "show", :id => issue},
79 :class => issue.css_classes,
81 s << ": #{h subject}" if subject
82 s = "#{h issue.project} - " + s if options[:project]
86 # Generates a link to an attachment.
88 # * :text - Link text (default to attachment filename)
89 # * :download - Force download (default: false)
90 def link_to_attachment(attachment, options={})
91 text = options.delete(:text) || attachment.filename
92 action = options.delete(:download) ? 'download' : 'show'
94 link_to(h(text), {:controller => 'attachments', :action => action, :id => attachment, :filename => attachment.filename }, options)
97 # Generates a link to a SCM revision
99 # * :text - Link text (default to the formatted revision)
100 def link_to_revision(revision, project, options={})
101 text = options.delete(:text) || format_revision(revision)
103 link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => revision}, :title => l(:label_revision_id, revision))
106 def toggle_link(name, id, options={})
107 onclick = "Element.toggle('#{id}'); "
108 onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
109 onclick << "return false;"
110 link_to(name, "#", :onclick => onclick)
113 def image_to_function(name, function, html_options = {})
114 html_options.symbolize_keys!
115 tag(:input, html_options.merge({
116 :type => "image", :src => image_path(name),
117 :onclick => (html_options[:onclick] ? "#{html_options[:onclick]}; " : "") + "#{function};"
121 def prompt_to_remote(name, text, param, url, html_options = {})
122 html_options[:onclick] = "promptToRemote('#{text}', '#{param}', '#{url_for(url)}'); return false;"
123 link_to name, {}, html_options
126 def format_activity_title(text)
127 h(truncate_single_line(text, :length => 100))
130 def format_activity_day(date)
131 date == Date.today ? l(:label_today).titleize : format_date(date)
134 def format_activity_description(text)
135 h(truncate(text.to_s, :length => 120).gsub(%r{[\r\n]*<(pre|code)>.*$}m, '...')).gsub(/[\r\n]+/, "<br />")
138 def format_version_name(version)
139 if version.project == @project
142 h("#{version.project} - #{version}")
146 def due_date_distance_in_words(date)
148 l((date < Date.today ? :label_roadmap_overdue : :label_roadmap_due_in), distance_of_date_in_words(Date.today, date))
152 def render_page_hierarchy(pages, node=nil)
155 content << "<ul class=\"pages-hierarchy\">\n"
156 pages[node].each do |page|
158 content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'index', :id => page.project, :page => page.title},
159 :title => (page.respond_to?(:updated_on) ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil))
160 content << "\n" + render_page_hierarchy(pages, page.id) if pages[page.id]
168 # Renders flash messages
169 def render_flash_messages
172 s << content_tag('div', v, :class => "flash #{k}")
177 # Renders tabs and their content
178 def render_tabs(tabs)
180 render :partial => 'common/tabs', :locals => {:tabs => tabs}
182 content_tag 'p', l(:label_no_data), :class => "nodata"
186 # Renders the project quick-jump box
187 def render_project_jump_box
188 # Retrieve them now to avoid a COUNT query
189 projects = User.current.projects.all
191 s = '<select onchange="if (this.value != \'\') { window.location = this.value; }">' +
192 "<option value=''>#{ l(:label_jump_to_a_project) }</option>" +
193 '<option value="" disabled="disabled">---</option>'
194 s << project_tree_options_for_select(projects, :selected => @project) do |p|
195 { :value => url_for(:controller => 'projects', :action => 'show', :id => p, :jump => current_menu_item) }
202 def project_tree_options_for_select(projects, options = {})
204 project_tree(projects) do |project, level|
205 name_prefix = (level > 0 ? (' ' * 2 * level + '» ') : '')
206 tag_options = {:value => project.id}
207 if project == options[:selected] || (options[:selected].respond_to?(:include?) && options[:selected].include?(project))
208 tag_options[:selected] = 'selected'
210 tag_options[:selected] = nil
212 tag_options.merge!(yield(project)) if block_given?
213 s << content_tag('option', name_prefix + h(project), tag_options)
218 # Yields the given block for each project with its level in the tree
219 def project_tree(projects, &block)
221 projects.sort_by(&:lft).each do |project|
222 while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
225 yield project, ancestors.size
230 def project_nested_ul(projects, &block)
234 projects.sort_by(&:lft).each do |project|
235 if (ancestors.empty? || project.is_descendant_of?(ancestors.last))
240 while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
246 s << yield(project).to_s
249 s << ("</li></ul>\n" * ancestors.size)
254 def principals_check_box_tags(name, principals)
256 principals.sort.each do |principal|
257 s << "<label>#{ check_box_tag name, principal.id, false } #{h principal}</label>\n"
262 # Truncates and returns the string as a single line
263 def truncate_single_line(string, *args)
264 truncate(string.to_s, *args).gsub(%r{[\r\n]+}m, ' ')
268 text.gsub(%r{(\d+)\.(\d+)}, '<span class="hours hours-int">\1</span><span class="hours hours-dec">.\2</span>')
271 def authoring(created, author, options={})
272 l(options[:label] || :label_added_time_by, :author => link_to_user(author), :age => time_tag(created))
276 text = distance_of_time_in_words(Time.now, time)
278 link_to(text, {:controller => 'projects', :action => 'activity', :id => @project, :from => time.to_date}, :title => format_time(time))
280 content_tag('acronym', text, :title => format_time(time))
284 def syntax_highlight(name, content)
285 Redmine::SyntaxHighlighting.highlight_by_filename(content, name)
288 def to_path_param(path)
289 path.to_s.split(%r{[/\\]}).select {|p| !p.blank?}
292 def pagination_links_full(paginator, count=nil, options={})
293 page_param = options.delete(:page_param) || :page
294 per_page_links = options.delete(:per_page_links)
295 url_param = params.dup
296 # don't reuse query params if filters are present
297 url_param.merge!(:fields => nil, :values => nil, :operators => nil) if url_param.delete(:set_filter)
300 if paginator.current.previous
301 html << link_to_remote_content_update('« ' + l(:label_previous), url_param.merge(page_param => paginator.current.previous)) + ' '
304 html << (pagination_links_each(paginator, options) do |n|
305 link_to_remote_content_update(n.to_s, url_param.merge(page_param => n))
308 if paginator.current.next
309 html << ' ' + link_to_remote_content_update((l(:label_next) + ' »'), url_param.merge(page_param => paginator.current.next))
313 html << " (#{paginator.current.first_item}-#{paginator.current.last_item}/#{count})"
314 if per_page_links != false && links = per_page_links(paginator.items_per_page)
315 html << " | #{links}"
322 def per_page_links(selected=nil)
323 url_param = params.dup
324 url_param.clear if url_param.has_key?(:set_filter)
326 links = Setting.per_page_options_array.collect do |n|
327 n == selected ? n : link_to_remote(n, {:update => "content",
328 :url => params.dup.merge(:per_page => n),
330 {:href => url_for(url_param.merge(:per_page => n))})
332 links.size > 1 ? l(:label_display_per_page, links.join(', ')) : nil
335 def reorder_links(name, url)
336 link_to(image_tag('2uparrow.png', :alt => l(:label_sort_highest)), url.merge({"#{name}[move_to]" => 'highest'}), :method => :post, :title => l(:label_sort_highest)) +
337 link_to(image_tag('1uparrow.png', :alt => l(:label_sort_higher)), url.merge({"#{name}[move_to]" => 'higher'}), :method => :post, :title => l(:label_sort_higher)) +
338 link_to(image_tag('1downarrow.png', :alt => l(:label_sort_lower)), url.merge({"#{name}[move_to]" => 'lower'}), :method => :post, :title => l(:label_sort_lower)) +
339 link_to(image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), url.merge({"#{name}[move_to]" => 'lowest'}), :method => :post, :title => l(:label_sort_lowest))
342 def breadcrumb(*args)
343 elements = args.flatten
344 elements.any? ? content_tag('p', args.join(' » ') + ' » ', :class => 'breadcrumb') : nil
347 def other_formats_links(&block)
348 concat('<p class="other-formats">' + l(:label_export_to))
349 yield Redmine::Views::OtherFormatsBuilder.new(self)
353 def page_header_title
354 if @project.nil? || @project.new_record?
358 ancestors = (@project.root? ? [] : @project.ancestors.visible)
360 root = ancestors.shift
361 b << link_to(h(root), {:controller => 'projects', :action => 'show', :id => root, :jump => current_menu_item}, :class => 'root')
362 if ancestors.size > 2
364 ancestors = ancestors[-2, 2]
366 b += ancestors.collect {|p| link_to(h(p), {:controller => 'projects', :action => 'show', :id => p, :jump => current_menu_item}, :class => 'ancestor') }
373 def html_title(*args)
376 title << @project.name if @project
377 title += @html_title if @html_title
378 title << Setting.app_title
379 title.select {|t| !t.blank? }.join(' - ')
387 Redmine::AccessKeys.key_for s
390 # Formats text according to system settings.
391 # 2 ways to call this method:
392 # * with a String: textilizable(text, options)
393 # * with an object and one of its attribute: textilizable(issue, :description, options)
394 def textilizable(*args)
395 options = args.last.is_a?(Hash) ? args.pop : {}
398 obj = options[:object]
403 text = obj.send(attr).to_s
405 raise ArgumentError, 'invalid arguments to textilizable'
407 return '' if text.blank?
408 project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
409 only_path = options.delete(:only_path) == false ? false : true
411 text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text, :object => obj, :attribute => attr) { |macro, args| exec_macro(macro, obj, args) }
413 [:parse_inline_attachments, :parse_wiki_links, :parse_redmine_links].each do |method_name|
414 send method_name, text, project, obj, attr, only_path, options
420 def parse_inline_attachments(text, project, obj, attr, only_path, options)
421 # when using an image link, try to use an attachment, if possible
422 if options[:attachments] || (obj && obj.respond_to?(:attachments))
424 text.gsub!(/src="([^\/"]+\.(bmp|gif|jpg|jpeg|png))"(\s+alt="([^"]*)")?/i) do |m|
425 filename, ext, alt, alttext = $1.downcase, $2, $3, $4
426 attachments ||= (options[:attachments] || obj.attachments).sort_by(&:created_on).reverse
427 # search for the picture in attachments
428 if found = attachments.detect { |att| att.filename.downcase == filename }
429 image_url = url_for :only_path => only_path, :controller => 'attachments', :action => 'download', :id => found
430 desc = found.description.to_s.gsub('"', '')
431 if !desc.blank? && alttext.blank?
432 alt = " title=\"#{desc}\" alt=\"#{desc}\""
434 "src=\"#{image_url}\"#{alt}"
447 # wiki links can refer other project wikis, using project name or identifier:
448 # [[project:]] -> wiki starting page
449 # [[project:|mytext]]
451 # [[project:mypage|mytext]]
452 def parse_wiki_links(text, project, obj, attr, only_path, options)
453 text.gsub!(/(!)?(\[\[([^\]\n\|]+)(\|([^\]\n\|]+))?\]\])/) do |m|
454 link_project = project
455 esc, all, page, title = $1, $2, $3, $5
457 if page =~ /^([^\:]+)\:(.*)$/
458 link_project = Project.find_by_name($1) || Project.find_by_identifier($1)
460 title ||= $1 if page.blank?
463 if link_project && link_project.wiki
466 if page =~ /^(.+?)\#(.+)$/
467 page, anchor = $1, $2
469 # check if page exists
470 wiki_page = link_project.wiki.find_page(page)
471 url = case options[:wiki_links]
472 when :local; "#{title}.html"
473 when :anchor; "##{title}" # used for single-file wiki export
475 url_for(:only_path => only_path, :controller => 'wiki', :action => 'index', :id => link_project, :page => Wiki.titleize(page), :anchor => anchor)
477 link_to((title || page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new')))
479 # project or wiki doesn't exist
492 # #52 -> Link to issue #52
494 # r52 -> Link to revision 52
495 # commit:a85130f -> Link to scmid starting with a85130f
497 # document#17 -> Link to document with id 17
498 # document:Greetings -> Link to the document with title "Greetings"
499 # document:"Some document" -> Link to the document with title "Some document"
501 # version#3 -> Link to version with id 3
502 # version:1.0.0 -> Link to version named "1.0.0"
503 # version:"1.0 beta 2" -> Link to version named "1.0 beta 2"
505 # attachment:file.zip -> Link to the attachment of the current object named file.zip
507 # source:some/file -> Link to the file located at /some/file in the project's repository
508 # source:some/file@52 -> Link to the file's revision 52
509 # source:some/file#L120 -> Link to line 120 of the file
510 # source:some/file@52#L120 -> Link to line 120 of the file's revision 52
511 # export:some/file -> Force the download of the file
513 # message#1218 -> Link to message with id 1218
514 def parse_redmine_links(text, project, obj, attr, only_path, options)
515 text.gsub!(%r{([\s\(,\-\>]|^)(!)?(attachment|document|version|commit|source|export|message|project)?((#|r)(\d+)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]]\W)|,|\s|<|$)}) do |m|
516 leading, esc, prefix, sep, identifier = $1, $2, $3, $5 || $7, $6 || $8
519 if prefix.nil? && sep == 'r'
520 if project && (changeset = project.changesets.find_by_revision(identifier))
521 link = link_to("r#{identifier}", {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.revision},
522 :class => 'changeset',
523 :title => truncate_single_line(changeset.comments, :length => 100))
526 oid = identifier.to_i
529 if issue = Issue.visible.find_by_id(oid, :include => :status)
530 link = link_to("##{oid}", {:only_path => only_path, :controller => 'issues', :action => 'show', :id => oid},
531 :class => issue.css_classes,
532 :title => "#{truncate(issue.subject, :length => 100)} (#{issue.status.name})")
535 if document = Document.find_by_id(oid, :include => [:project], :conditions => Project.visible_by(User.current))
536 link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
540 if version = Version.find_by_id(oid, :include => [:project], :conditions => Project.visible_by(User.current))
541 link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
545 if message = Message.find_by_id(oid, :include => [:parent, {:board => :project}], :conditions => Project.visible_by(User.current))
546 link = link_to h(truncate(message.subject, :length => 60)), {:only_path => only_path,
547 :controller => 'messages',
549 :board_id => message.board,
551 :anchor => (message.parent ? "message-#{message.id}" : nil)},
555 if p = Project.visible.find_by_id(oid)
556 link = link_to h(p.name), {:only_path => only_path, :controller => 'projects', :action => 'show', :id => p},
561 # removes the double quotes if any
562 name = identifier.gsub(%r{^"(.*)"$}, "\\1")
565 if project && document = project.documents.find_by_title(name)
566 link = link_to h(document.title), {:only_path => only_path, :controller => 'documents', :action => 'show', :id => document},
570 if project && version = project.versions.find_by_name(name)
571 link = link_to h(version.name), {:only_path => only_path, :controller => 'versions', :action => 'show', :id => version},
575 if project && (changeset = project.changesets.find(:first, :conditions => ["scmid LIKE ?", "#{name}%"]))
576 link = link_to h("#{name}"), {:only_path => only_path, :controller => 'repositories', :action => 'revision', :id => project, :rev => changeset.revision},
577 :class => 'changeset',
578 :title => truncate_single_line(changeset.comments, :length => 100)
580 when 'source', 'export'
581 if project && project.repository
582 name =~ %r{^[/\\]*(.*?)(@([0-9a-f]+))?(#(L\d+))?$}
583 path, rev, anchor = $1, $3, $5
584 link = link_to h("#{prefix}:#{name}"), {:controller => 'repositories', :action => 'entry', :id => project,
585 :path => to_path_param(path),
588 :format => (prefix == 'export' ? 'raw' : nil)},
589 :class => (prefix == 'export' ? 'source download' : 'source')
592 attachments = options[:attachments] || (obj && obj.respond_to?(:attachments) ? obj.attachments : nil)
593 if attachments && attachment = attachments.detect {|a| a.filename == name }
594 link = link_to h(attachment.filename), {:only_path => only_path, :controller => 'attachments', :action => 'download', :id => attachment},
595 :class => 'attachment'
598 if p = Project.visible.find(:first, :conditions => ["identifier = :s OR LOWER(name) = :s", {:s => name.downcase}])
599 link = link_to h(p.name), {:only_path => only_path, :controller => 'projects', :action => 'show', :id => p},
605 leading + (link || "#{prefix}#{sep}#{identifier}")
609 # Same as Rails' simple_format helper without using paragraphs
610 def simple_format_without_paragraph(text)
612 gsub(/\r\n?/, "\n"). # \r\n and \r -> \n
613 gsub(/\n\n+/, "<br /><br />"). # 2+ newline -> 2 br
614 gsub(/([^\n]\n)(?=[^\n])/, '\1<br />') # 1 newline -> br
617 def lang_options_for_select(blank=true)
618 (blank ? [["(auto)", ""]] : []) +
619 valid_languages.collect{|lang| [ ll(lang.to_s, :general_lang_name), lang.to_s]}.sort{|x,y| x.last <=> y.last }
622 def label_tag_for(name, option_tags = nil, options = {})
623 label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "")
624 content_tag("label", label_text)
627 def labelled_tabular_form_for(name, object, options, &proc)
628 options[:html] ||= {}
629 options[:html][:class] = 'tabular' unless options[:html].has_key?(:class)
630 form_for(name, object, options.merge({ :builder => TabularFormBuilder, :lang => current_language}), &proc)
633 def back_url_hidden_field_tag
634 back_url = params[:back_url] || request.env['HTTP_REFERER']
635 back_url = CGI.unescape(back_url.to_s)
636 hidden_field_tag('back_url', CGI.escape(back_url)) unless back_url.blank?
639 def check_all_links(form_name)
640 link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") +
642 link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
645 def progress_bar(pcts, options={})
646 pcts = [pcts, pcts] unless pcts.is_a?(Array)
647 pcts = pcts.collect(&:round)
648 pcts[1] = pcts[1] - pcts[0]
649 pcts << (100 - pcts[1] - pcts[0])
650 width = options[:width] || '100px;'
651 legend = options[:legend] || ''
654 (pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : '') +
655 (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : '') +
656 (pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : '')
657 ), :class => 'progress', :style => "width: #{width};") +
658 content_tag('p', legend, :class => 'pourcent')
661 def context_menu(url)
662 unless @context_menu_included
663 content_for :header_tags do
664 javascript_include_tag('context_menu') +
665 stylesheet_link_tag('context_menu')
667 @context_menu_included = true
669 javascript_tag "new ContextMenu('#{ url_for(url) }')"
672 def context_menu_link(name, url, options={})
673 options[:class] ||= ''
674 if options.delete(:selected)
675 options[:class] << ' icon-checked disabled'
676 options[:disabled] = true
678 if options.delete(:disabled)
679 options.delete(:method)
680 options.delete(:confirm)
681 options.delete(:onclick)
682 options[:class] << ' disabled'
685 link_to name, url, options
688 def calendar_for(field_id)
689 include_calendar_headers_tags
690 image_tag("calendar.png", {:id => "#{field_id}_trigger",:class => "calendar-trigger"}) +
691 javascript_tag("Calendar.setup({inputField : '#{field_id}', ifFormat : '%Y-%m-%d', button : '#{field_id}_trigger' });")
694 def include_calendar_headers_tags
695 unless @calendar_headers_tags_included
696 @calendar_headers_tags_included = true
697 content_for :header_tags do
698 start_of_week = case Setting.start_of_week.to_i
700 'Calendar._FD = 1;' # Monday
702 'Calendar._FD = 0;' # Sunday
707 javascript_include_tag('calendar/calendar') +
708 javascript_include_tag("calendar/lang/calendar-#{current_language.to_s.downcase}.js") +
709 javascript_tag(start_of_week) +
710 javascript_include_tag('calendar/calendar-setup') +
711 stylesheet_link_tag('calendar')
716 def content_for(name, content = nil, &block)
718 @has_content[name] = true
719 super(name, content, &block)
722 def has_content?(name)
723 (@has_content && @has_content[name]) || false
726 # Returns the avatar image tag for the given +user+ if avatars are enabled
727 # +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
728 def avatar(user, options = { })
729 if Setting.gravatar_enabled?
730 options.merge!({:ssl => Setting.protocol == 'https', :default => Setting.gravatar_default})
732 if user.respond_to?(:mail)
734 elsif user.to_s =~ %r{<(.+?)>}
737 return gravatar(email.to_s.downcase, options) unless email.blank? rescue nil
744 helper = Redmine::WikiFormatting.helper_for(Setting.text_formatting)
749 def link_to_remote_content_update(text, url_params)
751 {:url => url_params, :method => :get, :update => 'content', :complete => 'window.scrollTo(0,0)'},
752 {:href => url_for(:params => url_params)}