Commit 645651decb71157be42e85cac5b309700698fbda

Authored by Antonio Terceiro
1 parent 645451ed

Rename *.rhtml -> *.html.erb

*.rhtml is deprecated in Rails 3
Showing 762 changed files with 8014 additions and 8014 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 762 files displayed.

app/views/account/_email_status.html.erb 0 → 100644
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 +<div class='status-identifier'>
  2 + <p><span class='<%= @status_class %>'><%= @status %></span></p>
  3 + <script type="text/javascript">
  4 + jQuery('#user_email').removeClass('<%= validation_classes %>');
  5 + jQuery('#user_email').addClass('<%= @status_class %>');
  6 + </script>
  7 +</div>
app/views/account/_email_status.rhtml
@@ -1,7 +0,0 @@ @@ -1,7 +0,0 @@
1 -<div class='status-identifier'>  
2 - <p><span class='<%= @status_class %>'><%= @status %></span></p>  
3 - <script type="text/javascript">  
4 - jQuery('#user_email').removeClass('<%= validation_classes %>');  
5 - jQuery('#user_email').addClass('<%= @status_class %>');  
6 - </script>  
7 -</div>  
app/views/account/_identifier_status.html.erb 0 → 100644
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 +<div class='status-identifier'>
  2 + <p><span class='<%= @status_class %>'><%= @status %></span></p>
  3 + <script type="text/javascript">
  4 + jQuery('#user_login').removeClass('<%= validation_classes %>');
  5 + jQuery('#user_login').addClass('<%= @status_class %>');
  6 + </script>
  7 +</div>
app/views/account/_identifier_status.rhtml
@@ -1,7 +0,0 @@ @@ -1,7 +0,0 @@
1 -<div class='status-identifier'>  
2 - <p><span class='<%= @status_class %>'><%= @status %></span></p>  
3 - <script type="text/javascript">  
4 - jQuery('#user_login').removeClass('<%= validation_classes %>');  
5 - jQuery('#user_login').addClass('<%= @status_class %>');  
6 - </script>  
7 -</div>  
app/views/account/_login_form.html.erb 0 → 100644
@@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
  1 +<% labelled_form_for :user, @user,
  2 + :url => { :controller => 'account', :action => (params[:enterprise_code] ? 'activate_enterprise' : 'login') } do |f| %>
  3 +
  4 +<%= f.text_field :login,
  5 + :id => ( lightbox? ? 'lightbox_' : '' ) + 'user_login',
  6 + :onchange => 'this.value = convToValidLogin( this.value )' %>
  7 +
  8 +<%= f.password_field :password,
  9 + :id => ( lightbox? ? 'lightbox_' : '' ) + 'user_password' %>
  10 +
  11 +<% if params[:enterprise_code] %>
  12 + <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %>
  13 + <%= hidden_field_tag :answer, params[:answer] %>
  14 + <%= hidden_field_tag :terms_accepted, params[:terms_accepted] %>
  15 +<% end %>
  16 +
  17 +<% button_bar do %>
  18 + <%= submit_button( 'login', _('Log in') )%>
  19 + <%= lightbox_close_button(_('Cancel')) if lightbox? %>
  20 +<% end %>
  21 +
  22 +<% end %>
app/views/account/_login_form.rhtml
@@ -1,22 +0,0 @@ @@ -1,22 +0,0 @@
1 -<% labelled_form_for :user, @user,  
2 - :url => { :controller => 'account', :action => (params[:enterprise_code] ? 'activate_enterprise' : 'login') } do |f| %>  
3 -  
4 -<%= f.text_field :login,  
5 - :id => ( lightbox? ? 'lightbox_' : '' ) + 'user_login',  
6 - :onchange => 'this.value = convToValidLogin( this.value )' %>  
7 -  
8 -<%= f.password_field :password,  
9 - :id => ( lightbox? ? 'lightbox_' : '' ) + 'user_password' %>  
10 -  
11 -<% if params[:enterprise_code] %>  
12 - <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %>  
13 - <%= hidden_field_tag :answer, params[:answer] %>  
14 - <%= hidden_field_tag :terms_accepted, params[:terms_accepted] %>  
15 -<% end %>  
16 -  
17 -<% button_bar do %>  
18 - <%= submit_button( 'login', _('Log in') )%>  
19 - <%= lightbox_close_button(_('Cancel')) if lightbox? %>  
20 -<% end %>  
21 -  
22 -<% end %>  
app/views/account/_signup_form.html.erb 0 → 100644
@@ -0,0 +1,163 @@ @@ -0,0 +1,163 @@
  1 +<% @profile_data = @person %>
  2 +
  3 +<%= error_messages_for :user, :person, :header_message => _('The account could not be created') %>
  4 +
  5 +<% labelled_form_for :user, @user, :html => { :multipart => true, :id => 'signup-form' } do |f| %>
  6 +
  7 +<%= hidden_field_tag :invitation_code, @invitation_code %>
  8 +
  9 +<div id='signup-form-header'>
  10 +
  11 + <div id='signup-formfield-group'>
  12 + <%= label(:user, :login, _('Username'), {:class => 'formlabel'}) %>
  13 + <span id="signup-domain"><%= environment.default_hostname %>/</span>
  14 + <div id='signup-login'>
  15 + <div id='signup-login-field' class='formfield'>
  16 + <%= required text_field(:user, :login, :id => 'user_login', :onchange => 'this.value = convToValidLogin(this.value);') %>
  17 + <div id='url-check'><p>&nbsp;</p></div>
  18 + </div>
  19 + <%= content_tag(:small, _('Choose your login name carefully! It will be your network access and you will not be able to change it later.'), :id => 'signup-balloon') %>
  20 + <br style="clear: both;" />
  21 + </div>
  22 + </div>
  23 + <%= observe_field 'user_login',
  24 + :url => { :action => 'check_url' },
  25 + :with => 'identifier',
  26 + :update => 'url-check',
  27 + :loading => "jQuery('#user_login').removeClass('#{validation_classes}').addClass('checking');
  28 + jQuery('#url-check').html('<p><span class=\"checking\">#{checking_message(:url)}</span></p>');",
  29 + :complete => "jQuery('#user_login').removeClass('checking')"
  30 + %>
  31 +
  32 + <div id='signup-password'>
  33 + <%= required f.password_field(:password, :id => 'user_pw') %>
  34 + <%= content_tag(:small,_('Choose a password that you can remember easily. It must have at least 4 characters.'), :id => 'password-balloon') %>
  35 + <div id='fake-check'><p>&nbsp;</p></div>
  36 + </div>
  37 +
  38 + <div id='signup-password-confirmation'>
  39 + <%= required f.password_field(:password_confirmation) %>
  40 + <%= content_tag(:small,_('We need to be sure that you filled in your password correctly. Confirm you password.'), :id => 'password-confirmation-balloon') %>
  41 + <div id='password-check'><p>&nbsp;</p></div>
  42 + </div>
  43 +
  44 + <div id='signup-email'>
  45 + <%= required f.text_field(:email) %>
  46 + <%= content_tag(:small,_('This e-mail address will be used to contact you.'), :id => 'email-balloon') %>
  47 + <div id='email-check'><p>&nbsp;</p></div>
  48 + </div>
  49 + <%= observe_field "user_email",
  50 + :url => { :action => "check_email" },
  51 + :with => "address",
  52 + :update => "email-check",
  53 + :loading => "jQuery('#user_email').removeClass('#{validation_classes}').addClass('checking');
  54 + jQuery('#email-check').html('<p><span class=\"checking\">#{checking_message(:email)}</span></p>');",
  55 + :complete => "jQuery('#user_email').removeClass('checking')",
  56 + :before => "var field = jQuery('#user_email');
  57 + if (field.val()=='') {
  58 + field.removeClass('#{validation_classes}');
  59 + jQuery('#email-check').html('<p>&nbsp;</p>');
  60 + return false;
  61 + }
  62 + if (!( field.valid() )) {
  63 + field.removeClass('#{validation_classes}').addClass('invalid');
  64 + jQuery('#email-check').html('<p><span class=\"invalid\">#{_('This e-mail address is not valid')}</span></p>');
  65 + return false;
  66 + }"
  67 + %>
  68 +
  69 + <div id='signup-name'>
  70 + <%= labelled_form_field(_('Full name'), text_field(:profile_data, :name)) %>
  71 + <%= content_tag(:small,_('Tell us your name, it will be used to identify yourself.'), :id => 'name-balloon') %>
  72 + </div>
  73 +
  74 +</div>
  75 +
  76 +<div id="signup-form-profile">
  77 +
  78 + <% labelled_fields_for :profile_data, @person do |f| %>
  79 + <%= render :partial => 'profile_editor/person_form', :locals => {:f => f} %>
  80 + <% end %>
  81 +
  82 + <%= @plugins.dispatch(:signup_extra_contents).collect { |content| instance_eval(&content) }.join("") %>
  83 +
  84 + <%= template_options(Person, 'profile_data') %>
  85 +
  86 + <% unless @terms_of_use.blank? %>
  87 + <div id='terms-of-use-box' class='formfieldline'>
  88 + <%= labelled_check_box(_('I accept the %s') % link_to(_('terms of use'), {:controller => 'home', :action => 'terms'}, :target => '_blank'), 'user[terms_accepted]') %>
  89 + </div>
  90 + <% end %>
  91 +
  92 + <% if params[:enterprise_code] %>
  93 + <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %>
  94 + <%= hidden_field_tag :answer, params[:answer] %>
  95 + <%= hidden_field_tag :terms_accepted, params[:terms_accepted] %>
  96 + <%= hidden_field_tag :new_user, true %>
  97 + <% end %>
  98 +</div>
  99 +
  100 +<p style="text-align: center">
  101 + <%= submit_button('save', _('Create my account')) %>
  102 +</p>
  103 +
  104 +<% end -%>
  105 +
  106 +<script type="text/javascript">
  107 +jQuery(function($) {
  108 +
  109 + $('#signup-form #user_login').css('width', 335 - $('#signup-domain').outerWidth());
  110 +
  111 + $('#signup-form input[type=text], #signup-form textarea').each(function() {
  112 + $(this).bind('blur', function() {
  113 + if ($(this).val() == '') {
  114 + $(this).removeClass('filled-in');
  115 + }
  116 + else $(this).addClass('filled-in');
  117 + });
  118 + });
  119 +
  120 + $('#user_pw').focus(function() {
  121 + $('#password-balloon').fadeIn('slow');
  122 + });
  123 + $('#user_password_confirmation').focus(function() {
  124 + $('#password-confirmation-balloon').fadeIn('slow');
  125 + });
  126 + $('#user_password_confirmation, #user_pw').blur(function() {
  127 + if ($('#user_password_confirmation').val() != '') {
  128 + if ($('#user_password_confirmation').val() == $('#user_pw').val()) {
  129 + $('#user_password_confirmation').addClass('validated').removeClass('invalid');
  130 + $('#user_pw').removeClass('invalid_input').addClass('valid_input');
  131 + $('#password-check').html("<p>&nbsp;</p>");
  132 + } else if ($('#user_password_confirmation').val() != $('#user_pw').val()) {
  133 + $('#user_password_confirmation').removeClass('validated').addClass('invalid');
  134 + $('#user_pw').addClass('invalid_input').removeClass('valid_input');
  135 + $('#password-check').html("<p><span class='invalid'><%= _('Passwords don\'t match') %></span></p>");
  136 + }
  137 + }
  138 + $('#password-balloon').fadeOut('slow');
  139 + $('#password-confirmation-balloon').fadeOut('slow');
  140 + });
  141 + $('#user_login').focus(function() {
  142 + $('#signup-balloon').fadeIn('slow');
  143 + });
  144 + $('#user_login').blur(function() { $('#signup-balloon').fadeOut('slow'); });
  145 + $('#signup-form').validate({ rules: { 'user[email]': { email: true } }, messages: { 'user[email]' : '' } });
  146 + $('#user_email').focus(function() {
  147 + $('#email-balloon').fadeIn('slow');
  148 + });
  149 + $('#user_email').blur(function() {
  150 + $('#email-balloon').fadeOut('slow');
  151 + });
  152 + $('#profile_data_name').focus(function() {
  153 + $('#name-balloon').fadeIn('slow');
  154 + });
  155 + $('#profile_data_name').blur(function() {
  156 + $('#name-balloon').fadeOut('slow');
  157 + if ($(this).val() == '') {
  158 + $(this).removeClass('validated');
  159 + }
  160 + else $(this).addClass('validated');
  161 + });
  162 +});
  163 +</script>
