_organization.rhtml
4.01 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 %>
<%= 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_identifier").form.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? %>
<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>