OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/lib/widget/controls/query_name.rb

28 lines
924 B

class Widget::Controls::QueryName < Widget::Base
def render
options = { "data-translations" => translations }
if @query.new_record?
name = l(:label_save_this_query)
icon = ""
else
name = @query.name
icon = content_tag :a, :href => "#", :class => 'breadcrumb_icon icon-edit',
:id => "query-name-edit-button", :title => "#{l(:button_rename)}" do
l(:button_rename)
end
options["data-is_public"] = @query.is_public
14 years ago
options["data-update-url"] = url_for(:action => "update", :id => @query.id).html_safe
end
content_tag(:span, name, :id => "query_saved_name") + icon
end
def translations
{ :rename => l(:button_rename),
:cancel => l(:button_cancel),
:loading => l(:label_loading),
:clickToEdit => l(:label_click_to_edit),
:isPublic => l(:field_is_public),
:saving => l(:label_saving) }.to_json.html_safe
end
end