app/views/account/_signup_form.rhtml
@@ -1,163 +0,0 @@ @@ -1,163 +0,0 @@
1 -<% @profile_data = @person %>  
2 -  
3 -<%= error_messages_for :user, :person, :header_message => _('The account could not be created') %>  
4 -  
5 -<% labelled_form_for :user, @user, :html => { :multipart => true, :id => 'signup-form' } do |f| %>  
6 -  
7 -<%= hidden_field_tag :invitation_code, @invitation_code %>  
8 -  
9 -<div id='signup-form-header'>  
10 -  
11 - <div id='signup-formfield-group'>  
12 - <%= label(:user, :login, _('Username'), {:class => 'formlabel'}) %>  
13 - <span id="signup-domain"><%= environment.default_hostname %>/</span>  
14 - <div id='signup-login'>  
15 - <div id='signup-login-field' class='formfield'>  
16 - <%= required text_field(:user, :login, :id => 'user_login', :onchange => 'this.value = convToValidLogin(this.value);') %>  
17 - <div id='url-check'><p>&nbsp;</p></div>  
18 - </div>  
19 - <%= content_tag(:small, _('Choose your login name carefully! It will be your network access and you will not be able to change it later.'), :id => 'signup-balloon') %>  
20 - <br style="clear: both;" />  
21 - </div>  
22 - </div>  
23 - <%= observe_field 'user_login',  
24 - :url => { :action => 'check_url' },  
25 - :with => 'identifier',  
26 - :update => 'url-check',  
27 - :loading => "jQuery('#user_login').removeClass('#{validation_classes}').addClass('checking');  
28 - jQuery('#url-check').html('<p><span class=\"checking\">#{checking_message(:url)}</span></p>');",  
29 - :complete => "jQuery('#user_login').removeClass('checking')"  
30 - %>  
31 -  
32 - <div id='signup-password'>  
33 - <%= required f.password_field(:password, :id => 'user_pw') %>  
34 - <%= content_tag(:small,_('Choose a password that you can remember easily. It must have at least 4 characters.'), :id => 'password-balloon') %>  
35 - <div id='fake-check'><p>&nbsp;</p></div>  
36 - </div>  
37 -  
38 - <div id='signup-password-confirmation'>  
39 - <%= required f.password_field(:password_confirmation) %>  
40 - <%= content_tag(:small,_('We need to be sure that you filled in your password correctly. Confirm you password.'), :id => 'password-confirmation-balloon') %>  
41 - <div id='password-check'><p>&nbsp;</p></div>  
42 - </div>  
43 -  
44 - <div id='signup-email'>  
45 - <%= required f.text_field(:email) %>  
46 - <%= content_tag(:small,_('This e-mail address will be used to contact you.'), :id => 'email-balloon') %>  
47 - <div id='email-check'><p>&nbsp;</p></div>  
48 - </div>  
49 - <%= observe_field "user_email",  
50 - :url => { :action => "check_email" },  
51 - :with => "address",  
52 - :update => "email-check",  
53 - :loading => "jQuery('#user_email').removeClass('#{validation_classes}').addClass('checking');  
54 - jQuery('#email-check').html('<p><span class=\"checking\">#{checking_message(:email)}</span></p>');",  
55 - :complete => "jQuery('#user_email').removeClass('checking')",  
56 - :before => "var field = jQuery('#user_email');  
57 - if (field.val()=='') {  
58 - field.removeClass('#{validation_classes}');  
59 - jQuery('#email-check').html('<p>&nbsp;</p>');  
60 - return false;  
61 - }  
62 - if (!( field.valid() )) {  
63 - field.removeClass('#{validation_classes}').addClass('invalid');  
64 - jQuery('#email-check').html('<p><span class=\"invalid\">#{_('This e-mail address is not valid')}</span></p>');  
65 - return false;  
66 - }"  
67 - %>  
68 -  
69 - <div id='signup-name'>  
70 - <%= labelled_form_field(_('Full name'), text_field(:profile_data, :name)) %>  
71 - <%= content_tag(:small,_('Tell us your name, it will be used to identify yourself.'), :id => 'name-balloon') %>  
72 - </div>  
73 -  
74 -</div>  
75 -  
76 -<div id="signup-form-profile">  
77 -  
78 - <% labelled_fields_for :profile_data, @person do |f| %>  
79 - <%= render :partial => 'profile_editor/person_form', :locals => {:f => f} %>  
80 - <% end %>  
81 -  
82 - <%= @plugins.dispatch(:signup_extra_contents).collect { |content| instance_eval(&content) }.join("") %>  
83 -  
84 - <%= template_options(Person, 'profile_data') %>  
85 -  
86 - <% unless @terms_of_use.blank? %>  
87 - <div id='terms-of-use-box' class='formfieldline'>  
88 - <%= labelled_check_box(_('I accept the %s') % link_to(_('terms of use'), {:controller => 'home', :action => 'terms'}, :target => '_blank'), 'user[terms_accepted]') %>  
89 - </div>  
90 - <% end %>  
91 -  
92 - <% if params[:enterprise_code] %>  
93 - <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %>  
94 - <%= hidden_field_tag :answer, params[:answer] %>  
95 - <%= hidden_field_tag :terms_accepted, params[:terms_accepted] %>  
96 - <%= hidden_field_tag :new_user, true %>  
97 - <% end %>  
98 -</div>  
99 -  
100 -<p style="text-align: center">  
101 - <%= submit_button('save', _('Create my account')) %>  
102 -</p>  
103 -  
104 -<% end -%>  
105 -  
106 -<script type="text/javascript">  
107 -jQuery(function($) {  
108 -  
109 - $('#signup-form #user_login').css('width', 335 - $('#signup-domain').outerWidth());  
110 -  
111 - $('#signup-form input[type=text], #signup-form textarea').each(function() {  
112 - $(this).bind('blur', function() {  
113 - if ($(this).val() == '') {  
114 - $(this).removeClass('filled-in');  
115 - }  
116 - else $(this).addClass('filled-in');  
117 - });  
118 - });  
119 -  
120 - $('#user_pw').focus(function() {  
121 - $('#password-balloon').fadeIn('slow');  
122 - });  
123 - $('#user_password_confirmation').focus(function() {  
124 - $('#password-confirmation-balloon').fadeIn('slow');  
125 - });  
126 - $('#user_password_confirmation, #user_pw').blur(function() {  
127 - if ($('#user_password_confirmation').val() != '') {  
128 - if ($('#user_password_confirmation').val() == $('#user_pw').val()) {  
129 - $('#user_password_confirmation').addClass('validated').removeClass('invalid');  
130 - $('#user_pw').removeClass('invalid_input').addClass('valid_input');  
131 - $('#password-check').html("<p>&nbsp;</p>");  
132 - } else if ($('#user_password_confirmation').val() != $('#user_pw').val()) {  
133 - $('#user_password_confirmation').removeClass('validated').addClass('invalid');  
134 - $('#user_pw').addClass('invalid_input').removeClass('valid_input');  
135 - $('#password-check').html("<p><span class='invalid'><%= _('Passwords don\'t match') %></span></p>");  
136 - }  
137 - }  
138 - $('#password-balloon').fadeOut('slow');  
139 - $('#password-confirmation-balloon').fadeOut('slow');  
140 - });  
141 - $('#user_login').focus(function() {  
142 - $('#signup-balloon').fadeIn('slow');  
143 - });  
144 - $('#user_login').blur(function() { $('#signup-balloon').fadeOut('slow'); });  
145 - $('#signup-form').validate({ rules: { 'user[email]': { email: true } }, messages: { 'user[email]' : '' } });  
146 - $('#user_email').focus(function() {  
147 - $('#email-balloon').fadeIn('slow');  
148 - });  
149 - $('#user_email').blur(function() {  
150 - $('#email-balloon').fadeOut('slow');  
151 - });  
152 - $('#profile_data_name').focus(function() {  
153 - $('#name-balloon').fadeIn('slow');  
154 - });  
155 - $('#profile_data_name').blur(function() {  
156 - $('#name-balloon').fadeOut('slow');  
157 - if ($(this).val() == '') {  
158 - $(this).removeClass('validated');  
159 - }  
160 - else $(this).addClass('validated');  
161 - });  
162 -});  
163 -</script>  
app/views/account/accept_terms.html.erb 0 → 100644
@@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
  1 +<script type="text/javascript">
  2 + function toggle_submit_button(id, enabled) {
  3 + button = $(id)
  4 + if (enabled){
  5 + button.className = button.className.replace(/disabled/, '')
  6 + button.enable()
  7 + } else {
  8 + button.className += ' disabled'
  9 + button.disable()
  10 + }
  11 + }
  12 +</script>
  13 +<div class=activation-box>
  14 + <h2><%= __('Enterprise activation') + ' - ' + (logged_in? ? _('part 2 of 2') : _(' part 2 of 3')) %></h2>
  15 +
  16 + <div id='terms-of-enterprise-use' class='height: 200px; overflow: auto;'><%= @terms_of_enterprise_use %></div>
  17 +
  18 + <% form_tag :action => 'activate_enterprise' do %>
  19 + <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %>
  20 + <%= hidden_field_tag :answer, params[:answer] %>
  21 +
  22 + <%= labelled_check_box(environment.terms_of_use_acceptance_text.blank? ? _('I read the terms of use and accepted them') : environment.terms_of_use_acceptance_text, :terms_accepted, '1', false, :onclick => 'toggle_submit_button("submit-accept-terms", this.checked)') %>
  23 + <% button_bar do %>
  24 + <%= button 'cancel', _('Cancel'), :controller => 'home', :action => 'index' %>
  25 + <%= submit_button 'forward', _('Continue'), {:disabled => true, :class => 'disabled', :id => 'submit-accept-terms'} %>
  26 + <% end %>
  27 + <% end %>
  28 +</div>
app/views/account/accept_terms.rhtml
@@ -1,28 +0,0 @@ @@ -1,28 +0,0 @@
1 -<script type="text/javascript">  
2 - function toggle_submit_button(id, enabled) {  
3 - button = $(id)  
4 - if (enabled){  
5 - button.className = button.className.replace(/disabled/, '')  
6 - button.enable()  
7 - } else {  
8 - button.className += ' disabled'  
9 - button.disable()  
10 - }  
11 - }  
12 -</script>  
13 -<div class=activation-box>  
14 - <h2><%= __('Enterprise activation') + ' - ' + (logged_in? ? _('part 2 of 2') : _(' part 2 of 3')) %></h2>  
15 -  
16 - <div id='terms-of-enterprise-use' class='height: 200px; overflow: auto;'><%= @terms_of_enterprise_use %></div>  
17 -  
18 - <% form_tag :action => 'activate_enterprise' do %>  
19 - <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %>  
20 - <%= hidden_field_tag :answer, params[:answer] %>  
21 -  
22 - <%= labelled_check_box(environment.terms_of_use_acceptance_text.blank? ? _('I read the terms of use and accepted them') : environment.terms_of_use_acceptance_text, :terms_accepted, '1', false, :onclick => 'toggle_submit_button("submit-accept-terms", this.checked)') %>  
23 - <% button_bar do %>  
24 - <%= button 'cancel', _('Cancel'), :controller => 'home', :action => 'index' %>  
25 - <%= submit_button 'forward', _('Continue'), {:disabled => true, :class => 'disabled', :id => 'submit-accept-terms'} %>  
26 - <% end %>  
27 - <% end %>  
28 -</div>  
app/views/account/activate_enterprise.html.erb 0 → 100644
@@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
  1 +<div class='activation-box'>
  2 +<h2><%= __('Enterprise activation - part 3 of 3') %></h2>
  3 +
  4 +<%= error_messages_for :user %>
  5 +
  6 +<p><%= __('Now for you manage your enterprise you have to associate an individual account to the enterprise.') %></p>
  7 +<p><%= _('Do you have a personal user account in the system?') %></p>
  8 +
  9 +<div id="enterprise-activation-create-user-or-login-button">
  10 + <%= button_to_function 'login', _('Yes'), "$('enterprise-activation-create-user-form').hide(); $('enterprise-activation-login-form').show()" %>
  11 + <%= button_to_function 'add', _('No'), "$('enterprise-activation-login-form').hide(); $('enterprise-activation-create-user-form').show()" %>
  12 +</div>
  13 +
  14 +<div id="enterprise-activation-create-user-form" style="display: none">
  15 + <h3><%= _('Personal signup form') %></h3>
  16 + <%= render :partial => 'signup_form', :locals => { :hidden_atention => true } %>
  17 + <p><%= message = __('<b>Warning</b>: this form is for your personal information, not of your enterprise. So you will have a personal account that can manage your enterprise.') %></p>
  18 +</div>
  19 +
  20 +<div id="enterprise-activation-login-form" style="display: none">
  21 +
  22 + <h3><%= _('Enter you user name and password') %></h3>
  23 + <%= render :partial => 'login_form' %>
  24 + <p><%= message %></p>
  25 +</div>
  26 +
  27 +
  28 +</div>
app/views/account/activate_enterprise.rhtml
@@ -1,28 +0,0 @@ @@ -1,28 +0,0 @@
1 -<div class='activation-box'>  
2 -<h2><%= __('Enterprise activation - part 3 of 3') %></h2>  
3 -  
4 -<%= error_messages_for :user %>  
5 -  
6 -<p><%= __('Now for you manage your enterprise you have to associate an individual account to the enterprise.') %></p>  
7 -<p><%= _('Do you have a personal user account in the system?') %></p>  
8 -  
9 -<div id="enterprise-activation-create-user-or-login-button">  
10 - <%= button_to_function 'login', _('Yes'), "$('enterprise-activation-create-user-form').hide(); $('enterprise-activation-login-form').show()" %>  
11 - <%= button_to_function 'add', _('No'), "$('enterprise-activation-login-form').hide(); $('enterprise-activation-create-user-form').show()" %>  
12 -</div>  
13 -  
14 -<div id="enterprise-activation-create-user-form" style="display: none">  
15 - <h3><%= _('Personal signup form') %></h3>  
16 - <%= render :partial => 'signup_form', :locals => { :hidden_atention => true } %>  
17 - <p><%= message = __('<b>Warning</b>: this form is for your personal information, not of your enterprise. So you will have a personal account that can manage your enterprise.') %></p>  
18 -</div>  
19 -  
20 -<div id="enterprise-activation-login-form" style="display: none">  
21 -  
22 - <h3><%= _('Enter you user name and password') %></h3>  
23 - <%= render :partial => 'login_form' %>  
24 - <p><%= message %></p>  
25 -</div>  
26 -  
27 -  
28 -</div>  
app/views/account/activation_question.html.erb 0 → 100644
@@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
  1 +<script language="JavaScript1.2">
  2 + function check_valid_year(form) {
  3 + var answer = parseInt(form.answer.value);
  4 + var val = form.answer.value;
  5 + if (!answer || (val.length != 4) || val > <%= Time.now.year %> || val < 1900) {
  6 + alert(<%= (_('The year must be between %d and %d') % [1900, Time.now.year]).inspect %>);
  7 + return false;
  8 + } else {
  9 + return true;
  10 + }
  11 + }
  12 +
  13 + function check_valid_cnpj(form) {
  14 + var answer = parseInt(form.answer.value);
  15 + var val = form.answer.value;
  16 + if (!answer || (val.length != 14)) {
  17 + alert(<%= _('A CNPJ have 14 digits').inspect %>);
  18 + return false;
  19 + } else {
  20 + return true;
  21 + }
  22 + }
  23 +</script>
  24 +
  25 +<div class='activation-box'>
  26 + <h2><%= __('Enterprise activation') + ' - ' + (logged_in? ? _('part 1 of 2') : _('part 1 of 3')) %></h2>
  27 + <% form_tag( {:action => 'accept_terms'}, {:method => 'get', :onsubmit => (@question == :foundation_year ? 'return check_valid_year(this)' : 'return check_valid_cnpj(this)')}) do %>
  28 +
  29 + <p> <strong><%= _('Pay atention! You have only one chance!') %></strong> </p>
  30 +
  31 + <p><%= __("This is a question to know if you really are part of this enterprise. Pay atention because you have only one chance to answer right and activate your enterprise. If you answer wrong you will not be able to activate the enterprise automaticaly and must get in touch with the admins of %s by email or phone.") % environment.name %> </p>
  32 +
  33 + <%= ApplicationHelper::NoosferoFormBuilder::output_field(@question == :foundation_year ? (__("What year your enterprise was founded? It must have 4 digits, eg 1990. %s") % environment.tip_message_enterprise_activation_question) : __('What is the CNPJ of your enterprise?'), text_field_tag(:answer, nil, :id => 'enterprise-activation-answer')) %>
  34 +
  35 + <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %>
  36 +
  37 + <% button_bar do %>
  38 + <%= button 'cancel', _('Cancel'), :action => 'index' %>
  39 + <%= submit_button 'forward', _('Continue') %>
  40 + <% end %>
  41 + <% end %>
  42 +</div>
