Skip to content

Commit

Permalink
cherry picked richards loomioX work
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbartlett authored and Robert Guthrie committed Feb 19, 2015
1 parent f647d94 commit 8400478
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 50 deletions.
6 changes: 1 addition & 5 deletions app/assets/stylesheets/unstructured/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@
width: 93px;
margin: 9px 0 0 10px;
height: 28px;
background: image-url("navbar-logo.png") 0 0 no-repeat;
background: 0 0 no-repeat;
}
.app-logo.beta{
background: image-url("navbar-logo-beta.jpg") 0 0 no-repeat;
}

input.group-dropdown-search {
padding: 5px;
width: 100%;
Expand Down
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class ApplicationController < ActionController::Base
include LocalesHelper
include CurrentUserHelper
include ApplicationHelper
include ReadableUnguessableUrlsHelper
include ProtectedFromForgery

Expand Down
6 changes: 5 additions & 1 deletion app/controllers/marketing_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ def index
if user_signed_in?
redirect_to dashboard_path
else
render layout: false
if show_loomio_org_marketing
render layout: false
else
redirect_to new_user_session_path
end
end
end
end
25 changes: 4 additions & 21 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#encoding: UTF-8
module ApplicationHelper

def lineman_vendorjs_path
Expand Down Expand Up @@ -127,22 +126,6 @@ def render_rich_text(text, md_boolean=true)
Redcarpet::Render::SmartyPants.render(output).html_safe
end

def show_contribution_icon?
current_user && !current_user.belongs_to_manual_subscription_group?
end

def can_ask_for_contribution?(group)
!group.has_manual_subscription? || !group.is_paying?
end

def hide_beta_logo?
current_user_or_visitor.belongs_to_manual_subscription_group?
end

def hide_crowdfunding_banner?
hide_beta_logo? || session[:hide_banner] == true
end

def visitor?
!user_signed_in?
end
Expand All @@ -155,10 +138,6 @@ def analytics_scope
end
end

def navbar_contribute
ENV["NAVBAR_CONTRIBUTE"] or "show"
end

def toggle_unread_path
options = {}
unless sifting_unread?
Expand Down Expand Up @@ -204,4 +183,8 @@ def followed_toggle_class
def render_help_container
' help-container' if controller_name == 'help'
end

def show_loomio_org_marketing
ENV['SHOW_LOOMIO_ORG_MARKETING']
end
end
21 changes: 13 additions & 8 deletions app/views/application/_footer.html.haml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
%footer.footer
.col-sm-6
- unless current_user
%select#select-locale
= options_for_select linked_language_options, selected_language_option
- if show_loomio_org_marketing
%footer.footer
.col-sm-6
- unless current_user
%select#select-locale
= options_for_select linked_language_options, selected_language_option

= link_to t(:translate, default: "help translate Loomio!"), 'https://www.loomio.org/d/hB1Oijwv/overview-of-the-translation-process-for-translators'
= link_to t(:translate, default: "help translate Loomio!"), 'https://www.loomio.org/d/hB1Oijwv/overview-of-the-translation-process-for-translators'

.col-sm-6.footer-links
= render "footer_links", target: 'blank'
.col-sm-6.footer-links
= render "footer_links", target: 'blank'
- else
%footer.footer
.col-xs-12
= t :"footer.independent_install_html", hostname: ENV['CANONICAL_HOST']
10 changes: 4 additions & 6 deletions app/views/application/_header.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
- if hide_beta_logo?
- logo_class = 'app-logo'
- else
- logo_class = 'app-logo beta'
- logo_path = ENV['APP_LOGO_PATH'] || image_url("navbar-logo-beta.jpg")

%nav.navbar.navbar-default.navbar-fixed-top
.container
Expand All @@ -12,7 +9,8 @@
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand{class: logo_class, href: dashboard_or_root_path, title: t(:"organisation.name")}

%a.navbar-brand.app-logo{ href: dashboard_or_root_path, title: t(:"organisation.name"), style: "background-image: url(#{logo_path})" }

%ul.nav.navbar-nav
%li#inbox-container
Expand Down Expand Up @@ -52,7 +50,7 @@
= render 'user_dropdown'

- else
%a.navbar-brand{class: logo_class, href: dashboard_or_root_path, title: t(:"organisation.name")}
%a.navbar-brand.app-logo{href: dashboard_or_root_path, title: t(:"organisation.name")}
%nav
%ul.nav.navbar-nav.navbar-right.pull-right
- unless controller_name == "group_requests"
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/registrations/_persona_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
=f.input :name
=f.input :email

.terms-of-service-text=t(:terms_of_service_html, button_text: t(:"devise.registrations.sign_up"), link_path: terms_of_service_path)
.terms-of-service-text=t(:terms_of_service_html, button_text: t(:"devise.registrations.sign_up"), link_path: terms_of_service_path) if show_loomio_org_marketing
-sign_up = t(:"devise.registrations.sign_up")
=f.submit sign_up, class: "btn btn-info btn-lg", :data => {:disable_with => sign_up}
2 changes: 1 addition & 1 deletion app/views/devise/registrations/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
= render 'devise/shared/omniauth_buttons'
%h3= t :or_fill_in_this_form
= render "form"
.terms= t(:terms_of_service_html, button_text: t(:'devise.registrations.sign_up'), link_path: terms_of_service_path)
.terms= t(:terms_of_service_html, button_text: t(:'devise.registrations.sign_up'), link_path: terms_of_service_path) if show_loomio_org_marketing
2 changes: 1 addition & 1 deletion app/views/devise/sessions/new.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
= t :or
= render "form"
.terms
=t(:terms_of_service_html, button_text: t(:'devise.sessions.sign_in'), link_path: terms_of_service_path)
=t(:terms_of_service_html, button_text: t(:'devise.sessions.sign_in'), link_path: terms_of_service_path) if show_loomio_org_marketing
2 changes: 1 addition & 1 deletion app/views/thread_mailer/_footer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
%p{style: 'font-size:small;-webkit-text-size-adjust:none;color:#666;'}
&mdash;
%br
= t(:'email.thread_mailer.reply_or_view_online_html', url: link)
= t(:'email.thread_mailer.reply_or_view_online_html', url: link, hostname: ENV['CANONICAL_HOST'])

- if @following
%br
Expand Down
2 changes: 1 addition & 1 deletion app/views/thread_mailer/_footer.text.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\
\--
= t :"email.thread_mailer.footer_text"
= t :"email.thread_mailer.footer_text", hostname: ENV['CANONICAL_HOST']
= link
\
= t :"email.thread_mailer.change_preferences"
Expand Down
8 changes: 4 additions & 4 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ en:
privacy: 'Privacy'
public_groups: 'Public groups'
terms: 'Terms'
independent_install_html: '%{hostname} is running an independent copy of Loomio: <a href="http://github.com/loomio/loomio">find out more</a>.'

inbox:
clear: 'Clear'
Expand Down Expand Up @@ -1147,11 +1148,10 @@ en:
headline: "%{author}'s proposal in %{group} is closing soon:"
summary: "Summary"
thread_mailer:
footer_text: "Reply to this email directly or view it on Loomio:"
#footer_html: "Reply to this email directly or <a href='%{app_link}'>view it on Loomio</a>. Change your <a href='%{preferences_link}'>email preferences</a>."
reply_or_view_online_html: "Reply to this email directly or <a href='%{url}'>view it on Loomio</a>."
footer_text: "Reply to this email directly or view it on %{hostname}:"
reply_or_view_online_html: "Reply to this email directly or <a href='%{url}'>view it on %{hostname}</a>."
unfollow_discussion_html: "<a href='%{unfollow_url}'>Unfollow</a> to stop emails about this discussion."
change_email_preferences_html: "Change your <a href='%{email_preferences_url}'>email preferences</a> to unsubscribe from Loomio emails."
change_email_preferences_html: "Change your <a href='%{email_preferences_url}'>email preferences</a> to unsubscribe from these emails."
change_preferences: "Change your email preferences:"
new_motion: "%{who} proposed:"
motion_closing_soon: "Proposal closing in 24 hours:"
Expand Down

0 comments on commit 8400478

Please sign in to comment.