_organization.rhtml
2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<h2><%= _('General information') %></h2>
<%= required_fields_message %>
<%= required f.text_field(:name) %>
<% if @environment.enabled?('enable_organization_url_change') %>
<script type="text/javascript">
function updateUrlField(name_field, id) {
url_field = $(id);
url_field.value = convToValidIdentifier(name_field.value, "-");
warn_value_change(url_field);
}
</script>
<% end %>
<% if @environment.enabled?('enable_organization_url_change') %>
<script type="text/javascript">
function submit_button() {
return $("profile-data").select("input.submit")[0];
}
function warn_value_change() {
show_warning('profile-identifier-formitem', "identifier-change-confirmation");
disable_button(submit_button());
}
function confirm_change() {
enable_button(submit_button());
hide_warning('identifier-change-confirmation');
}
function no_change() {
$("profile_data_identifier").value = $("old_profile_identifier").value;
enable_button(submit_button());
hide_warning('identifier-change-confirmation');
}
</script>
<%= hidden_field_tag 'old_profile_identifier', @profile.identifier %>
<div id="profile-identifier-formitem">
<%= required labelled_form_field( _('Address'),
content_tag('code',
url_for(profile.url).gsub(/#{profile.identifier}$/, '') +
text_field(:profile_data, :identifier, :onchange => "warn_value_change()", :size => 25)
) +
content_tag('div',
content_tag('strong', _('WARNING!')) + ' ' +
_("You are about to change the address, and this will break external links to the homepage or to content inside it. Do you really want to change?") +
content_tag('div',
button_to_function(:ok, _("Yes"), "confirm_change()") + ' ' +
button_to_function(:cancel, _('No'), 'no_change()')
),
:id => 'identifier-change-confirmation',
:class => 'change-confirmation',
:style => 'display: none;'
)
)
%>
</div>
<% end %>
<%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => 'profile_data', :profile => @profile } %>
<%= labelled_check_box(_('Enable "contact us"'), 'profile_data[enable_contact_us]', "1", @profile.enable_contact_us) if @profile.enterprise? %>
<%= render :partial => 'moderation', :locals => { :profile => @profile } %>