app/views/account/activation_question.rhtml
@@ -1,42 +0,0 @@ @@ -1,42 +0,0 @@
1 -<script language="JavaScript1.2">  
2 - function check_valid_year(form) {  
3 - var answer = parseInt(form.answer.value);  
4 - var val = form.answer.value;  
5 - if (!answer || (val.length != 4) || val > <%= Time.now.year %> || val < 1900) {  
6 - alert(<%= (_('The year must be between %d and %d') % [1900, Time.now.year]).inspect %>);  
7 - return false;  
8 - } else {  
9 - return true;  
10 - }  
11 - }  
12 -  
13 - function check_valid_cnpj(form) {  
14 - var answer = parseInt(form.answer.value);  
15 - var val = form.answer.value;  
16 - if (!answer || (val.length != 14)) {  
17 - alert(<%= _('A CNPJ have 14 digits').inspect %>);  
18 - return false;  
19 - } else {  
20 - return true;  
21 - }  
22 - }  
23 -</script>  
24 -  
25 -<div class='activation-box'>  
26 - <h2><%= __('Enterprise activation') + ' - ' + (logged_in? ? _('part 1 of 2') : _('part 1 of 3')) %></h2>  
27 - <% form_tag( {:action => 'accept_terms'}, {:method => 'get', :onsubmit => (@question == :foundation_year ? 'return check_valid_year(this)' : 'return check_valid_cnpj(this)')}) do %>  
28 -  
29 - <p> <strong><%= _('Pay atention! You have only one chance!') %></strong> </p>  
30 -  
31 - <p><%= __("This is a question to know if you really are part of this enterprise. Pay atention because you have only one chance to answer right and activate your enterprise. If you answer wrong you will not be able to activate the enterprise automaticaly and must get in touch with the admins of %s by email or phone.") % environment.name %> </p>  
32 -  
33 - <%= ApplicationHelper::NoosferoFormBuilder::output_field(@question == :foundation_year ? (__("What year your enterprise was founded? It must have 4 digits, eg 1990. %s") % environment.tip_message_enterprise_activation_question) : __('What is the CNPJ of your enterprise?'), text_field_tag(:answer, nil, :id => 'enterprise-activation-answer')) %>  
34 -  
35 - <%= hidden_field_tag :enterprise_code, params[:enterprise_code] %>  
36 -  
37 - <% button_bar do %>  
38 - <%= button 'cancel', _('Cancel'), :action => 'index' %>  
39 - <%= submit_button 'forward', _('Continue') %>  
40 - <% end %>  
41 - <% end %>  
42 -</div>  
app/views/account/already_activated.html.erb 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +<%= __('This enterprise is already active') %>
app/views/account/already_activated.rhtml
@@ -1 +0,0 @@ @@ -1 +0,0 @@
1 -<%= __('This enterprise is already active') %>  
app/views/account/blocked.html.erb 0 → 100644
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +<div class='blocked-warning' >
  2 +<center><h1><%= __('This enterprise can\'t be activated by the system') %></h1></center>
  3 +<p><%= __('Unfortunately this enterprise can\'t be activated via the system.') %></p>
  4 +<p>
  5 +<% if @enterprise.blocked? %>
  6 + <%= _('There was a failed atempt of activation and the automated activation was disabled for your security.') %>
  7 +<% else %>
  8 + <%= __('We don\'t have enough information about your enterprise to identify you.') %>
  9 +<% end %>
  10 +</p>
  11 +
  12 +<% if @environment.activation_blocked_text.blank? %>
  13 + <%= __('Your enterprise has been blocked') %>
  14 +<% else %>
  15 + <%= @environment.activation_blocked_text %>
  16 +<% end %>
  17 +</div>
app/views/account/blocked.rhtml
@@ -1,17 +0,0 @@ @@ -1,17 +0,0 @@
1 -<div class='blocked-warning' >  
2 -<center><h1><%= __('This enterprise can\'t be activated by the system') %></h1></center>  
3 -<p><%= __('Unfortunately this enterprise can\'t be activated via the system.') %></p>  
4 -<p>  
5 -<% if @enterprise.blocked? %>  
6 - <%= _('There was a failed atempt of activation and the automated activation was disabled for your security.') %>  
7 -<% else %>  
8 - <%= __('We don\'t have enough information about your enterprise to identify you.') %>  
9 -<% end %>  
10 -</p>  
11 -  
12 -<% if @environment.activation_blocked_text.blank? %>  
13 - <%= __('Your enterprise has been blocked') %>  
14 -<% else %>  
15 - <%= @environment.activation_blocked_text %>  
16 -<% end %>  
17 -</div>  
app/views/account/change_password.html.erb 0 → 100644
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +<h1><%= _('Change password') %></h1>
  2 +
  3 +<% form_tag do %>
  4 +
  5 +<p><label for="password"><%= _('Current password') %></label><br/>
  6 +<%= password_field_tag :current_password %></p>
  7 +
  8 +<p><label for="password"><%= _('New password') %></label><br/>
  9 +<%= password_field_tag :new_password %></p>
  10 +
  11 +<p><label for="password_confirmation"><%= _('Confirm your new Password') %></label><br/>
  12 +<%= password_field_tag :new_password_confirmation %></p>
  13 +
  14 +<%= submit_button :ok, _('Change password') %>
  15 +
  16 +<% end %>
  17 +
app/views/account/change_password.rhtml
@@ -1,17 +0,0 @@ @@ -1,17 +0,0 @@
1 -<h1><%= _('Change password') %></h1>  
2 -  
3 -<% form_tag do %>  
4 -  
5 -<p><label for="password"><%= _('Current password') %></label><br/>  
6 -<%= password_field_tag :current_password %></p>  
7 -  
8 -<p><label for="password"><%= _('New password') %></label><br/>  
9 -<%= password_field_tag :new_password %></p>  
10 -  
11 -<p><label for="password_confirmation"><%= _('Confirm your new Password') %></label><br/>  
12 -<%= password_field_tag :new_password_confirmation %></p>  
13 -  
14 -<%= submit_button :ok, _('Change password') %>  
15 -  
16 -<% end %>  
17 -  
app/views/account/forgot_password.html.erb 0 → 100644
@@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
  1 +<h1><%= _('Forgot your password?') %></h1>
  2 +
  3 +<%= error_messages_for :change_password, :header_message => _('Instructions to password recovery could not be sent'), :message => nil %>
  4 +
  5 +<% labelled_form_for :change_password, @change_password, :url => { :action => 'forgot_password' } do |f| %>
  6 +
  7 + <%= f.text_field :login,
  8 + :onchange => 'this.value = convToValidLogin( this.value )' %>
  9 +
  10 + <%= f.text_field :email %>
  11 +
  12 + <%= f.hidden_field :environment_id, :value => environment.id %>
  13 +
  14 +<div>
  15 + <% button_bar do %>
  16 + <%= submit_button('send', _('Send instructions')) %>
  17 + <% end %>
  18 +</div>
  19 +<%= content_tag(:small,_('After clicking the button above, you will receive an email with a link to a page where you will be able to create a new password.')) %>
  20 +
  21 +<% end %>
  22 +
app/views/account/forgot_password.rhtml
@@ -1,22 +0,0 @@ @@ -1,22 +0,0 @@
1 -<h1><%= _('Forgot your password?') %></h1>  
2 -  
3 -<%= error_messages_for :change_password, :header_message => _('Instructions to password recovery could not be sent'), :message => nil %>  
4 -  
5 -<% labelled_form_for :change_password, @change_password, :url => { :action => 'forgot_password' } do |f| %>  
6 -  
7 - <%= f.text_field :login,  
8 - :onchange => 'this.value = convToValidLogin( this.value )' %>  
9 -  
10 - <%= f.text_field :email %>  
11 -  
12 - <%= f.hidden_field :environment_id, :value => environment.id %>  
13 -  
14 -<div>  
15 - <% button_bar do %>  
16 - <%= submit_button('send', _('Send instructions')) %>  
17 - <% end %>  
18 -</div>  
19 -<%= content_tag(:small,_('After clicking the button above, you will receive an email with a link to a page where you will be able to create a new password.')) %>  
20 -  
21 -<% end %>  
22 -  
app/views/account/index.html.erb 0 → 100644
@@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
  1 +<h1><%= _('Account options') %></h1>
  2 +
  3 +<p>
  4 +<%= link_to _('Change password.'), :action => 'change_password' %>
  5 +<%= _('It is a good idea to change your password from times to times.') %>
  6 +</p>
  7 +
  8 +<p>
  9 +<%= link_to _('Edit Personal details.'), :controller => 'profile_editor', :profile => user.identifier, :action => 'index' %>
  10 +<%= _('You can change your personal details.') %>
  11 +</p>
  12 +
  13 +<p>
  14 +<%= link_to_homepage(_('My home page.')) %>
  15 +<%= _('See your homepage.') %>
  16 +</p>
  17 +
  18 +<p>
  19 +<%= link_to(_('Manage content.'), :controller => 'cms', :profile => user.identifier, :action => 'index') %>
  20 +<%= _('Manage your content.') %>
  21 +</p>
  22 +
  23 +<p>
  24 +<%= link_to _('Logout.'), :action => 'logout' %>
  25 +<%= _('It is always a good idea to make a logout when you finish using the environment.')%>
  26 +</p>
app/views/account/index.rhtml
@@ -1,26 +0,0 @@ @@ -1,26 +0,0 @@
1 -<h1><%= _('Account options') %></h1>  
2 -  
3 -<p>  
4 -<%= link_to _('Change password.'), :action => 'change_password' %>  
5 -<%= _('It is a good idea to change your password from times to times.') %>  
6 -</p>  
7 -  
8 -<p>  
9 -<%= link_to _('Edit Personal details.'), :controller => 'profile_editor', :profile => user.identifier, :action => 'index' %>  
10 -<%= _('You can change your personal details.') %>  
11 -</p>  
12 -  
13 -<p>  
14 -<%= link_to_homepage(_('My home page.')) %>  
15 -<%= _('See your homepage.') %>  
16 -</p>  
17 -  
18 -<p>  
19 -<%= link_to(_('Manage content.'), :controller => 'cms', :profile => user.identifier, :action => 'index') %>  
20 -<%= _('Manage your content.') %>  
21 -</p>  
22 -  
23 -<p>  
24 -<%= link_to _('Logout.'), :action => 'logout' %>  
25 -<%= _('It is always a good idea to make a logout when you finish using the environment.')%>  
26 -</p>  
app/views/account/index_anonymous.html.erb 0 → 100644
@@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
  1 +<h1><%= _('Identify yourself') %></h1>
  2 +
  3 +<p>
  4 +<%= lightbox_link_to _('Login.'), { :controller => 'account', :action => 'login_popup' } %>
  5 +
  6 +<%= _('You need to login to be able to use all the features in this environment.') %>
  7 +</p>
  8 +
  9 +<p>
  10 +<%= link_to _('Sign up.'), :action => 'signup' %>
  11 +<%= _('If you are not an user already, you can register now to become a member of this environment.') %>
  12 +</p>
app/views/account/index_anonymous.rhtml
@@ -1,12 +0,0 @@ @@ -1,12 +0,0 @@
1 -<h1><%= _('Identify yourself') %></h1>  
2 -  
3 -<p>  
4 -<%= lightbox_link_to _('Login.'), { :controller => 'account', :action => 'login_popup' } %>  
5 -  
6 -<%= _('You need to login to be able to use all the features in this environment.') %>  
7 -</p>  
8 -  
9 -<p>  
10 -<%= link_to _('Sign up.'), :action => 'signup' %>  
11 -<%= _('If you are not an user already, you can register now to become a member of this environment.') %>  
12 -</p>  
app/views/account/invalid_change_password_code.html.erb 0 → 100644
@@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
  1 +<h1><%= _("Invalid change password code") %></h1>
  2 +
  3 +<p>
  4 +<%= _('The code you are using for password change is not valid. Please try to request password change using the <a href="%s">"I forgot my password"</a> functionality.') % url_for(:action => 'forgot_password') %>
  5 +</p>
app/views/account/invalid_change_password_code.rhtml
@@ -1,5 +0,0 @@ @@ -1,5 +0,0 @@
1 -<h1><%= _("Invalid change password code") %></h1>  
2 -  
3 -<p>  
4 -<%= _('The code you are using for password change is not valid. Please try to request password change using the <a href="%s">"I forgot my password"</a> functionality.') % url_for(:action => 'forgot_password') %>  
5 -</p>  
app/views/account/invalid_enterprise_code.html.erb 0 → 100644
@@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
  1 +<h1><%= __("Invalid enterprise code") %></h1>
  2 +
  3 +<p>
  4 +<%= __('The code you are using for validate your enterprise is not valid. Please check if you are typing it correctly.') %>
  5 +</p>
app/views/account/invalid_enterprise_code.rhtml
@@ -1,5 +0,0 @@ @@ -1,5 +0,0 @@
1 -<h1><%= __("Invalid enterprise code") %></h1>  
2 -  
3 -<p>  
4 -<%= __('The code you are using for validate your enterprise is not valid. Please check if you are typing it correctly.') %>  
5 -</p>  
app/views/account/login.html.erb 0 → 100644
@@ -0,0 +1,38 @@ @@ -0,0 +1,38 @@
  1 +<div class="login-box">
  2 +
  3 +<h2><%= _('Login') %></h2>
  4 +
  5 +<% @user ||= User.new %>
  6 +<% is_thickbox ||= false %>
  7 +
  8 +<%= @message %>
  9 +
  10 +<% labelled_form_for :user, @user, :url => login_url do |f| %>
  11 +
  12 + <%= f.text_field :login, :id => 'main_user_login', :onchange => 'this.value = convToValidLogin( this.value )', :value => params[:userlogin] %>
  13 +
  14 + <%= f.password_field :password %>
  15 +
  16 + <%= @plugins.dispatch(:login_extra_contents).collect { |content| instance_eval(&content) }.join("") %>
  17 +
  18 + <% button_bar do %>
  19 + <%= submit_button( 'login', _('Log in') )%>
  20 + <% if is_thickbox %>
  21 + <%= thickbox_close_button(_('Cancel')) %>
  22 + <% end %>
  23 + <% end %>
  24 +
  25 +<% end %>
  26 +
  27 +<% button_bar do %>
  28 + <% unless @plugins.dispatch(:allow_user_registration).include?(false) %>
  29 + <%= button :add, _("New user"), :controller => 'account', :action => 'signup' %>
  30 + <% end %>
  31 +
  32 + <% unless @plugins.dispatch(:allow_password_recovery).include?(false) %>
  33 + <%= button :help, _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %>
  34 + <% end %>
  35 +<% end %>
  36 +
  37 +</div><!-- end class="login-box" -->
  38 +
