Feature #24089 » 0003-Adds-registration-CTA-links-to-relevant-places.patch
| app/helpers/application_helper.rb | ||
|---|---|---|
|
content_for?(:sidebar) || view_layouts_base_sidebar_hook_response.present?
|
||
|
end
|
||
|
def show_registration_cta?(action=nil, context=nil, options={})
|
||
|
return false if User.current.logged? or !Setting.self_registration? or !Setting.enable_registration_cta?
|
||
|
return true if action.blank? and context.blank? and options.blank?
|
||
|
return User.new.allowed_to?(action, context, options)
|
||
|
end
|
||
|
def view_layouts_base_sidebar_hook_response
|
||
|
@view_layouts_base_sidebar_hook_response ||= call_hook(:view_layouts_base_sidebar)
|
||
|
end
|
||
| app/views/account/login.html.erb | ||
|---|---|---|
|
|
||
|
<input type="submit" name="login" value="<%=l(:button_login)%>" tabindex="5" id="login-submit" />
|
||
|
<% end %>
|
||
|
<% if show_registration_cta? %>
|
||
|
<p class="registration-cta"><%= l(:text_no_account_question)%> <%= link_to l(:label_register), :register %></p>
|
||
|
<% end %>
|
||
|
</div>
|
||
|
<%= call_hook :view_account_login_bottom %>
|
||
| app/views/issues/index.html.erb | ||
|---|---|---|
|
<div class="contextual">
|
||
|
<% if User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || Issue.allowed_target_trackers(@project).any?) %>
|
||
|
<% if allowed_to_add_issues = (User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || Issue.allowed_target_trackers(@project).any?)) %>
|
||
|
<%= link_to l(:label_issue_new), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %>
|
||
|
<% end %>
|
||
|
</div>
|
||
| ... | ... | |
|
<% end %>
|
||
|
<%= call_hook(:view_issues_index_bottom, { :issues => @issues, :project => @project, :query => @query }) %>
|
||
|
<% if !allowed_to_add_issues && show_registration_cta?(:add_issues, @project, :global => true) %>
|
||
|
<p class="registration-cta"><%= t :label_register_to_add_issue_html, register_to: link_to(l(:label_register_to), register_path) %></p>
|
||
|
<% end %>
|
||
|
<% content_for :sidebar do %>
|
||
|
<%= render :partial => 'issues/sidebar' %>
|
||
|
<% end %>
|
||
| app/views/issues/show.html.erb | ||
|---|---|---|
|
</div>
|
||
|
<% end %>
|
||
|
<% if !@issue.editable? && show_registration_cta? &&
|
||
|
(User.new.allowed_to?(:edit_issues, @project) || User.new.allowed_to?(:add_issue_notes, @project)) %>
|
||
|
<p class="registration-cta"><%= t :label_register_to_edit_issue_html, register_to: link_to(l(:label_register_to), register_path) %></p>
|
||
|
<% end %>
|
||
|
<div style="clear: both;"></div>
|
||
|
<%= render :partial => 'action_menu' %>
|
||
| app/views/messages/show.html.erb | ||
|---|---|---|
|
<% unless @replies.empty? %>
|
||
|
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
|
||
|
<% if !@topic.locked? && authorize_for('messages', 'reply') && @replies.size >= 3 %>
|
||
|
<% if @replies.size >= 3 %>
|
||
|
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
|
||
|
<p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content', :scroll => "message_content" %></p>
|
||
|
<% elsif show_registration_cta? :add_messages, @project %>
|
||
|
<p class="registration-cta"><%= t :label_register_to_add_message_html, register_to: link_to(l(:label_register_to), register_path) %></p>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
<% @replies.each do |message| %>
|
||
|
<div class="message reply" id="<%= "message-#{message.id}" %>">
|
||
| ... | ... | |
|
<% end %>
|
||
|
<div id="preview" class="wiki"></div>
|
||
|
</div>
|
||
|
<% elsif show_registration_cta? :add_messages, @project %>
|
||
|
<p class="registration-cta"><%= t :label_register_to_add_message_html, register_to: link_to(l(:label_register_to), register_path) %></p>
|
||
|
<% end %>
|
||
|
<% html_title @topic.subject %>
|
||
| app/views/news/show.html.erb | ||
|---|---|---|
|
<div id="comments" style="margin-bottom:16px;">
|
||
|
<h3 class="comments"><%= l(:label_comment_plural) %></h3>
|
||
|
<% if @news.commentable? && @comments.size >= 3 %>
|
||
|
<% if @comments.size >= 3 %>
|
||
|
<% if @news.commentable? %>
|
||
|
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments", :scroll => "comment_comments" %></p>
|
||
|
<% elsif show_registration_cta? :comment_news, @project %>
|
||
|
<p class="registration-cta"><%= t :label_register_to_comment_html, register_to: link_to(l(:label_register_to), register_path) %></p>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
<% @comments.each do |comment| %>
|
||
|
<% next if comment.new_record? %>
|
||
| ... | ... | |
|
</div>
|
||
|
<p><%= submit_tag l(:button_add) %></p>
|
||
|
<% end %>
|
||
|
<% elsif show_registration_cta? :comment_news, @project %>
|
||
|
<p class="registration-cta"><%= t :label_register_to_comment_html, register_to: link_to(l(:label_register_to), register_path) %></p>
|
||
|
<% end %>
|
||
|
<% html_title @news.title -%>
|
||
| app/views/settings/_authentication.html.erb | ||
|---|---|---|
|
[l(:label_registration_manual_activation), "2"],
|
||
|
[l(:label_registration_automatic_activation), "3"]],
|
||
|
:onchange =>
|
||
|
"if (this.value != '0') { $('#settings_show_custom_fields_on_registration').removeAttr('disabled'); } else { $('#settings_show_custom_fields_on_registration').attr('disabled', true); }" %></p>
|
||
|
"if (this.value != '0') { $('#settings_enable_registration_cta, #settings_show_custom_fields_on_registration').removeAttr('disabled'); } else { $('#settings_enable_registration_cta, #settings_show_custom_fields_on_registration').attr('disabled', true); }" %></p>
|
||
|
<p>
|
||
|
<%= setting_check_box :enable_registration_cta,
|
||
|
:disabled => !Setting.self_registration? %>
|
||
|
<em class="info"><%= l(:text_enable_registration_cta) %></em>
|
||
|
</p>
|
||
|
<p><%= setting_check_box :show_custom_fields_on_registration,
|
||
|
:disabled => !Setting.self_registration? %></p>
|
||
| config/locales/de.yml | ||
|---|---|---|
|
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
|
||
| ... | ... | |
|
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
|
||
| ... | ... | |
|
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'
|
||
| config/locales/en.yml | ||
|---|---|---|
|
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
|
||
| ... | ... | |
|
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
|
||
| ... | ... | |
|
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
|
||
| config/settings.yml | ||
|---|---|---|
|
self_registration:
|
||
|
default: '2'
|
||
|
security_notifications: 1
|
||
|
enable_registration_cta:
|
||
|
default: 0
|
||
|
show_custom_fields_on_registration:
|
||
|
default: 1
|
||
|
lost_password:
|
||
| public/stylesheets/application.css | ||
|---|---|---|
|
.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%;}
|
||