From 8369fef112648bc23a04ba02da65050ddbee953c Mon Sep 17 00:00:00 2001
From: Jan Schulz-Hofen <%= l(:text_no_account_question)%> <%= link_to l(:label_register), :register %> <%= t :label_register_to_add_issue_html, register_to: link_to(l(:label_register_to), register_path) %> <%= t :label_register_to_edit_issue_html, register_to: link_to(l(:label_register_to), register_path) %> <%= toggle_link l(:button_reply), "reply", :focus => 'message_content', :scroll => "message_content" %> <%= t :label_register_to_add_message_html, register_to: link_to(l(:label_register_to), register_path) %> <%= t :label_register_to_add_message_html, register_to: link_to(l(:label_register_to), register_path) %> <%= submit_tag l(:button_add) %> <%= t :label_register_to_comment_html, register_to: link_to(l(:label_register_to), register_path) %><%= l(:label_reply_plural) %> (<%= @reply_count %>)
-<% if !@topic.locked? && authorize_for('messages', 'reply') && @replies.size >= 3 %>
+<% if @replies.size >= 3 %>
+<% if !@topic.locked? && authorize_for('messages', 'reply') %>
+ <%= setting_check_box :enable_registration_cta, + :disabled => !Setting.self_registration? %> + <%= l(:text_enable_registration_cta) %> +
<%= setting_check_box :show_custom_fields_on_registration, :disabled => !Setting.self_registration? %>
diff --git a/config/locales/de.yml b/config/locales/de.yml index 8781e9f..63a5205 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -697,6 +697,11 @@ de: label_read: Lesen... label_readonly: Nur-Lese-Zugriff label_register: Registrieren + label_register_to: registrieren Sie sich + label_register_to_comment_html: Bitte %{register_to}, um einen Kommentar hinzuzufügen + label_register_to_add_message_html: Bitte %{register_to}, um zu antworten + label_register_to_edit_issue_html: Bitte %{register_to}, um das Ticket zu bearbeiten + label_register_to_add_issue_html: Bitte %{register_to}, um ein Ticket hinzuzufügen label_registered_on: Angemeldet am label_registration_activation_by_email: Kontoaktivierung durch E-Mail label_registration_automatic_activation: Automatische Kontoaktivierung @@ -1039,6 +1044,7 @@ de: setting_rest_api_enabled: REST-Schnittstelle aktivieren setting_self_registration: Registrierung ermöglichen setting_show_custom_fields_on_registration: Benutzerdefinierte Felder bei der Registrierung abfragen + setting_enable_registration_cta: Aktiviere Registerungsaufforderungen setting_sequential_project_identifiers: Fortlaufende Projektkennungen generieren setting_session_lifetime: Längste Dauer einer Sitzung setting_session_timeout: Zeitüberschreitung bei Inaktivität @@ -1062,6 +1068,8 @@ de: text_assign_time_entries_to_project: Gebuchte Aufwände dem Projekt zuweisen text_caracters_maximum: "Max. %{count} Zeichen." text_caracters_minimum: "Muss mindestens %{count} Zeichen lang sein." + text_enable_registration_cta: Zeigt Links zum Registrierungsformular wo möglich + text_no_account_question: Noch kein Benutzerkonto? text_comma_separated: Mehrere Werte erlaubt (durch Komma getrennt). text_convert_available: ImageMagick-Konvertierung verfügbar (optional) text_custom_field_possible_values_info: 'Eine Zeile pro Wert' diff --git a/config/locales/en.yml b/config/locales/en.yml index 54eb127..58f5fd2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -372,6 +372,7 @@ en: setting_default_language: Default language setting_login_required: Authentication required setting_self_registration: Self-registration + setting_enable_registration_cta: Enable registration call to action setting_show_custom_fields_on_registration: Show custom fields on registration setting_attachment_max_size: Maximum attachment size setting_issues_export_limit: Issues export limit @@ -583,6 +584,11 @@ en: label_information_plural: Information label_please_login: Please log in label_register: Register + label_register_to: register + label_register_to_comment_html: Please %{register_to} to add a comment + label_register_to_add_message_html: Please %{register_to} to reply + label_register_to_edit_issue_html: Please %{register_to} to edit this issue + label_register_to_add_issue_html: Please %{register_to} to add an issue label_login_with_open_id_option: or login with OpenID label_password_lost: Lost password label_password_required: Confirm your password to continue @@ -1094,6 +1100,8 @@ en: text_length_between: "Length between %{min} and %{max} characters." text_tracker_no_workflow: No workflow defined for this tracker text_unallowed_characters: Unallowed characters + text_enable_registration_cta: Show links to registration form where possible + text_no_account_question: No account yet? text_comma_separated: Multiple values allowed (comma separated). text_line_separated: Multiple values allowed (one line for each value). text_issues_ref_in_commit_messages: Referencing and fixing issues in commit messages diff --git a/config/settings.yml b/config/settings.yml index 7f70a17..e66d5e8 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -31,6 +31,8 @@ login_required: self_registration: default: '2' security_notifications: 1 +enable_registration_cta: + default: 0 show_custom_fields_on_registration: default: 1 lost_password: diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 44100fe..63460c7 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -714,6 +714,7 @@ p.other-formats { text-align: right; font-size:0.9em; color: #666; } .other-formats span + span:before { content: "| "; } a.atom { background: url(../images/feed.png) no-repeat 1px 50%; padding: 2px 0px 3px 16px; } +p.registration-cta { background: url(../images/user.png) no-repeat 1px 50%; padding: 2px 0px 3px 20px; } em.info {font-style:normal;font-size:90%;color:#888;display:block;} em.info.error {padding-left:20px; background:url(../images/exclamation.png) no-repeat 0 50%;} -- 2.7.2
<%= l(:label_comment_plural) %>
-<% if @news.commentable? && @comments.size >= 3 %> +<% if @comments.size >= 3 %> +<% if @news.commentable? %><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments", :scroll => "comment_comments" %>
+<% elsif show_registration_cta? :comment_news, @project %> +<%= t :label_register_to_comment_html, register_to: link_to(l(:label_register_to), register_path) %>
+<% end %> <% end %> <% @comments.each do |comment| %> <% next if comment.new_record? %> @@ -60,6 +64,8 @@