app/views/account/login.rhtml
@@ -1,38 +0,0 @@ @@ -1,38 +0,0 @@
1 -<div class="login-box">  
2 -  
3 -<h2><%= _('Login') %></h2>  
4 -  
5 -<% @user ||= User.new %>  
6 -<% is_thickbox ||= false %>  
7 -  
8 -<%= @message %>  
9 -  
10 -<% labelled_form_for :user, @user, :url => login_url do |f| %>  
11 -  
12 - <%= f.text_field :login, :id => 'main_user_login', :onchange => 'this.value = convToValidLogin( this.value )', :value => params[:userlogin] %>  
13 -  
14 - <%= f.password_field :password %>  
15 -  
16 - <%= @plugins.dispatch(:login_extra_contents).collect { |content| instance_eval(&content) }.join("") %>  
17 -  
18 - <% button_bar do %>  
19 - <%= submit_button( 'login', _('Log in') )%>  
20 - <% if is_thickbox %>  
21 - <%= thickbox_close_button(_('Cancel')) %>  
22 - <% end %>  
23 - <% end %>  
24 -  
25 -<% end %>  
26 -  
27 -<% button_bar do %>  
28 - <% unless @plugins.dispatch(:allow_user_registration).include?(false) %>  
29 - <%= button :add, _("New user"), :controller => 'account', :action => 'signup' %>  
30 - <% end %>  
31 -  
32 - <% unless @plugins.dispatch(:allow_password_recovery).include?(false) %>  
33 - <%= button :help, _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %>  
34 - <% end %>  
35 -<% end %>  
36 -  
37 -</div><!-- end class="login-box" -->  
38 -  
app/views/account/login_block.html.erb 0 → 100644
@@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
  1 +<div class="login-box">
  2 + <% unless logged_in? %>
  3 +
  4 + <h2><span><%= _('Login') %></span></h2>
  5 +
  6 + <div class="login-box-content">
  7 +
  8 +<%
  9 + @user ||= User.new
  10 +%>
  11 +
  12 + <% labelled_form_for :user, @user, :url => login_url do |f| %>
  13 +
  14 + <%= f.text_field :login, :onchange => 'this.value = convToValidLogin( this.value )' %>
  15 +
  16 + <%= f.password_field :password %>
  17 +
  18 + <%= @plugins.dispatch(:login_extra_contents).collect { |content| instance_eval(&content) }.join("") %>
  19 +
  20 + <% button_bar do %>
  21 + <%= submit_button( 'login', _('Log in') )%>
  22 + <% unless @plugins.dispatch(:allow_user_registration).include?(false) %>
  23 + <%= link_to content_tag( 'span', _('New user') ),
  24 + { :controller => 'account', :action => 'signup' },
  25 + :class => 'button with-text icon-add' %>
  26 + <% end %>
  27 + <% end %>
  28 +
  29 + <% end %>
  30 +
  31 + <% unless @plugins.dispatch(:allow_password_recovery).include?(false) %>
  32 + <p class="forgot-passwd">
  33 + <%= link_to _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %>
  34 + </p>
  35 + <% end %>
  36 +
  37 + </div>
  38 +
  39 + <% else %>
  40 + <h2><%= user.identifier %></h2>
  41 + <% end %>
  42 +
  43 +</div><!-- end id="login-box" -->
  44 +
app/views/account/login_block.rhtml
@@ -1,44 +0,0 @@ @@ -1,44 +0,0 @@
1 -<div class="login-box">  
2 - <% unless logged_in? %>  
3 -  
4 - <h2><span><%= _('Login') %></span></h2>  
5 -  
6 - <div class="login-box-content">  
7 -  
8 -<%  
9 - @user ||= User.new  
10 -%>  
11 -  
12 - <% labelled_form_for :user, @user, :url => login_url do |f| %>  
13 -  
14 - <%= f.text_field :login, :onchange => 'this.value = convToValidLogin( this.value )' %>  
15 -  
16 - <%= f.password_field :password %>  
17 -  
18 - <%= @plugins.dispatch(:login_extra_contents).collect { |content| instance_eval(&content) }.join("") %>  
19 -  
20 - <% button_bar do %>  
21 - <%= submit_button( 'login', _('Log in') )%>  
22 - <% unless @plugins.dispatch(:allow_user_registration).include?(false) %>  
23 - <%= link_to content_tag( 'span', _('New user') ),  
24 - { :controller => 'account', :action => 'signup' },  
25 - :class => 'button with-text icon-add' %>  
26 - <% end %>  
27 - <% end %>  
28 -  
29 - <% end %>  
30 -  
31 - <% unless @plugins.dispatch(:allow_password_recovery).include?(false) %>  
32 - <p class="forgot-passwd">  
33 - <%= link_to _("I forgot my password!"), :controller => 'account', :action => 'forgot_password' %>  
34 - </p>  
35 - <% end %>  
36 -  
37 - </div>  
38 -  
39 - <% else %>  
40 - <h2><%= user.identifier %></h2>  
41 - <% end %>  
42 -  
43 -</div><!-- end id="login-box" -->  
44 -  
app/views/account/logout_popup.html.erb 0 → 100644
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 +<h2><%= _('Are you sure you want to get out?') %></h2>
  2 +<p>
  3 +<% button_bar do %>
  4 + <%= button :ok, _('Yes'), { :controller => 'account', :action => 'logout' } %>
  5 + <%= lightbox_close_button _('No, I want to stay.') %>
  6 +<% end %>
  7 +</p>
app/views/account/logout_popup.rhtml
@@ -1,7 +0,0 @@ @@ -1,7 +0,0 @@
1 -<h2><%= _('Are you sure you want to get out?') %></h2>  
2 -<p>  
3 -<% button_bar do %>  
4 - <%= button :ok, _('Yes'), { :controller => 'account', :action => 'logout' } %>  
5 - <%= lightbox_close_button _('No, I want to stay.') %>  
6 -<% end %>  
7 -</p>  
app/views/account/new_password.html.erb 0 → 100644
@@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
  1 +<h1><%= _('Enter new password') %></h1>
  2 +
  3 +<p>
  4 +<%= _("Hello, %s! Please enter your new password in the form below.") % @change_password.requestor.name %>
  5 +</p>
  6 +
  7 +<%= error_messages_for :change_password %>
  8 +
  9 +<% form_for(:change_password) do |f| %>
  10 +
  11 + <%= labelled_form_field(_('Enter new password'), (f.password_field :password)) %>
  12 + <%= labelled_form_field(_('Confirm the new password'), (f.password_field :password_confirmation)) %>
  13 + <% button_bar do %>
  14 + <%= submit_button(:ok, _('Change password')) %>
  15 + <% end %>
  16 +
  17 +<% end %>
app/views/account/new_password.rhtml
@@ -1,17 +0,0 @@ @@ -1,17 +0,0 @@
1 -<h1><%= _('Enter new password') %></h1>  
2 -  
3 -<p>  
4 -<%= _("Hello, %s! Please enter your new password in the form below.") % @change_password.requestor.name %>  
5 -</p>  
6 -  
7 -<%= error_messages_for :change_password %>  
8 -  
9 -<% form_for(:change_password) do |f| %>  
10 -  
11 - <%= labelled_form_field(_('Enter new password'), (f.password_field :password)) %>  
12 - <%= labelled_form_field(_('Confirm the new password'), (f.password_field :password_confirmation)) %>  
13 - <% button_bar do %>  
14 - <%= submit_button(:ok, _('Change password')) %>  
15 - <% end %>  
16 -  
17 -<% end %>  
app/views/account/new_password_ok.html.erb 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +<h1><%= _('Password changed sucessfully') %></h1>
  2 +
  3 +<p>
  4 +<%= _('%s, your new password was successfully installed.') % @change_password.requestor.identifier %>
  5 +</p>
  6 +
  7 +<p>
  8 +<%= _("You can <a href='%s'>login</a> now.") % url_for(:action => 'login') %>
  9 +</p>
app/views/account/new_password_ok.rhtml
@@ -1,9 +0,0 @@ @@ -1,9 +0,0 @@
1 -<h1><%= _('Password changed sucessfully') %></h1>  
2 -  
3 -<p>  
4 -<%= _('%s, your new password was successfully installed.') % @change_password.requestor.identifier %>  
5 -</p>  
6 -  
7 -<p>  
8 -<%= _("You can <a href='%s'>login</a> now.") % url_for(:action => 'login') %>  
9 -</p>  
app/views/account/password_recovery_sent.html.erb 0 → 100644
@@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
  1 +<h1><%= _('Password recovery') %></h1>
  2 +
  3 +<p>
  4 +<%= _('An e-mail was just sent to your e-mail address, with instructions for changing your password. You should receive it in a few minutes.') %>
  5 +</p>
app/views/account/password_recovery_sent.rhtml
@@ -1,5 +0,0 @@ @@ -1,5 +0,0 @@
1 -<h1><%= _('Password recovery') %></h1>  
2 -  
3 -<p>  
4 -<%= _('An e-mail was just sent to your e-mail address, with instructions for changing your password. You should receive it in a few minutes.') %>  
5 -</p>  
app/views/account/signup.html.erb 0 → 100644
@@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
  1 +<% if @register_pending %>
  2 +<div id='thanks-for-signing'>
  3 + <h1><%= _("Welcome to %s!") % environment.name %></h1>
  4 + <h3><%= _("Thanks for signing up, we're thrilled to have you on our social network!") %></h3>
  5 + <p><%= _("Firstly, some tips for getting started:") %></p>
  6 + <h4><%= _("Confirm your account!") %></h4>
  7 + <p><%= _("You should receive a welcome email from us shortly. Please take a second to follow the link within to confirm your account.") %></p>
  8 + <p><%= _("You won't appear as %s until your account is confirmed.") % link_to(_('user'), {:controller => :search, :action => :people, :filter => 'more_recent'}, :target => '_blank') %></p>
  9 + <h4><%= _("What to do next?") %></h4>
  10 + <p><%= _("%s. Upload an avatar and let your friends find you easily :)") % link_to(_('Customize your profile'), {:controller => 'doc', :section => 'user', :topic => 'editing-person-info'}, :target => '_blank') %></p>
  11 + <p><%= _("Learn the guidelines. Read the %s for more details on how to use this social network!") % link_to(_('Documentation'), {:controller => 'doc'}, :target => '_blank') %></p>
  12 + <p><%= _("%s your Gmail, Yahoo and Hotmail contacts!") % link_to(_('Invite and find'), {:controller => 'doc', :section => 'user', :topic => 'invite-contacts'}, :target => '_blank') %></p>
  13 + <p><%= _("Start exploring and have fun!") %></p>
  14 +</div>
  15 +<% else %>
  16 + <h1><%= _('Sign up for %s!') % environment.name %></h1>
  17 + <%= render :partial => 'signup_form' %>
  18 +<% end %>
app/views/account/signup.rhtml
@@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
1 -<% if @register_pending %>  
2 -<div id='thanks-for-signing'>  
3 - <h1><%= _("Welcome to %s!") % environment.name %></h1>  
4 - <h3><%= _("Thanks for signing up, we're thrilled to have you on our social network!") %></h3>  
5 - <p><%= _("Firstly, some tips for getting started:") %></p>  
6 - <h4><%= _("Confirm your account!") %></h4>  
7 - <p><%= _("You should receive a welcome email from us shortly. Please take a second to follow the link within to confirm your account.") %></p>  
8 - <p><%= _("You won't appear as %s until your account is confirmed.") % link_to(_('user'), {:controller => :search, :action => :people, :filter => 'more_recent'}, :target => '_blank') %></p>  
9 - <h4><%= _("What to do next?") %></h4>  
10 - <p><%= _("%s. Upload an avatar and let your friends find you easily :)") % link_to(_('Customize your profile'), {:controller => 'doc', :section => 'user', :topic => 'editing-person-info'}, :target => '_blank') %></p>  
11 - <p><%= _("Learn the guidelines. Read the %s for more details on how to use this social network!") % link_to(_('Documentation'), {:controller => 'doc'}, :target => '_blank') %></p>  
12 - <p><%= _("%s your Gmail, Yahoo and Hotmail contacts!") % link_to(_('Invite and find'), {:controller => 'doc', :section => 'user', :topic => 'invite-contacts'}, :target => '_blank') %></p>  
13 - <p><%= _("Start exploring and have fun!") %></p>  
14 -</div>  
15 -<% else %>  
16 - <h1><%= _('Sign up for %s!') % environment.name %></h1>  
17 - <%= render :partial => 'signup_form' %>  
18 -<% end %>  
app/views/account/welcome.html.erb 0 → 100644
@@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
  1 +<% if @enterprise && logged_in? %>
  2 + <h1><%= _('Welcome to %s') % environment.name %></h1>
  3 +
  4 + <%= __('%s was successfuly activated. Now you may go to your control panel or to the control panel of your enterprise') % @enterprise.name %>
  5 +
  6 + <% button_bar do %>
  7 + <%= button 'forward', _('Go to my control panel'), :action => 'index', :controller => 'profile_editor', :profile => current_user.person.identifier %>
  8 + <%= button 'forward', __('Go to my enterprise control panel') % @enterprise.name, :action => 'index', :controller => 'profile_editor', :profile => @enterprise.identifier %>
  9 + <% end %>
  10 +<% end %>
app/views/account/welcome.rhtml
@@ -1,10 +0,0 @@ @@ -1,10 +0,0 @@
1 -<% if @enterprise && logged_in? %>  
2 - <h1><%= _('Welcome to %s') % environment.name %></h1>  
3 -  
4 - <%= __('%s was successfuly activated. Now you may go to your control panel or to the control panel of your enterprise') % @enterprise.name %>  
5 -  
6 - <% button_bar do %>  
7 - <%= button 'forward', _('Go to my control panel'), :action => 'index', :controller => 'profile_editor', :profile => current_user.person.identifier %>  
8 - <%= button 'forward', __('Go to my enterprise control panel') % @enterprise.name, :action => 'index', :controller => 'profile_editor', :profile => @enterprise.identifier %>  
9 - <% end %>  
10 -<% end %>  
app/views/admin_panel/_signup_welcome_text.html.erb 0 → 100644
@@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
  1 +<div class='description'>
  2 + <%= _('This text will be sent to new users if the feature "Send welcome e-mail to new users" is enabled on environment.') %><br/><br/>
  3 + <%= _('Including %s on body, it will be replaced by the real name of the e-mail recipient.') % content_tag('code', '{user_name}') %>
  4 +</div>
  5 +
  6 +<%= labelled_form_field(_('Subject'), text_field(:environment, :signup_welcome_text_subject, :style => 'width:100%')) %>
  7 +<%= labelled_form_field(_('Body'), text_area(:environment, :signup_welcome_text_body, :cols => 40, :style => 'width: 100%', :class => 'mceEditor')) %>
