_organization.rhtml
4.59 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<h2><%= _('General information') %></h2>
<%= required_fields_message if @profile.required_fields.any? %>
<% 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 %>
<div class="formfieldline">
<label class="formlabel" for="profile_data_nickname"><%= _('Display name') %></label>
<div class="formfield type-text">
<%= text_field_tag 'profile_data[nickname]', @profile_data.nickname, :id => 'profile_data_nickname', :size => 30, :maxlength => 16, :onchange => (@environment.enabled?('enable_organization_url_change') ? "updateUrlField(this, 'profile_data_identifier')" : "") %>
<em><%= _('A short name by which the organization is know.')%></em>
</div>
</div>
<% if @environment.enabled?('enable_organization_url_change') %>
<script type="text/javascript">
function submit_button() {
return $("profile_data_identifier").form.select("input.submit")[0];
}
function warn_value_change(field) {
new Effect.Highlight($("profile-identifier-formitem"), {duration:3});
$("identifier-change-confirmation").show();
submit_button().disable();
submit_button().addClassName("disabled");
}
function hide_warning() {
submit_button().enable();
submit_button().removeClassName("disabled");
$("identifier-change-confirmation").hide()
}
</script>
<%= hidden_field_tag 'old_profile_identifier', @profile.identifier %>
<div id="profile-identifier-formitem">
<%= labelled_form_field( _('Address'),
'<code>' + url_for(profile.url).gsub(/#{profile.identifier}$/, '') +
text_field(:profile_data, :identifier, :onchange => "warn_value_change(this)", :size => 15) + '</code>' +
content_tag('div', '<strong>' + _('WARNING!') + '</strong> ' + _("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? ") +
'<div>' + button_to_function(:ok, _("Yes"), 'hide_warning()') + ' ' +
button_to_function(:cancel, _('No'), '$("profile_data_identifier").value = $("old_profile_identifier").value; hide_warning()') + '</div>',
:id => 'identifier-change-confirmation', :style => 'display: none;'
)
)
%>
</div>
<% end %>
<%= f.text_field(:acronym) %>
<%= f.text_field(:foundation_year) %>
<%= render :partial => 'shared/custom_fields', :locals => { :f => f, :object_name => 'profile_data', :profile => @profile, :only_required => false } %>
<%= labelled_check_box(_('Enable "contact us"'), 'profile_data[enable_contact_us]', "1", @profile.enable_contact_us) if @profile.enterprise? %>
<h1><%= _('Moderation options') %></h1>
<% if profile.community? %>
<div style='margin-bottom: 1em'>
<%= _('New members must be approved:')%>
</div>
<div style='margin-bottom: 0.5em'>
<%= radio_button 'profile_data', 'closed', 'true', :style => 'float: left' %>
<div style='margin-left: 30px'>
<%= _('<strong>Before</strong> joining this group (a moderator has to accept the member in pending request before member can access the intranet and/or the website).') %>
</div>
</div>
<div>
<%= radio_button 'profile_data', 'closed', 'false', :style => 'float: left' %>
<div style='margin-left: 30px'>
<%= _('<strong>After</strong> joining this group (a moderator can always desactivate access for users later).') %>
</div>
</div>
<br>
<% end %>
<div style='margin-bottom: 1em'>
<%= _('New articles posted by members of this group must be approved:')%>
</div>
<div style='margin-bottom: 0.5em'>
<%= radio_button 'profile_data', 'moderated_articles', 'true', :style => 'float: left' %>
<div style='margin-left: 30px'>
<%= _('<strong>Before</strong> being published in this group (a moderator has to accept the article in pending request before the article be listed as a article of this group.') %>
</div>
</div>
<div>
<%= radio_button 'profile_data', 'moderated_articles', 'false', :style => 'float: left' %>
<div style='margin-left: 30px'>
<%= _('<strong>After</strong> being published in this group (a moderator can always remove publicated articles later).') %>
</div>
</div>