Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
newsletter ui: sidebar common + tracking partial
- Loading branch information
priit.mx.ee
committed
Jan 7, 2009
1 parent
b758b97
commit d753644
Showing
5 changed files
with
42 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
engines/adva_newsletter/app/views/admin/newsletter_subscriptions/_sidebar_actions.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<h3><%= t('adva.titles.actions') %></h3> | ||
<ul> | ||
<li><%= link_to t('adva.issue.link.new'), new_admin_issue_path %></li> | ||
<li><%= link_to t('adva.subscription.link.new'), new_admin_subscription_path %></li> | ||
</ul> | ||
<%= render :partial => 'admin/shared/tracking' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
engines/adva_newsletter/app/views/admin/shared/_sidebar_common.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<li><%= link_to t('adva.issue.link.new'), new_admin_issue_path(@site, @newsletter) %></li> | ||
<li><%= link_to t('adva.subscription.link.new'), new_admin_subscription_path(@site, @newsletter) %></li> |
34 changes: 34 additions & 0 deletions
34
engines/adva_newsletter/app/views/admin/shared/_tracking.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<h3><%= t(:'adva.titles.tracking') %></h3> | ||
<% if @site.google_analytics_tracking_code -%> | ||
<% fields_for :issue do |f| -%> | ||
<p> | ||
<%= f.check_box :track, :onclick => "$('tracking_options').toggle();" %> | ||
<%= f.label :track, t(:'adva.tracking.enable_tracking'), :style => "display:inline;" %> | ||
</p> | ||
<div id="tracking_options" style="display:none;"> | ||
<span class="hint"><%= t(:'adva.tracking.hints.glossary', :link => link_to(t(:'adva.tracking.hints.glossary_name'), "http://www.google.com/support/googleanalytics/bin/topic.py?topic=11096&hl=#{I18n.locale}")) %> | ||
<p> | ||
<%= f.label :tracking_campaign, t(:'adva.tracking.tracking_campaign') %> | ||
<%= f.text_field :tracking_campaign %> | ||
</p> | ||
<p> | ||
<%= f.label :tracking_source, t(:'adva.tracking.tracking_source') %> | ||
<%= f.text_field :tracking_source %> | ||
</p> | ||
</div> | ||
<% end -%> | ||
<% else -%> | ||
<span class="hint"><%= t(:'adva.tracking.hints.no_tracking_code', :settings => link_to(t(:'adva.resources.settings'), edit_admin_site_path(@site))) %></span> | ||
<% end -%> | ||
<script type="text/javascript"> | ||
toggleTrackingOptions = function(event) { | ||
checkbox = event.element(); | ||
|
||
// pre-fill values if checkbox is checked | ||
if(checkbox.checked) { | ||
if(!$F('issue_tracking_campaign')) $('issue_tracking_campaign').value = decodeURI('<%= @newsletter.title %>'); | ||
if(!$F('issue_tracking_source')) $('issue_tracking_source').value = decodeURI($F('issue_title')); | ||
} | ||
} | ||
$('issue_track').observe('click', toggleTrackingOptions); | ||
</script> |