app/views/admin_panel/_signup_welcome_text.rhtml
@@ -1,7 +0,0 @@ @@ -1,7 +0,0 @@
1 -<div class='description'>  
2 - <%= _('This text will be sent to new users if the feature "Send welcome e-mail to new users" is enabled on environment.') %><br/><br/>  
3 - <%= _('Including %s on body, it will be replaced by the real name of the e-mail recipient.') % content_tag('code', '{user_name}') %>  
4 -</div>  
5 -  
6 -<%= labelled_form_field(_('Subject'), text_field(:environment, :signup_welcome_text_subject, :style => 'width:100%')) %>  
7 -<%= labelled_form_field(_('Body'), text_area(:environment, :signup_welcome_text_body, :cols => 40, :style => 'width: 100%', :class => 'mceEditor')) %>  
app/views/admin_panel/_site_info.html.erb 0 → 100644
@@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
  1 +<%= required labelled_form_field(_('Site name'), text_field(:environment, :name)) %>
  2 +<%= labelled_form_field(_('Contact email'), text_field(:environment, :contact_email)) %>
  3 +<% themes_options = Theme.system_themes.map {|theme| [theme.name, theme.id] }.sort %>
  4 +<%= labelled_form_field(_('Theme'), select(:environment, :theme, options_for_select(themes_options, environment.theme))) %>
  5 +<%= required f.text_field(:reports_lower_bound, :size => 3) %>
  6 +<%= labelled_form_field(_('Default language'), select(:environment, :default_language, environment.locales.invert, { :selected => environment.default_locale, :include_blank => true })) %>
  7 +<%= label_tag :languages, _('Available languages') %>
  8 +<br />
  9 +
  10 +<%
  11 + fields = Noosfero.locales.map do |value, name|
  12 + labelled_check_box(name, "environment[languages][#{value}]", true, environment.available_locales.include?(value))
  13 + end
  14 +%>
  15 +<%= balanced_table(fields)%>
  16 +
  17 +<br />
  18 +<%= labelled_form_field _('Homepage content'), text_area(:environment, :description, :cols => 40, :style => 'width: 90%', :class => 'mceEditor') %>
app/views/admin_panel/_site_info.rhtml
@@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
1 -<%= required labelled_form_field(_('Site name'), text_field(:environment, :name)) %>  
2 -<%= labelled_form_field(_('Contact email'), text_field(:environment, :contact_email)) %>  
3 -<% themes_options = Theme.system_themes.map {|theme| [theme.name, theme.id] }.sort %>  
4 -<%= labelled_form_field(_('Theme'), select(:environment, :theme, options_for_select(themes_options, environment.theme))) %>  
5 -<%= required f.text_field(:reports_lower_bound, :size => 3) %>  
6 -<%= labelled_form_field(_('Default language'), select(:environment, :default_language, environment.locales.invert, { :selected => environment.default_locale, :include_blank => true })) %>  
7 -<%= label_tag :languages, _('Available languages') %>  
8 -<br />  
9 -  
10 -<%  
11 - fields = Noosfero.locales.map do |value, name|  
12 - labelled_check_box(name, "environment[languages][#{value}]", true, environment.available_locales.include?(value))  
13 - end  
14 -%>  
15 -<%= balanced_table(fields)%>  
16 -  
17 -<br />  
18 -<%= labelled_form_field _('Homepage content'), text_area(:environment, :description, :cols => 40, :style => 'width: 90%', :class => 'mceEditor') %>  
app/views/admin_panel/_terms_of_use.html.erb 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +<%= f.text_area :terms_of_use, :cols => 40, :style => 'width: 90%', :class => 'mceEditor' %>
app/views/admin_panel/_terms_of_use.rhtml
@@ -1 +0,0 @@ @@ -1 +0,0 @@
1 -<%= f.text_area :terms_of_use, :cols => 40, :style => 'width: 90%', :class => 'mceEditor' %>  
app/views/admin_panel/index.html.erb 0 → 100644
@@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
  1 +<h1><%= _('Administrator Panel') %></h1>
  2 +
  3 +<h2><%= _('System settings') %></h2>
  4 +
  5 +<table>
  6 + <tr><td><%= link_to _('Environment settings'), :action => 'site_info' %></td></tr>
  7 + <tr><td><%= link_to _('Features'), :controller => 'features' %></td></tr>
  8 + <tr><td><%= link_to _('Plugins'), :controller => 'plugins' %></td></tr>
  9 + <tr><td><%= link_to _('Sideboxes'), :controller => 'environment_design'%></td></tr>
  10 + <tr><td><%= link_to _('Homepage'), :action => 'set_portal_community' %></td></tr>
  11 + <tr><td><%= link_to _('Licenses'), :controller =>'licenses' %></td></tr>
  12 +</table>
  13 +
  14 +<h2><%= _('Profiles') %></h2>
  15 +
  16 +<table>
  17 + <tr><td><%= link_to _('User roles'), :controller => 'role' %></td></tr>
  18 + <tr><td><%= link_to _('Users'), :controller => 'users' %></td></tr>
  19 + <tr><td><%= link_to _('Profile templates'), :controller => 'templates' %></td></tr>
  20 + <tr><td><%= link_to _('Fields'), :controller => 'features', :action => 'manage_fields' %></td></tr>
  21 +</table>
  22 +
  23 +
  24 +<%
  25 + plugin_links = @plugins.dispatch(:admin_panel_links)
  26 +%>
  27 +<% unless plugin_links.empty? %>
  28 + <h2><%= _('Plugins') %></h2>
  29 + <table>
  30 + <% plugin_links.each do |link| %>
  31 + <tr><td><%= link_to link[:title], link[:url] %></td></tr>
  32 + <% end %>
  33 + </table>
  34 +<% end %>
  35 +
  36 +<h2><%= _('Enterprise-related settings') %></h2>
  37 +
  38 +<table>
  39 + <tr><td><%= link_to __('Message for disabled enterprises'), :action => 'message_for_disabled_enterprise' %></td></tr>
  40 + <tr><td><%= link_to _('Validators by region'), :controller => 'region_validators' %></td></tr>
  41 + <tr><td><%= link_to _('Categories'), :controller => 'categories'%></td></tr>
  42 +</table>
app/views/admin_panel/index.rhtml
@@ -1,42 +0,0 @@ @@ -1,42 +0,0 @@
1 -<h1><%= _('Administrator Panel') %></h1>  
2 -  
3 -<h2><%= _('System settings') %></h2>  
4 -  
5 -<table>  
6 - <tr><td><%= link_to _('Environment settings'), :action => 'site_info' %></td></tr>  
7 - <tr><td><%= link_to _('Features'), :controller => 'features' %></td></tr>  
8 - <tr><td><%= link_to _('Plugins'), :controller => 'plugins' %></td></tr>  
9 - <tr><td><%= link_to _('Sideboxes'), :controller => 'environment_design'%></td></tr>  
10 - <tr><td><%= link_to _('Homepage'), :action => 'set_portal_community' %></td></tr>  
11 - <tr><td><%= link_to _('Licenses'), :controller =>'licenses' %></td></tr>  
12 -</table>  
13 -  
14 -<h2><%= _('Profiles') %></h2>  
15 -  
16 -<table>  
17 - <tr><td><%= link_to _('User roles'), :controller => 'role' %></td></tr>  
18 - <tr><td><%= link_to _('Users'), :controller => 'users' %></td></tr>  
19 - <tr><td><%= link_to _('Profile templates'), :controller => 'templates' %></td></tr>  
20 - <tr><td><%= link_to _('Fields'), :controller => 'features', :action => 'manage_fields' %></td></tr>  
21 -</table>  
22 -  
23 -  
24 -<%  
25 - plugin_links = @plugins.dispatch(:admin_panel_links)  
26 -%>  
27 -<% unless plugin_links.empty? %>  
28 - <h2><%= _('Plugins') %></h2>  
29 - <table>  
30 - <% plugin_links.each do |link| %>  
31 - <tr><td><%= link_to link[:title], link[:url] %></td></tr>  
32 - <% end %>  
33 - </table>  
34 -<% end %>  
35 -  
36 -<h2><%= _('Enterprise-related settings') %></h2>  
37 -  
38 -<table>  
39 - <tr><td><%= link_to __('Message for disabled enterprises'), :action => 'message_for_disabled_enterprise' %></td></tr>  
40 - <tr><td><%= link_to _('Validators by region'), :controller => 'region_validators' %></td></tr>  
41 - <tr><td><%= link_to _('Categories'), :controller => 'categories'%></td></tr>  
42 -</table>  
app/views/admin_panel/message_for_disabled_enterprise.html.erb 0 → 100644
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
  1 +<h2><%= _('Site info') %></h2>
  2 +
  3 +<%= render :file => 'shared/tiny_mce' %>
  4 +
  5 +<% labelled_form_for :environment, @environment, :url => {:action => 'site_info'} do |f| %>
  6 +
  7 + <%= f.text_area :message_for_disabled_enterprise, :cols => 40, :style => 'width: 90%' %>
  8 +
  9 + <% button_bar do %>
  10 + <%= submit_button(:save, _('Save')) %>
  11 + <%= button(:cancel, _('Cancel'), :action => 'index') %>
  12 + <% end %>
  13 +
  14 +<% end %>
app/views/admin_panel/message_for_disabled_enterprise.rhtml
@@ -1,14 +0,0 @@ @@ -1,14 +0,0 @@
1 -<h2><%= _('Site info') %></h2>  
2 -  
3 -<%= render :file => 'shared/tiny_mce' %>  
4 -  
5 -<% labelled_form_for :environment, @environment, :url => {:action => 'site_info'} do |f| %>  
6 -  
7 - <%= f.text_area :message_for_disabled_enterprise, :cols => 40, :style => 'width: 90%' %>  
8 -  
9 - <% button_bar do %>  
10 - <%= submit_button(:save, _('Save')) %>  
11 - <%= button(:cancel, _('Cancel'), :action => 'index') %>  
12 - <% end %>  
13 -  
14 -<% end %>  
app/views/admin_panel/set_portal_community.html.erb 0 → 100644
@@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
  1 +<h1> <%= _('Set Environment Portal') %></h1>
  2 +
  3 +<% if @portal_community.new_record? %>
  4 + <% form_tag do %>
  5 + <%= labelled_form_field(_('Portal identifier'), text_field_tag('portal_community_identifier', @portal_community.identifier, :size => 40) ) %>
  6 +
  7 + <% button_bar do %>
  8 + <%= submit_button 'save', _('Save'), :cancel => { :action => 'index' } %>
  9 + <% end %>
  10 + <% end %>
  11 +<% else %>
  12 + <%= _('Portal identifier: %s') % link_to(@portal_community.identifier, @portal_community.url) %>
  13 +
  14 + <% button_bar do %>
  15 + <%if @portal_community.environment.enabled?('use_portal_community') %>
  16 + <%= button 'cancel', _('Disable'), {:action => 'manage_portal_community', :activate => 0} %>
  17 + <% else %>
  18 + <%= button 'ok', _('Enable'), {:action => 'manage_portal_community', :activate => 1} %>
  19 + <% end %>
  20 + <%= button 'folder', _('Select Portal Folders'), {:action => 'set_portal_folders'} %>
  21 + <%= button 'edit', _('Define Amount by Folder'), {:action => 'set_portal_news_amount'} %>
  22 + <%= button 'delete', _('Remove'), { :action => 'unset_portal_community'} %>
  23 + <% end %>
  24 +<% end %>
app/views/admin_panel/set_portal_community.rhtml
@@ -1,24 +0,0 @@ @@ -1,24 +0,0 @@
1 -<h1> <%= _('Set Environment Portal') %></h1>  
2 -  
3 -<% if @portal_community.new_record? %>  
4 - <% form_tag do %>  
5 - <%= labelled_form_field(_('Portal identifier'), text_field_tag('portal_community_identifier', @portal_community.identifier, :size => 40) ) %>  
6 -  
7 - <% button_bar do %>  
8 - <%= submit_button 'save', _('Save'), :cancel => { :action => 'index' } %>  
9 - <% end %>  
10 - <% end %>  
11 -<% else %>  
12 - <%= _('Portal identifier: %s') % link_to(@portal_community.identifier, @portal_community.url) %>  
13 -  
14 - <% button_bar do %>  
15 - <%if @portal_community.environment.enabled?('use_portal_community') %>  
16 - <%= button 'cancel', _('Disable'), {:action => 'manage_portal_community', :activate => 0} %>  
17 - <% else %>  
18 - <%= button 'ok', _('Enable'), {:action => 'manage_portal_community', :activate => 1} %>  
19 - <% end %>  
20 - <%= button 'folder', _('Select Portal Folders'), {:action => 'set_portal_folders'} %>  
21 - <%= button 'edit', _('Define Amount by Folder'), {:action => 'set_portal_news_amount'} %>  
22 - <%= button 'delete', _('Remove'), { :action => 'unset_portal_community'} %>  
23 - <% end %>  
24 -<% end %>  
app/views/admin_panel/set_portal_folders.html.erb 0 → 100644
@@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
  1 +<h1><%= _('Select folders') %></h1>
  2 +
  3 +<p><%= _('Select the folders that will hold the news of the initial page of the environment') %></p>
  4 +
  5 +<script type="text/javascript">
  6 + jQuery(document).ready(function() {
  7 + jQuery('#add').click(function() {
  8 + return !jQuery('#portal-folders-list option:selected').remove().appendTo('#selected-folders');
  9 + });
  10 + jQuery('#remove').click(function() {
  11 + return !jQuery('#selected-folders option:selected').remove().appendTo('#portal-folders-list');
  12 + });
  13 +
  14 + jQuery('form').submit(function() {
  15 + jQuery('#selected-folders option').each(function(i) {
  16 + jQuery(this).attr('selected','selected');
  17 + });
  18 + });
  19 + });
  20 + </script>
  21 +
  22 +<div id='available-folders'>
  23 + <%= labelled_form_field(_('Available folders'), select_tag( 'folders[]', options_from_collection_for_select(@available_portal_folders, :id, :name, nil), {:id => 'portal-folders-list', :multiple => true, :size => 6 }) ) %>
  24 +</div>
  25 +
  26 +<div id='selection-buttons'>
  27 + <%= button :down, _('Add'), '#', { :id => 'add' } %>
  28 + <%= button :up, _('Remove'), '#', { :id => 'remove' } %>
  29 +</div>
  30 +
  31 +<% form_tag do %>
  32 + <div id='portal-folders'>
  33 + <%= labelled_form_field(_('Portal folders'), select_tag( 'folders[]', options_from_collection_for_select(@selected, :id, :name, nil), {:id => 'selected-folders', :multiple => true, :size => 6 })) %>
  34 + </div>
  35 +
  36 + <p>
  37 + <%= _('The same order in which you arrange the folders here will be used for arranging the boxes in the environment initial page.') %>
  38 + </p>
  39 +
  40 + <% button_bar do %>
  41 + <%= submit_button 'save', _('Save'), :cancel => {:action => 'index'} %>
  42 + <% end %>
  43 +<% end %>
