Permalink
Browse files

Styling, text, and non-functional updates

  • Loading branch information...
1 parent 29e9bac commit 8a1c9d5089c0bfb506a716530ab2ccd2ef334def @nahurst committed Mar 18, 2013
View
2 Gemfile
@@ -13,7 +13,7 @@ gem "database_cleaner", ">= 0.9.1", :group => :test
gem "email_spec", ">= 1.4.0", :group => :test
gem "factory_girl_rails", ">= 4.2.0", :group => [:development, :test]
gem "compass-rails", ">= 1.0.3", :group => :assets
-gem "zurb-foundation", ">= 3.2.5", :group => :assets
+gem "zurb-foundation", "~> 4.0.0", :group => :assets
gem "quiet_assets", ">= 1.0.1", :group => :development
gem "better_errors", ">= 0.6.0", :group => :development
gem "binding_of_caller", ">= 0.7.1", :group => :development, :platforms => [:mri_19, :rbx]
View
2 Gemfile.lock
@@ -186,4 +186,4 @@ DEPENDENCIES
sass-rails (~> 3.2.3)
sqlite3
uglifier (>= 1.0.3)
- zurb-foundation (>= 3.2.5)
+ zurb-foundation (~> 4.0.0)
View
6 app/assets/javascripts/application.js
@@ -14,6 +14,12 @@ APP = {
},
},
mail_merges: {
+ 'show': function() {
+ $(".edit_mail_merge input").attr("disabled", "disabled");
+ $(".edit_mail_merge textarea").attr("disabled", "disabled");
+ var data = $.parseJSON($("#mail_merge_data").val());
+ APP.mail_merges.display(data);
+ },
'new': function() {
$("#pull").click(function(e) {
e.preventDefault();
View
18 app/assets/stylesheets/application.css.scss
@@ -12,6 +12,9 @@
*= require foundation_and_overrides
*= require_tree .
*/
+
+@import "foundation";
+
.brand {
float: left;
padding-right: 8px;
@@ -36,3 +39,18 @@ ul.nav li {
background-color: #FCC;
border: solid 1px #C66;
}
+.container {
+}
+header {
+ background-color: $primary-color;
+ padding-top: 5px;
+ border-bottom: 5px solid $shiny-edge-color;
+ div { @include grid-row(); }
+ h3 a, h3 a:hover { color: white; text-shadow: 1px 1px 0 #666; }
+}
+#main {
+ @include grid-row();
+}
+#footer {
+ @include grid-row();
+}
View
32 app/assets/stylesheets/mail_merge.css.scss
@@ -1,3 +1,29 @@
-// Place all the styles related to the MailMerge controller here.
-// They will automatically be included in application.css.
-// You can use Sass (SCSS) here: http://sass-lang.com/
+@import "foundation";
+
+body[data-controller="mail_merges"] {
+
+ #pulled_data {
+ @include grid-row();
+ margin-bottom: 15px;
+ }
+ form {
+ $collapse: true;
+ @include grid-column(6, $collapse:true);
+ textarea {
+ height: 150px;
+ }
+ }
+
+ &[data-action="new"] {
+ #preview-field {
+ @include grid-column(5, $collapse:true, $offset: 1);
+ #preview {
+ min-height: 275px;
+ border: 5px solid $input-border-color;
+ }
+ }
+ }
+ &[data-action="show"] {
+ .actions { display: none;}
+ }
+}
View
3 app/views/layouts/_footer.html.erb
@@ -0,0 +1,3 @@
+<div id="footer">
+ <%= link_to "All previous mail merges", mail_merges_path %>
+</div>
View
10 app/views/layouts/_messages.html.erb
@@ -1,5 +1,7 @@
-<% flash.each do |name, msg| %>
- <% if msg.is_a?(String) %>
- <%= content_tag :div, msg, :id => "flash_#{name}" %>
+<div>
+ <% flash.each do |name, msg| %>
+ <% if msg.is_a?(String) %>
+ <%= content_tag :div, msg, :id => "flash_#{name}" %>
+ <% end %>
<% end %>
-<% end %>
+</div>
View
4 app/views/layouts/_navigation.html.erb
@@ -1 +1,3 @@
-<%= link_to "Happy To", root_path, :class => 'brand' %>
+<div>
+ <h3><%= link_to "HappyTo: No more sad bcc", root_path %></h3>
+</div>
View
3 app/views/layouts/application.html.erb
@@ -2,7 +2,7 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title><%= content_for?(:title) ? yield(:title) : "Happy To" %></title>
+ <title><%= content_for?(:title) ? yield(:title) : "HappyTo: No more sad bcc" %></title>
<meta name="description" content="<%= content_for?(:description) ? yield(:description) : "Happy To" %>">
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
@@ -21,6 +21,7 @@
<%= yield %>
</div>
<footer>
+ <%= render 'layouts/footer' %>
</footer>
</div> <!--! end of #container -->
</body>
View
6 app/views/mail_merges/_form.html.erb
@@ -12,12 +12,6 @@
<% end %>
<%= f.hidden_field :data %>
- <table id="pulled_data" style="display: none">
- <thead>
- </thead>
- <tbody>
- </tbody>
- </table>
<div class="field">
<%= f.label :from %>
View
6 app/views/mail_merges/_pulled_data.html.erb
@@ -0,0 +1,6 @@
+<table id="pulled_data" style="display: none">
+ <thead>
+ </thead>
+ <tbody>
+ </tbody>
+</table>
View
8 app/views/mail_merges/index.html.erb
@@ -1,23 +1,17 @@
-<h1>Listing mail_merges</h1>
+<h3>All your mail merges</h3>
<table>
<tr>
- <th>Data</th>
<th>Subject template</th>
<th>Body template</th>
<th></th>
- <th></th>
- <th></th>
</tr>
<% @mail_merges.each do |mail_merge| %>
<tr>
- <td><%= mail_merge.data %></td>
<td><%= mail_merge.subject_template %></td>
<td><%= mail_merge.body_template %></td>
<td><%= link_to 'Show', mail_merge %></td>
- <td><%= link_to 'Edit', edit_mail_merge_path(mail_merge) %></td>
- <td><%= link_to 'Destroy', mail_merge, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</table>
View
18 app/views/mail_merges/new.html.erb
@@ -1,13 +1,19 @@
-<h1>New mail_merge</h1>
+<h3>Mail Merge with Gmail and a Google Spreadsheet</h3>
-<%= label_tag "Google Spreadsheet URL (check published)" %>
-<%= text_field_tag :google_spreadsheet_url %>
-<%= link_to "Pull data", "", :class => "button", :id => "pull" %>
+<div class="field">
+ <label name="google_spreadsheet_url">Google Spreadsheet URL (ensure it's <a href="http://support.google.com/drive/bin/answer.py?hl=en&answer=37579">published</a>)
+ <%= text_field_tag :google_spreadsheet_url %>
+ <%= link_to "Pull data", "", :class => "button", :id => "pull" %>
+</div>
+<%= render 'pulled_data' %>
<%= render 'form' %>
-<div id="preview">
+<div id="preview-field">
+ <label>Preview</label>
+ <div id="preview">
+ </div>
</div>
-<%= link_to 'Back', mail_merges_path %>
+
View
24 app/views/mail_merges/show.html.erb
@@ -1,20 +1,4 @@
-<p id="notice"><%= notice %></p>
-
-<p>
- <b>Data:</b>
- <%= @mail_merge.data %>
-</p>
-
-<p>
- <b>Subject template:</b>
- <%= @mail_merge.subject_template %>
-</p>
-
-<p>
- <b>Body template:</b>
- <%= @mail_merge.body_template %>
-</p>
-
-
-<%= link_to 'Edit', edit_mail_merge_path(@mail_merge) %> |
-<%= link_to 'Back', mail_merges_path %>
+<h3>Your messages have been sent</h3>
+<p>Total sent: <%= @mail_merge.emails.count %></p>
+<%= render 'pulled_data' %>
+<%= render 'form' %>
View
2 config/environments/development.rb
@@ -17,7 +17,7 @@
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
# change to true to allow email to be sent during development
- config.action_mailer.perform_deliveries = true
+ config.action_mailer.perform_deliveries = false
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
View
1 spec/factories/mail_merges.rb
@@ -6,6 +6,7 @@
{'email' => 'michaelangello@example.com', 'name' => 'Michaelangello', 'company' => 'TMNT'},
{'email' => 'raphael@example.com', 'name' => 'Raphael', 'company' => 'TMNT'}
].to_json
+ from "splinter@example.com"
subject_template "Great to see you {{name}}"
body_template "Hi {{name}}\nIt was great to see you at the {{company}} party!"
end

0 comments on commit 8a1c9d5

Please sign in to comment.