app/views/admin_panel/set_portal_folders.rhtml
@@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
1 -<h1><%= _('Select folders') %></h1>  
2 -  
3 -<p><%= _('Select the folders that will hold the news of the initial page of the environment') %></p>  
4 -  
5 -<script type="text/javascript">  
6 - jQuery(document).ready(function() {  
7 - jQuery('#add').click(function() {  
8 - return !jQuery('#portal-folders-list option:selected').remove().appendTo('#selected-folders');  
9 - });  
10 - jQuery('#remove').click(function() {  
11 - return !jQuery('#selected-folders option:selected').remove().appendTo('#portal-folders-list');  
12 - });  
13 -  
14 - jQuery('form').submit(function() {  
15 - jQuery('#selected-folders option').each(function(i) {  
16 - jQuery(this).attr('selected','selected');  
17 - });  
18 - });  
19 - });  
20 - </script>  
21 -  
22 -<div id='available-folders'>  
23 - <%= labelled_form_field(_('Available folders'), select_tag( 'folders[]', options_from_collection_for_select(@available_portal_folders, :id, :name, nil), {:id => 'portal-folders-list', :multiple => true, :size => 6 }) ) %>  
24 -</div>  
25 -  
26 -<div id='selection-buttons'>  
27 - <%= button :down, _('Add'), '#', { :id => 'add' } %>  
28 - <%= button :up, _('Remove'), '#', { :id => 'remove' } %>  
29 -</div>  
30 -  
31 -<% form_tag do %>  
32 - <div id='portal-folders'>  
33 - <%= labelled_form_field(_('Portal folders'), select_tag( 'folders[]', options_from_collection_for_select(@selected, :id, :name, nil), {:id => 'selected-folders', :multiple => true, :size => 6 })) %>  
34 - </div>  
35 -  
36 - <p>  
37 - <%= _('The same order in which you arrange the folders here will be used for arranging the boxes in the environment initial page.') %>  
38 - </p>  
39 -  
40 - <% button_bar do %>  
41 - <%= submit_button 'save', _('Save'), :cancel => {:action => 'index'} %>  
42 - <% end %>  
43 -<% end %>  
app/views/admin_panel/set_portal_news_amount.html.erb 0 → 100644
@@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
  1 +<h1><%= _('News amount by folder') %></h1>
  2 +
  3 +<% labelled_form_for :environment, @environment do |f| %>
  4 +
  5 + <%= labelled_form_field _('Number of news'), select(:environment, :news_amount_by_folder, (1..10).to_a) %>
  6 +
  7 + <% button_bar do %>
  8 + <%= submit_button(:save, _('Save')) %>
  9 + <%= button(:cancel, _('Cancel'), :action => 'index') %>
  10 + <% end %>
  11 +
  12 +<% end %>
app/views/admin_panel/set_portal_news_amount.rhtml
@@ -1,12 +0,0 @@ @@ -1,12 +0,0 @@
1 -<h1><%= _('News amount by folder') %></h1>  
2 -  
3 -<% labelled_form_for :environment, @environment do |f| %>  
4 -  
5 - <%= labelled_form_field _('Number of news'), select(:environment, :news_amount_by_folder, (1..10).to_a) %>  
6 -  
7 - <% button_bar do %>  
8 - <%= submit_button(:save, _('Save')) %>  
9 - <%= button(:cancel, _('Cancel'), :action => 'index') %>  
10 - <% end %>  
11 -  
12 -<% end %>  
app/views/admin_panel/site_info.html.erb 0 → 100644
@@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
  1 +<h2><%= _('Environment settings') %></h2>
  2 +
  3 +<%= error_messages_for :environment %>
  4 +
  5 +<%= render :file => 'shared/tiny_mce' %>
  6 +
  7 +<% labelled_form_for :environment, @environment, :url => {:host => @environment.default_hostname, :port => request.port} do |f| %>
  8 + <% tabs = [] %>
  9 + <% tabs << {:title => _('Site info'), :id => 'site-info',
  10 + :content => (render :partial => 'site_info', :locals => {:f => f})} %>
  11 + <% tabs << {:title => _('Terms of use'), :id => 'terms-of-use',
  12 + :content => (render :partial => 'terms_of_use', :locals => {:f => f})} %>
  13 + <% tabs << {:title => _('Signup welcome text'), :id => 'signup-welcome-text',
  14 + :content => (render :partial => 'signup_welcome_text', :locals => {:f => f})} %>
  15 + <%= render_tabs(tabs) %>
  16 + <% button_bar do %>
  17 + <%= submit_button(:save, _('Save'), :cancel => {:action => 'index'}) %>
  18 + <% end %>
  19 +<% end %>
app/views/admin_panel/site_info.rhtml
@@ -1,19 +0,0 @@ @@ -1,19 +0,0 @@
1 -<h2><%= _('Environment settings') %></h2>  
2 -  
3 -<%= error_messages_for :environment %>  
4 -  
5 -<%= render :file => 'shared/tiny_mce' %>  
6 -  
7 -<% labelled_form_for :environment, @environment, :url => {:host => @environment.default_hostname, :port => request.port} do |f| %>  
8 - <% tabs = [] %>  
9 - <% tabs << {:title => _('Site info'), :id => 'site-info',  
10 - :content => (render :partial => 'site_info', :locals => {:f => f})} %>  
11 - <% tabs << {:title => _('Terms of use'), :id => 'terms-of-use',  
12 - :content => (render :partial => 'terms_of_use', :locals => {:f => f})} %>  
13 - <% tabs << {:title => _('Signup welcome text'), :id => 'signup-welcome-text',  
14 - :content => (render :partial => 'signup_welcome_text', :locals => {:f => f})} %>  
15 - <%= render_tabs(tabs) %>  
16 - <% button_bar do %>  
17 - <%= submit_button(:save, _('Save'), :cancel => {:action => 'index'}) %>  
18 - <% end %>  
19 -<% end %>  
app/views/blocks/categories.html.erb 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +<%= block_title(block.title) %>
  2 +
  3 +<%= display_category_menu block, block.selected_categories %>
app/views/blocks/categories.rhtml
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -<%= block_title(block.title) %>  
2 -  
3 -<%= display_category_menu block, block.selected_categories %>  
app/views/blocks/disabled_enterprise_message.html.erb 0 → 100644
@@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
  1 +<div id='enterprise-disabled'>
  2 + <%= message %>
  3 + <% if profile.blocked? && user && user.is_admin?(profile.environment) %>
  4 + <div class='unlock-button'>
  5 + <%= button :lock, _('Unblock'), {:controller => 'profile', :action => 'unblock'} %>
  6 + </div>
  7 + <% end %>
  8 +</div>
app/views/blocks/disabled_enterprise_message.rhtml
@@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
1 -<div id='enterprise-disabled'>  
2 - <%= message %>  
3 - <% if profile.blocked? && user && user.is_admin?(profile.environment) %>  
4 - <div class='unlock-button'>  
5 - <%= button :lock, _('Unblock'), {:controller => 'profile', :action => 'unblock'} %>  
6 - </div>  
7 - <% end %>  
8 -</div>  
app/views/blocks/featured_products.html.erb 0 → 100644
@@ -0,0 +1,55 @@ @@ -0,0 +1,55 @@
  1 +<%= block_title(block.title) %>
  2 +<% unless block.products.blank? %>
  3 + <%= link_to content_tag(:span, _('Previous')), '#', :class => 'featured-product-prev featured-product-arrow' %>
  4 + <div class="featured-products-block-container">
  5 + <ul class="featured-products-list">
  6 + <% block.products.in_groups_of(block.groups_of).each do |group| %>
  7 + <li class="featured-products-group">
  8 + <div class="featured-product-items">
  9 + <ul>
  10 + <% group.reject{ |x| x.nil? }.each_with_index do |p, i| %>
  11 + <li class="featured-product-item">
  12 + <%= link_to content_tag(:img, nil, :src => p.image.public_filename(:thumb), :alt => p.name, :class => ('reflect' if block.reflect)), product_path(p), :class => 'featured-product-image' %>
  13 + <div class="featured-product-info position-<%= i + 1 %>" style="display: none">
  14 + <div class="featured-product-text">
  15 + <h3><%= p.name %></h3>
  16 + <p class="featured-product-price"><%= float_to_currency(p.price) %></p>
  17 + <p class="featured-product-desc"><%= truncate(p.description, 50, '...') %></p>
  18 + <p><%= link_to _('See More'), product_path(p), :class => 'featured-product-link' %></p>
  19 + </div>
  20 + </div>
  21 + </li>
  22 + <% end %>
  23 + </ul>
  24 + </div>
  25 + </li>
  26 + <% end %>
  27 + </ul>
  28 + </div>
  29 + <%= link_to content_tag(:span, _('Next')), '#', :class => 'featured-product-next featured-product-arrow' %>
  30 + <script type="text/javascript">
  31 + (function($) {
  32 + var options = {
  33 + fx : 'scrollHorz',
  34 + timeout: 0,
  35 + prev: '#block-<%= block.id %> .featured-product-prev',
  36 + next: '#block-<%= block.id %> .featured-product-next',
  37 + speed: <%= block.speed || 2000 %>
  38 + }
  39 + $('#block-<%= block.id %> .featured-products-list').cycle(options);
  40 +
  41 + $(document).ready(function(){
  42 + $(".featured-product-item").hover(
  43 + function() {
  44 + $(".featured-product-info", this).fadeIn('slow');
  45 + },
  46 + function() {
  47 + $(".featured-product-info", this).fadeOut('slow');
  48 + });
  49 + });
  50 + })(jQuery);
  51 + </script>
  52 + <p class="featured-products-footer"></p>
  53 +<% else %>
  54 + <em><%= _('Please, edit this block and choose some products') %></em>
  55 +<% end %>
app/views/blocks/featured_products.rhtml
@@ -1,55 +0,0 @@ @@ -1,55 +0,0 @@
1 -<%= block_title(block.title) %>  
2 -<% unless block.products.blank? %>  
3 - <%= link_to content_tag(:span, _('Previous')), '#', :class => 'featured-product-prev featured-product-arrow' %>  
4 - <div class="featured-products-block-container">  
5 - <ul class="featured-products-list">  
6 - <% block.products.in_groups_of(block.groups_of).each do |group| %>  
7 - <li class="featured-products-group">  
8 - <div class="featured-product-items">  
9 - <ul>  
10 - <% group.reject{ |x| x.nil? }.each_with_index do |p, i| %>  
11 - <li class="featured-product-item">  
12 - <%= link_to content_tag(:img, nil, :src => p.image.public_filename(:thumb), :alt => p.name, :class => ('reflect' if block.reflect)), product_path(p), :class => 'featured-product-image' %>  
13 - <div class="featured-product-info position-<%= i + 1 %>" style="display: none">  
14 - <div class="featured-product-text">  
15 - <h3><%= p.name %></h3>  
16 - <p class="featured-product-price"><%= float_to_currency(p.price) %></p>  
17 - <p class="featured-product-desc"><%= truncate(p.description, 50, '...') %></p>  
18 - <p><%= link_to _('See More'), product_path(p), :class => 'featured-product-link' %></p>  
19 - </div>  
20 - </div>  
21 - </li>  
22 - <% end %>  
23 - </ul>  
24 - </div>  
25 - </li>  
26 - <% end %>  
27 - </ul>  
28 - </div>  
29 - <%= link_to content_tag(:span, _('Next')), '#', :class => 'featured-product-next featured-product-arrow' %>  
30 - <script type="text/javascript">  
31 - (function($) {  
32 - var options = {  
33 - fx : 'scrollHorz',  
34 - timeout: 0,  
35 - prev: '#block-<%= block.id %> .featured-product-prev',  
36 - next: '#block-<%= block.id %> .featured-product-next',  
37 - speed: <%= block.speed || 2000 %>  
38 - }  
39 - $('#block-<%= block.id %> .featured-products-list').cycle(options);  
40 -  
41 - $(document).ready(function(){  
42 - $(".featured-product-item").hover(  
43 - function() {  
44 - $(".featured-product-info", this).fadeIn('slow');  
45 - },  
46 - function() {  
47 - $(".featured-product-info", this).fadeOut('slow');  
48 - });  
49 - });  
50 - })(jQuery);  
51 - </script>  
52 - <p class="featured-products-footer"></p>  
53 -<% else %>  
54 - <em><%= _('Please, edit this block and choose some products') %></em>  
55 -<% end %>  
app/views/blocks/highlights.html.erb 0 → 100644
@@ -0,0 +1,55 @@ @@ -0,0 +1,55 @@
  1 +<%= block_title(block.title) %>
  2 +<% if !block.featured_images.empty? %>
  3 + <div class='highlights-border'>
  4 + <div class='highlights-container'>
  5 + <% block.featured_images.each do |img| %>
  6 + <a href="<%= img[:address] %>" title="<%= img[:title] %>" class="highlights-image-link">
  7 + <%= content_tag :img, nil, :src => img[:image_src], :alt => img[:title] %>
  8 + <p class="highlights-label"><%= img[:title] %></p>
  9 + </a>
  10 + <% end %>
  11 + </div>
  12 + <% if block.navigation %>
  13 + <div class='highlights-block-pager'>
  14 + </div>
  15 + <% end %>
  16 + </div>
  17 + <p class="highlights-block-footer"></p>
  18 + <script type="text/javascript">
  19 + (function($) {
  20 + $.fn.cycle.transitions.customFade = function($cont, $slides, opts) {
  21 + $slides.not(":eq(" + opts.currSlide + ")").css("opacity", 0);
  22 + opts.before.push(function(curr, next, opts) {
  23 + $.fn.cycle.commonReset(curr, next, opts);
  24 + opts.cssBefore.opacity = 0;
  25 + });
  26 + opts.animIn = {
  27 + opacity: 1
  28 + };
  29 + opts.animOut = {
  30 + opacity: 0
  31 + };
  32 + opts.cssBefore = {
  33 + top: 0,
  34 + left: 0,
  35 + zIndex: 1,
  36 + display: 'block'
  37 + };
  38 + opts.cssAfter = {
  39 + zIndex: 0
  40 + };
  41 + };
  42 + var options = {
  43 + fx: 'customFade',
  44 + fastOnEvent: 1,
  45 + timeout: <%= block.interval * 1000 %>
  46 + };
  47 + <% if block.navigation %>
  48 + options.pager = '#block-<%= block.id %> .highlights-block-pager';
  49 + <% end %>
  50 + $('#block-<%= block.id %> .highlights-container').cycle(options);
  51 + })(jQuery);
  52 + </script>
  53 +<% else %>
  54 + <em><%= _('Please, edit this block and choose some images') %></em>
  55 +<% end %>
app/views/blocks/highlights.rhtml
@@ -1,55 +0,0 @@ @@ -1,55 +0,0 @@
1 -<%= block_title(block.title) %>  
2 -<% if !block.featured_images.empty? %>  
3 - <div class='highlights-border'>  
4 - <div class='highlights-container'>  
5 - <% block.featured_images.each do |img| %>  
6 - <a href="<%= img[:address] %>" title="<%= img[:title] %>" class="highlights-image-link">  
7 - <%= content_tag :img, nil, :src => img[:image_src], :alt => img[:title] %>  
8 - <p class="highlights-label"><%= img[:title] %></p>  
9 - </a>  
10 - <% end %>  
11 - </div>  
12 - <% if block.navigation %>  
13 - <div class='highlights-block-pager'>  
14 - </div>  
15 - <% end %>  
16 - </div>  
17 - <p class="highlights-block-footer"></p>  
18 - <script type="text/javascript">  
19 - (function($) {  
20 - $.fn.cycle.transitions.customFade = function($cont, $slides, opts) {  
21 - $slides.not(":eq(" + opts.currSlide + ")").css("opacity", 0);  
22 - opts.before.push(function(curr, next, opts) {  
23 - $.fn.cycle.commonReset(curr, next, opts);  
24 - opts.cssBefore.opacity = 0;  
25 - });  
26 - opts.animIn = {  
27 - opacity: 1  
28 - };  
29 - opts.animOut = {  
30 - opacity: 0  
31 - };  
32 - opts.cssBefore = {  
33 - top: 0,  
34 - left: 0,  
35 - zIndex: 1,  
36 - display: 'block'  
37 - };  
38 - opts.cssAfter = {  
39 - zIndex: 0  
40 - };  
41 - };  
42 - var options = {  
43 - fx: 'customFade',  
44 - fastOnEvent: 1,  
45 - timeout: <%= block.interval * 1000 %>  
46 - };  
47 - <% if block.navigation %>  
48 - options.pager = '#block-<%= block.id %> .highlights-block-pager';  
49 - <% end %>  
50 - $('#block-<%= block.id %> .highlights-container').cycle(options);  
51 - })(jQuery);  
52 - </script>  
53 -<% else %>  
54 - <em><%= _('Please, edit this block and choose some images') %></em>  
55 -<% end %>  
app/views/blocks/login_block.html.erb 0 → 100644
@@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
  1 +<div class="logged-user-info" style='display: none;'>
  2 + <h2><%= _('Logged in as %s') % '{login}' %></h2>
  3 + <ul>
  4 + <li><%= _('User since {year}/{month}') %></li>
  5 + <li><%= link_to _('Homepage'), '/{login}' %></li>
  6 + </ul>
  7 + <div class="user-actions">
  8 + <%= link_to content_tag('span', _('Logout')), { :controller => 'account', :action => 'logout' }, :class => 'button with-text icon-menu-logout' %>
  9 + </div>
  10 +</div>
  11 +<div class='not-logged-user' style='display: none;'>
  12 + <%= render :file => 'account/login_block' %>
  13 +</div>
app/views/blocks/login_block.rhtml
@@ -1,13 +0,0 @@ @@ -1,13 +0,0 @@
1 -<div class="logged-user-info" style='display: none;'>  
2 - <h2><%= _('Logged in as %s') % '{login}' %></h2>  
3 - <ul>  
4 - <li><%= _('User since {year}/{month}') %></li>  
5 - <li><%= link_to _('Homepage'), '/{login}' %></li>  
6 - </ul>  
7 - <div class="user-actions">  
8 - <%= link_to content_tag('span', _('Logout')), { :controller => 'account', :action => 'logout' }, :class => 'button with-text icon-menu-logout' %>  
9 - </div>  
10 -</div>  
11 -<div class='not-logged-user' style='display: none;'>  
12 - <%= render :file => 'account/login_block' %>  
13 -</div>  
app/views/blocks/my_network.html.erb 0 → 100644
@@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
  1 +<%= block_title(title) %>
  2 +
  3 +<%= render :file => 'blocks/my_network/' + owner.class.name.underscore, :locals => { :owner => owner } %>
  4 +
  5 +<ul>
  6 + <li><%= link_to(__('Homepage'), owner.url, :class => 'url') %></li>
  7 + <li><%= link_to(_('View profile'), owner.public_profile_url) %></li>
  8 + <% if !user.nil? and owner.organization? and user.has_permission?('edit_profile', profile) %>
  9 + <li><%= link_to _('Control panel'), :controller => 'profile_editor', :profile => profile.identifier %></li>
  10 + <% end %>
  11 +</ul>
  12 +
  13 +<div class="my-network-actions">
  14 + <%= render :file => 'blocks/profile_info_actions/' + owner.class.name.underscore %>
  15 +</div>
app/views/blocks/my_network.rhtml
@@ -1,15 +0,0 @@ @@ -1,15 +0,0 @@
1 -<%= block_title(title) %>  
2 -  
3 -<%= render :file => 'blocks/my_network/' + owner.class.name.underscore, :locals => { :owner => owner } %>  
4 -  
5 -<ul>  
6 - <li><%= link_to(__('Homepage'), owner.url, :class => 'url') %></li>  
7 - <li><%= link_to(_('View profile'), owner.public_profile_url) %></li>  
8 - <% if !user.nil? and owner.organization? and user.has_permission?('edit_profile', profile) %>  
9 - <li><%= link_to _('Control panel'), :controller => 'profile_editor', :profile => profile.identifier %></li>  
10 - <% end %>  
11 -</ul>  
12 -  
13 -<div class="my-network-actions">  
14 - <%= render :file => 'blocks/profile_info_actions/' + owner.class.name.underscore %>  
15 -</div>  
app/views/blocks/my_network/community.html.erb 0 → 100644
@@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
  1 +<ul>
  2 + <li><%= link_to(n_( 'One article published', '%s articles published', owner.articles.count) %
  3 + content_tag('b', owner.articles.count), owner.public_profile_url.merge(:action => 'sitemap') ) %></li>
  4 + <% members = owner.members.size %>
  5 + <li><%= link_to(n_( 'One member', '%s members', members) %
  6 + content_tag('b', members), owner.public_profile_url.merge(:action => 'members') ) %></li>
  7 + <li><%= link_to(n_('One tag', '%s tags', owner.article_tags.size) %
  8 + content_tag('b', owner.article_tags.size), owner.public_profile_url.merge(:action => 'tags')) %></li>
  9 +</ul>
app/views/blocks/my_network/community.rhtml
@@ -1,9 +0,0 @@ @@ -1,9 +0,0 @@
1 -<ul>  
2 - <li><%= link_to(n_( 'One article published', '%s articles published', owner.articles.count) %  
3 - content_tag('b', owner.articles.count), owner.public_profile_url.merge(:action => 'sitemap') ) %></li>  
4 - <% members = owner.members.size %>  
5 - <li><%= link_to(n_( 'One member', '%s members', members) %  
6 - content_tag('b', members), owner.public_profile_url.merge(:action => 'members') ) %></li>  
7 - <li><%= link_to(n_('One tag', '%s tags', owner.article_tags.size) %  
8 - content_tag('b', owner.article_tags.size), owner.public_profile_url.merge(:action => 'tags')) %></li>  
9 -</ul>  
app/views/blocks/my_network/enterprise.html.erb 0 → 100644
app/views/blocks/my_network/enterprise.rhtml
app/views/blocks/my_network/organization.html.erb 0 → 100644
app/views/blocks/my_network/organization.rhtml
app/views/blocks/my_network/person.html.erb 0 → 100644
@@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
  1 +<ul>
  2 + <li><%= link_to(n_( 'One article published', '%s articles published', owner.articles.count) %
  3 + content_tag('b', owner.articles.count), owner.public_profile_url.merge(:action => 'sitemap') ) %></li>
  4 + <li><%= link_to(n__('One friend', '%s friends', owner.friends.count) %
  5 + content_tag('b', owner.friends.count), owner.public_profile_url.merge(:action => 'friends')) %></li>
  6 + <li><%= link_to(n__('One community', '%{num} communities', owner.communities.visible.size) %
  7 + {:num => content_tag('b', owner.communities.visible.size)}, owner.public_profile_url.merge(:action => 'communities')) %></li>
  8 + <li><%= link_to(n_('One tag', '%s tags', owner.article_tags.size) %
  9 + content_tag('b', owner.article_tags.size), owner.public_profile_url.merge(:action => 'tags')) %></li>
  10 +</ul>
app/views/blocks/my_network/person.rhtml
@@ -1,10 +0,0 @@ @@ -1,10 +0,0 @@
1 -<ul>  
2 - <li><%= link_to(n_( 'One article published', '%s articles published', owner.articles.count) %  
3 - content_tag('b', owner.articles.count), owner.public_profile_url.merge(:action => 'sitemap') ) %></li>  
4 - <li><%= link_to(n__('One friend', '%s friends', owner.friends.count) %  
5 - content_tag('b', owner.friends.count), owner.public_profile_url.merge(:action => 'friends')) %></li>  
6 - <li><%= link_to(n__('One community', '%{num} communities', owner.communities.visible.size) %  
7 - {:num => content_tag('b', owner.communities.visible.size)}, owner.public_profile_url.merge(:action => 'communities')) %></li>  
8 - <li><%= link_to(n_('One tag', '%s tags', owner.article_tags.size) %  
9 - content_tag('b', owner.article_tags.size), owner.public_profile_url.merge(:action => 'tags')) %></li>  
10 -</ul>  
app/views/blocks/profile_image.html.erb 0 → 100644
@@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
  1 +<div class="vcard">
  2 +
  3 +<p><%= block.title %></p>
  4 +
  5 +<div class="profile-big-image">
  6 + <div class="profile-big-image-inner1">
  7 + <span class="profile-big-image-inner2">
  8 + <%= link_to profile_image(block.owner, :big) +"\n", profile.url %>
  9 + </span>
  10 + </div>
  11 +</div>
  12 +
  13 +<% if show_name %>
  14 + <p><%= h block.owner.short_name %></p>
  15 +<% end %>
  16 +
  17 +<div style="text-align: center; font-size: 75%; clear: both" id="profile-admin-url-<%= block.id %>"></div>
  18 +
  19 +<div class="profile-info-options" id="profile-info-options-<%= block.id %>"></div>
  20 +
  21 +</div><!-- end class="vcard" -->
  22 +<script type="text/javascript">
  23 + <%= remote_function :url => { :controller => 'profile', :profile => profile.identifier, :action => 'profile_info', :block_id => block.id } %>
  24 +</script>
app/views/blocks/profile_image.rhtml
@@ -1,24 +0,0 @@ @@ -1,24 +0,0 @@
1 -<div class="vcard">  
2 -  
3 -<p><%= block.title %></p>  
4 -  
5 -<div class="profile-big-image">  
6 - <div class="profile-big-image-inner1">  
7 - <span class="profile-big-image-inner2">  
8 - <%= link_to profile_image(block.owner, :big) +"\n", profile.url %>  
9 - </span>  
10 - </div>  
11 -</div>  
12 -  
13 -<% if show_name %>  
14 - <p><%= h block.owner.short_name %></p>  
15 -<% end %>  
16 -  
17 -<div style="text-align: center; font-size: 75%; clear: both" id="profile-admin-url-<%= block.id %>"></div>  
18 -  
19 -<div class="profile-info-options" id="profile-info-options-<%= block.id %>"></div>  
20 -  
21 -</div><!-- end class="vcard" -->  
22 -<script type="text/javascript">  
23 - <%= remote_function :url => { :controller => 'profile', :profile => profile.identifier, :action => 'profile_info', :block_id => block.id } %>  
24 -</script>  
app/views/blocks/profile_info.html.erb 0 → 100644
@@ -0,0 +1,45 @@ @@ -0,0 +1,45 @@
  1 +<div class="vcard">
  2 +
  3 +<h2 class="<%= profile.class == Person ? 'fn' : 'org' %>"><%= h block.owner.short_name %></h2>
  4 +
  5 +<div class="profile-info-picture">
  6 + <div class="profile-info-picture-inner1">
  7 + <span class="profile-info-picture-inner2">
  8 + <%=
  9 + profile_image(block.owner, :thumb) +"\n"+
  10 + profile_sex_icon( profile ) +
  11 + profile_cat_icons( profile )
  12 + %>
  13 + </span>
  14 + </div>
  15 +</div>
  16 +
  17 +<ul class="profile-info-data" id="profile-info-data-<%= block.id %>">
  18 + <li><%= link_to __('Homepage'), block.owner.url, :class => 'url' %></li>
  19 + <li><%= link_to _('View profile'), block.owner.public_profile_url %></li>
  20 + <% if block.owner.enterprise? && !block.owner.environment.enabled?('disable_products_for_enterprises') %>
  21 + <li><%= link_to(_('Products/Services'), :controller => 'catalog', :profile => block.owner.identifier) %></li>
  22 + <% end %>
  23 + <li id="profile-admin-url-<%= block.id %>"></li>
  24 + <% if profile.person? %>
  25 + <li><%= _('Since %{year}/%{month}') % { :year => block.owner.created_at.year, :month => block.owner.created_at.month } %></li>
  26 + <% end %>
  27 +</ul>
  28 +
  29 +<% if profile.respond_to? :city %>
  30 +<div class="adr">
  31 +<%=
  32 + [ [ profile.city, 'locality' ],
  33 + [ profile.state, 'region' ],
  34 + [ profile.country_name, 'country-name' ]
  35 + ].map{ |s,c| s =~ /^\s*$/ ? nil : content_tag( 'span', s, :class => c ) }.compact.join ' - '
  36 +%>
  37 +</div>
  38 +<% end %>
  39 +
  40 +<div class="profile-info-options" id="profile-info-options-<%= block.id %>"></div>
  41 +
  42 +</div><!-- end class="vcard" -->
  43 +<script type="text/javascript">
  44 + <%= remote_function :url => { :controller => 'profile', :profile => profile.identifier, :action => 'profile_info', :block_id => block.id } %>
  45 +</script>
app/views/blocks/profile_info.rhtml
@@ -1,45 +0,0 @@ @@ -1,45 +0,0 @@
1 -<div class="vcard">  
2 -  
3 -<h2 class="<%= profile.class == Person ? 'fn' : 'org' %>"><%= h block.owner.short_name %></h2>  
4 -  
5 -<div class="profile-info-picture">  
6 - <div class="profile-info-picture-inner1">  
7 - <span class="profile-info-picture-inner2">  
8 - <%=  
9 - profile_image(block.owner, :thumb) +"\n"+  
10 - profile_sex_icon( profile ) +  
11 - profile_cat_icons( profile )  
12 - %>  
13 - </span>  
14 - </div>  
15 -</div>  
16 -  
17 -<ul class="profile-info-data" id="profile-info-data-<%= block.id %>">  
18 - <li><%= link_to __('Homepage'), block.owner.url, :class => 'url' %></li>  
19 - <li><%= link_to _('View profile'), block.owner.public_profile_url %></li>  
20 - <% if block.owner.enterprise? && !block.owner.environment.enabled?('disable_products_for_enterprises') %>  
21 - <li><%= link_to(_('Products/Services'), :controller => 'catalog', :profile => block.owner.identifier) %></li>  
22 - <% end %>  
23 - <li id="profile-admin-url-<%= block.id %>"></li>  
24 - <% if profile.person? %>  
25 - <li><%= _('Since %{year}/%{month}') % { :year => block.owner.created_at.year, :month => block.owner.created_at.month } %></li>  
26 - <% end %>  
27 -</ul>  
28 -  
29 -<% if profile.respond_to? :city %>  
30 -<div class="adr">  
31 -<%=  
32 - [ [ profile.city, 'locality' ],  
33 - [ profile.state, 'region' ],  
34 - [ profile.country_name, 'country-name' ]  
35 - ].map{ |s,c| s =~ /^\s*$/ ? nil : content_tag( 'span', s, :class => c ) }.compact.join ' - '  
36 -%>  
37 -</div>  
38 -<% end %>  
39 -  
40 -<div class="profile-info-options" id="profile-info-options-<%= block.id %>"></div>  
41 -  
42 -</div><!-- end class="vcard" -->  
43 -<script type="text/javascript">  
44 - <%= remote_function :url => { :controller => 'profile', :profile => profile.identifier, :action => 'profile_info', :block_id => block.id } %>  
45 -</script>  
app/views/blocks/profile_info_actions/community.html.erb 0 → 100644
@@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
  1 +<ul>
  2 + <% if logged_in? %>
  3 + <% if profile.members.include?(user) %>
  4 + <li>
  5 + <%= button(:delete, content_tag('span', __('Leave community')), profile.leave_url,
  6 + :class => 'leave-community',
  7 + :title => _("Leave community"),
  8 + :style => 'position: relative;') %>
  9 + <%= button(:add, content_tag('span', __('Join')), profile.join_url,
  10 + :class => 'join-community',
  11 + :title => _("Join community"),
  12 + :style => 'position: relative; display: none;') %>
  13 + </li>
  14 + <% else %>
  15 + <% unless profile.already_request_membership?(user) %>
  16 + <li>
  17 + <%= button(:delete, content_tag('span', __('Leave community')), profile.leave_url,
  18 + :class => 'leave-community',
  19 + :title => _("Leave community"),
  20 + :style => 'position: relative; display: none;') %>
  21 + <%= button(:add, content_tag('span', __('Join')), profile.join_url,
  22 + :class => 'join-community',
  23 + :title => _("Join community"),
  24 + :style => 'position: relative;') %>
  25 + </li>
  26 + <% end %>
  27 + <% end %>
  28 +
  29 + <% if profile.enable_contact? %>
  30 + <li>
  31 + <%= link_to content_tag('span', _('Send an e-mail')),
  32 + { :profile => profile.identifier,
  33 + :controller => 'contact',
  34 + :action => 'new' },
  35 + {:class => 'button with-text icon-menu-mail', :title => _('Send an e-mail to the administrators')} %>
  36 + </li>
  37 + <% end %>
  38 +
  39 + <li><%= report_abuse(profile, :button) %></li>
  40 +
  41 + <%= render_environment_features(:profile_actions) %>
  42 + <% else %>
  43 + <li>
  44 + <%= link_to content_tag('span', _('Join')), profile.join_not_logged_url,
  45 + :class => 'button with-text icon-add',
  46 + :title => _('Join this community') %>
  47 + </li>
  48 + <% end %>
  49 +</ul>
app/views/blocks/profile_info_actions/community.rhtml
@@ -1,49 +0,0 @@ @@ -1,49 +0,0 @@
1 -<ul>  
2 - <% if logged_in? %>  
3 - <% if profile.members.include?(user) %>  
4 - <li>  
5 - <%= button(:delete, content_tag('span', __('Leave community')), profile.leave_url,  
6 - :class => 'leave-community',  
7 - :title => _("Leave community"),  
8 - :style => 'position: relative;') %>  
9 - <%= button(:add, content_tag('span', __('Join')), profile.join_url,  
10 - :class => 'join-community',  
11 - :title => _("Join community"),  
12 - :style => 'position: relative; display: none;') %>  
13 - </li>  
14 - <% else %>  
15 - <% unless profile.already_request_membership?(user) %>  
16 - <li>  
17 - <%= button(:delete, content_tag('span', __('Leave community')), profile.leave_url,  
18 - :class => 'leave-community',  
19 - :title => _("Leave community"),  
20 - :style => 'position: relative; display: none;') %>  
21 - <%= button(:add, content_tag('span', __('Join')), profile.join_url,  
22 - :class => 'join-community',  
23 - :title => _("Join community"),  
24 - :style => 'position: relative;') %>  
25 - </li>  
26 - <% end %>  
27 - <% end %>  
28 -  
29 - <% if profile.enable_contact? %>  
30 - <li>  
31 - <%= link_to content_tag('span', _('Send an e-mail')),  
32 - { :profile => profile.identifier,  
33 - :controller => 'contact',  
34 - :action => 'new' },  
35 - {:class => 'button with-text icon-menu-mail', :title => _('Send an e-mail to the administrators')} %>  
36 - </li>  
37 - <% end %>  
38 -  
39 - <li><%= report_abuse(profile, :button) %></li>  
40 -  
41 - <%= render_environment_features(:profile_actions) %>  
42 - <% else %>  
43 - <li>  
44 - <%= link_to content_tag('span', _('Join')), profile.join_not_logged_url,  
45 - :class => 'button with-text icon-add',  
46 - :title => _('Join this community') %>  
47 - </li>  
48 - <% end %>  
49 -</ul>  
app/views/blocks/profile_info_actions/enterprise.html.erb 0 → 100644
@@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
  1 +<ul>
  2 + <%if logged_in? %>
  3 + <%if !user.favorite_enterprises.include?(profile) %>
  4 + <li><%= link_to content_tag('span', _('Add as favorite')), { :profile => user.identifier, :controller => 'favorite_enterprises', :action => 'add', :id => profile.id }, :class => 'button with-text icon-add', :title => __('Add enterprise as favorite') %></li>
  5 + <% end %>
  6 + <% end %>
  7 + <% if profile.enable_contact? %>
  8 + <li> <%= link_to content_tag('span', _('Send an e-mail')), {:profile => profile.identifier, :controller => 'contact', :action => 'new'}, {:id => 'enterprise-contact-button', :class => 'button with-text icon-menu-mail'} %> </li>
  9 + <% end %>
  10 +
  11 + <li><%= report_abuse(profile, :button) %></li>
  12 +</ul>
app/views/blocks/profile_info_actions/enterprise.rhtml
@@ -1,12 +0,0 @@ @@ -1,12 +0,0 @@
1 -<ul>  
2 - <%if logged_in? %>  
3 - <%if !user.favorite_enterprises.include?(profile) %>  
4 - <li><%= link_to content_tag('span', _('Add as favorite')), { :profile => user.identifier, :controller => 'favorite_enterprises', :action => 'add', :id => profile.id }, :class => 'button with-text icon-add', :title => __('Add enterprise as favorite') %></li>  
5 - <% end %>  
6 - <% end %>  
7 - <% if profile.enable_contact? %>  
8 - <li> <%= link_to content_tag('span', _('Send an e-mail')), {:profile => profile.identifier, :controller => 'contact', :action => 'new'}, {:id => 'enterprise-contact-button', :class => 'button with-text icon-menu-mail'} %> </li>  
9 - <% end %>  
10 -  
11 - <li><%= report_abuse(profile, :button) %></li>  
12 -</ul>  
app/views/blocks/profile_info_actions/organization.html.erb 0 → 100644
app/views/blocks/profile_info_actions/organization.rhtml
app/views/blocks/profile_info_actions/person.html.erb 0 → 100644
@@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
  1 +<ul>
  2 + <%if logged_in? && (user != profile) %>
  3 +
  4 + <% if !user.already_request_friendship?(profile) and !user.is_a_friend?(profile) %>
  5 + <li>
  6 + <%= button(:add, content_tag('span', __('Add friend')), profile.add_url, :class => 'add-friend', :title => _("Add friend"), :style => 'position: relative;') %>
  7 + </li>
  8 + <% end %>
  9 +
  10 + <% if user.is_a_friend?(profile) && profile.enable_contact? %>
  11 + <li> <%= link_to content_tag('span', _('Send an e-mail')), {:profile => profile.identifier, :controller => 'contact', :action => 'new'}, :class => 'button with-text icon-menu-mail' %> </li>
  12 + <% end %>
  13 +
  14 + <li><%= report_abuse(profile, :button) %></li>
  15 + <% end %>
  16 +</ul>
app/views/blocks/profile_info_actions/person.rhtml
@@ -1,16 +0,0 @@ @@ -1,16 +0,0 @@
1 -<ul>  
2 - <%if logged_in? && (user != profile) %>  
3 -  
4 - <% if !user.already_request_friendship?(profile) and !user.is_a_friend?(profile) %>  
5 - <li>  
6 - <%= button(:add, content_tag('span', __('Add friend')), profile.add_url, :class => 'add-friend', :title => _("Add friend"), :style => 'position: relative;') %>  
7 - </li>  
8 - <% end %>  
9 -  
10 - <% if user.is_a_friend?(profile) && profile.enable_contact? %>  
11 - <li> <%= link_to content_tag('span', _('Send an e-mail')), {:profile => profile.identifier, :controller => 'contact', :action => 'new'}, :class => 'button with-text icon-menu-mail' %> </li>  
12 - <% end %>  
13 -  
14 - <li><%= report_abuse(profile, :button) %></li>  
15 - <% end %>  
16 -</ul>  
app/views/blocks/profile_search.html.erb 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +<%= block_title(title) %>
  2 +
  3 +<%= render :partial => 'shared/profile_search_form' %>
app/views/blocks/profile_search.rhtml
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -<%= block_title(title) %>  
2 -  
3 -<%= render :partial => 'shared/profile_search_form' %>  
app/views/blocks/slideshow.html.erb 0 → 100644
@@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
  1 +<%= block_title(block.title) %>
  2 +<% if images %>
  3 + <% description = images.any? { |img| !img.abstract.blank? } %>
  4 + <div class='slideshow-border<%= (description ? ' with-descriptions' : '')%>'>
  5 + <div class='slideshow-container'>
  6 + <% images.each do |img| %>
  7 + <a href="<%= url_for(img.external_link.blank? ? img.view_url: img.external_link) %>">
  8 + <%= content_tag('div', '', :style => "background-image: url(#{block.public_filename_for(img)})", :title => (img.abstract.blank? ? '' : img.abstract)) %>
  9 + <% if !img.abstract.blank? %>
  10 + <span class='image-description'><%= img.abstract %></span>
  11 + <% end %>
  12 + </a>
  13 + <% end %>
  14 + </div>
  15 + <% if block.navigation %>
  16 + <div class='slideshow-block-navigation'>
  17 + <%= link_to _('Previous'), '#', :class => 'icon-media-prev' %>
  18 + <% if block.interval > 0 %>
  19 + <%= link_to '&nbsp;', '#', :class => 'icon-media-pause', :onclick => "togglePlayback('#block-#{block.id} .slideshow-container', this); return false;" %>
  20 + <% end %>
  21 + <%= link_to _('Next'), '#', :class => 'icon-media-next' %>
  22 + </div>
  23 + <% end %>
  24 + </div>
  25 + <script type="text/javascript">
  26 + (function($) {
  27 + var options = {fx: 'fade', pause: 1, fastOnEvent: 1, timeout: <%= block.interval * 1000 %>};
  28 + <% if block.navigation %>
  29 + options.prev = '#block-<%= block.id %> .icon-media-prev';
  30 + options.next = '#block-<%= block.id %> .icon-media-next';
  31 + <% end %>
  32 + $('#block-<%= block.id %> .slideshow-container').cycle(options);
  33 + })(jQuery);
  34 +
  35 + function togglePlayback(slideshow, button) {
  36 + var $ = jQuery;
  37 + if (button.className == 'icon-media-pause') {
  38 + button.className = 'icon-media-play';
  39 + $(slideshow).cycle('pause');
  40 + } else {
  41 + button.className = 'icon-media-pause';
  42 + $(slideshow).cycle('resume');
  43 + }
  44 + }
  45 + </script>
  46 +<% else %>
  47 + <em><%= _('Please, edit this block and select an image gallery.') %></em>
  48 +<% end %>
  49 +
app/views/blocks/slideshow.rhtml
@@ -1,49 +0,0 @@ @@ -1,49 +0,0 @@
1 -<%= block_title(block.title) %>  
2 -<% if images %>  
3 - <% description = images.any? { |img| !img.abstract.blank? } %>  
4 - <div class='slideshow-border<%= (description ? ' with-descriptions' : '')%>'>  
5 - <div class='slideshow-container'>  
6 - <% images.each do |img| %>  
7 - <a href="<%= url_for(img.external_link.blank? ? img.view_url: img.external_link) %>">  
8 - <%= content_tag('div', '', :style => "background-image: url(#{block.public_filename_for(img)})", :title => (img.abstract.blank? ? '' : img.abstract)) %>  
9 - <% if !img.abstract.blank? %>  
10 - <span class='image-description'><%= img.abstract %></span>  
11 - <% end %>  
12 - </a>  
13 - <% end %>  
14 - </div>  
15 - <% if block.navigation %>  
16 - <div class='slideshow-block-navigation'>  
17 - <%= link_to _('Previous'), '#', :class => 'icon-media-prev' %>  
18 - <% if block.interval > 0 %>  
19 - <%= link_to '&nbsp;', '#', :class => 'icon-media-pause', :onclick => "togglePlayback('#block-#{block.id} .slideshow-container', this); return false;" %>  
20 - <% end %>  
21 - <%= link_to _('Next'), '#', :class => 'icon-media-next' %>  
22 - </div>  
23 - <% end %>  
24 - </div>  
25 - <script type="text/javascript">  
26 - (function($) {  
27 - var options = {fx: 'fade', pause: 1, fastOnEvent: 1, timeout: <%= block.interval * 1000 %>};  
28 - <% if block.navigation %>  
29 - options.prev = '#block-<%= block.id %> .icon-media-prev';  
30 - options.next = '#block-<%= block.id %> .icon-media-next';  
31 - <% end %>  
32 - $('#block-<%= block.id %> .slideshow-container').cycle(options);  
33 - })(jQuery);  
34 -  
35 - function togglePlayback(slideshow, button) {  
36 - var $ = jQuery;  
37 - if (button.className == 'icon-media-pause') {  
38 - button.className = 'icon-media-play';  
39 - $(slideshow).cycle('pause');  
40 - } else {  
41 - button.className = 'icon-media-pause';  
42 - $(slideshow).cycle('resume');  
43 - }  
44 - }  
45 - </script>  
46 -<% else %>  
47 - <em><%= _('Please, edit this block and select an image gallery.') %></em>  
48 -<% end %>  
49 -