Skip to content

Commit

Permalink
some bootstrap formatting, setup boostrap
Browse files Browse the repository at this point in the history
  • Loading branch information
cstavitsky committed Sep 14, 2015
1 parent 9a29074 commit 6201820
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 60 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ group :development do
end
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
gem 'bootstrap-sass', '~> 3.2.0'
gem 'autoprefixer-rails'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@ GEM
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.3)
autoprefixer-rails (6.0.2)
execjs
json
bcrypt (3.1.10)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
bootstrap-sass (3.2.0.2)
sass (~> 3.2)
builder (3.2.2)
byebug (6.0.2)
coffee-rails (4.1.0)
Expand Down Expand Up @@ -151,7 +156,9 @@ PLATFORMS

DEPENDENCIES
action_mailer_tls
autoprefixer-rails
bcrypt (~> 3.1.7)
bootstrap-sass (~> 3.2.0)
byebug
coffee-rails (~> 4.1.0)
jbuilder (~> 2.0)
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
//= require jquery_ujs
//= require jquery.turbolinks
//= require turbolinks
//= require bootstrap-sprockets
//= require_tree .
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,51 @@
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";

.header{
height: 50px;
width: 100%;
display: block;
}

#output{
width: 500px;
}
}

.container{
width: 550px;
border: 1px solid gray;
border-radius: 15px;
padding: 10px;
float:left;
margin-left: 100px;
display:inline;
}

.right-container{
width: 500px;
border: 1px solid gray;
border-radius: 15px;
padding: 10px;
margin-left: 30px;
display:inline;
}

.email-container{
border: 1px solid gray;
width: 400px;
margin: 0 auto;
border-radius: 15px;
padding: 15px;
}

.center{
margin: 0 auto;
width: 600px;
text-align: center;
}

31 changes: 31 additions & 0 deletions app/views/emails/_beginningweek.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<h3>Email preview:</h3>
<p>
<span id="boss-email-output">
(To: <%=@user.coworkers.first.email%>)
</span>
</p>
<p>
<span id="subject-line-output">(Subject line: Work plan for this week) </span>
</p>
<span id="boss-name-output">Hi <%=@user.coworkers.first.first_name%>, </span>
<p>
After reviewing my activities here is my plan for the week in order of priority. Let me know if you think I should re-prioritize:
</p>

<h4>Planned Major Activities for the week</h4>
<ol>
<div id="output"></div>
</ol>

<h4>Open items that I will look into, but won’t get finished this week</h4>
<ol>
<div id="output2"></div>
</ol>

<p>
Let me know if you have any comments. Thank you!
</p>
<p>
-<%=@user.name.capitalize%><br>
Sent via <a href="#">Translucent</a>
</p>
23 changes: 23 additions & 0 deletions app/views/emails/_emailform.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<div class="form-group">
<%= f.label :addressee_email, "Boss's Email Address", class: "col-md-4 control-label" %>
<%= f.text_field :addressee_email, :value => @user.coworkers.first.email, :id => 'boss-email', class: "form-control", :onkeyup => "bossEmailKeyPress()", :onkeypress => "bossEmailKeyPress()" %>
</div>
<div class="form-group">
<%= f.label :subject_line_beginning_week, "Email Subject Line:", class: "col-md-4 control-label" %>
<%= f.text_field :subject_line_beginning_week, :value => "Work plan for this week", :id => 'subject-line', class: "form-control", :onkeyup => "subjectLineKeyPress()", :onkeypress => "subjectLineKeyPress()" %>
</div>
<div class="form-group">
<%= f.label :addressee_name, "Recipient name:", class: "col-md-4 control-label" %>
<%= f.text_field :addressee_name, :value => @user.coworkers.first.first_name, :id => 'boss-name', class: "form-control", :onkeyup => "bossNameKeyPress()", :onkeypress => "bossNameKeyPress()" %></p>
</div>
<div class="form-group">
<%= f.label :major_projects, "Major Projects (separate by comma+space):", class: "col-md-4 control-label" %>
<%= f.text_field :major_projects, :id => 'text', class: "form-control" %></p>
</div>
<div class="form-group">
<%= f.label :open_projects, "Open Projects (separate by comma+space):", class: "col-md-4 control-label" %>
<%= f.text_field :open_projects, :id => 'text2', class: "form-control" %>
</div>
<p>
<%= f.submit "Send email", class: "btn btn-default", data: { confirm: 'Are you ready to send your email to your boss?' } %>
</p>
10 changes: 5 additions & 5 deletions app/views/emails/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<% if @user.coworkers.length > 0 %>
<% if sat_through_wed %>
<div id="send-weekly-email"><h1><%=link_to "beginning of the week? send your boss your plans", new_email_path %></h1></div>
<div id="send-weekly-email" class="center"><h1><%=link_to "beginning of the week? send your boss your plans", new_email_path %></h1></div>

<% elsif thurs_through_sat %>
<div id="send-weekly-email"><h1><%=link_to "end of the week? tell your boss what you got done", new_email_path %></h1></div>
<div id="send-weekly-email" class="center"><h1><%=link_to "end of the week? tell your boss what you got done", new_email_path %></h1></div>

<% end %>

Expand All @@ -18,11 +18,11 @@
<li>
Open projects for the week were: <%=email.open_projects%>
</li>

<% end %>
</div>
<% end %>

<% else %>

<div class="form-container"><h1><%= link_to "Click to start by adding your boss's email", new_coworker_path %></h1></div>
<div class="container"><h1><%= link_to "Click to start by adding your boss's email", new_coworker_path %></h1></div>

<% end %>
88 changes: 36 additions & 52 deletions app/views/emails/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,56 @@
<!-- ELSE display a link that says 'need to change your boss' default info? -->

<!-- if there are no projects, display a link to show jQuery-hidden, ajaxified form to create new projects -->
<div class="header"></div>

<% if sat_through_wed %>
<% if sat_through_wed %>

<div class="form-container">
<p><b>Fill in the following fields to autogenerate an email about your plans for this week. </b></p>
<div class="container col-md-4">
<p>
<em>Fill in the following fields to autogenerate an email about your plans for this week. <br>
Once you hit send, the email will be sent to your boss. </em>
</p>

<p><b>Once you hit send, the email will be sent to your boss. </b></p>

<%= form_for @email, url: {action: "create"}, html: {class: "email_form"} do |f| %>
<p>Email Recipient: <%= f.text_field :addressee_email, :value => @user.coworkers.first.email, :id => 'boss-email', :onkeyup => "bossEmailKeyPress()", :onkeypress => "bossEmailKeyPress()" %></p>
<p>Email Subject Line: <%= f.text_field :subject_line_beginning_week, :value => "Work plan for this week", :id => 'subject-line', :onkeyup => "subjectLineKeyPress()", :onkeypress => "subjectLineKeyPress()" %></p>
<p>Recipient name: <%= f.text_field :addressee_name, :value => @user.coworkers.first.first_name, :id => 'boss-name', :onkeyup => "bossNameKeyPress()", :onkeypress => "bossNameKeyPress()" %></p>
<p>Major Projects (separate by comma): <%= f.text_field :major_projects, :id => 'text' %></p>
<p>Open Projects (separate by comma): <%= f.text_field :open_projects, :id => 'text2' %></p>

<p>
<%= f.submit "Send email" %>
</p>
<% end %>
</div>
<%= form_for @email, url: {action: "create"}, html: {class: "form_horizontal"} do |f| %>
<%= render partial: "emailform", locals: {f: f}%>
<% end %>
</div>

<h3>Email preview:</h3>
<div class="right-container col-md-4">
<%= render partial: "beginningweek" %>
</div>

<p>
<span id="boss-email-output">(To: <%=@user.coworkers.first.email%>) </span>
</p>
<% elsif thurs_through_sat %>

<div class="form-container">
<p>
<span id="subject-line-output">(Subject line: Work plan for this week) </span>
<b>Fill in the following fields to autogenerate an email about what you already completed this week.</b>
</p>

<span id="boss-name-output">Hi <%=@user.coworkers.first.first_name%>, </span>

<p>
After reviewing my activities here is my plan for the week in order of priority. Let me know if you think I should re-prioritize:</p>

<h4>Planned Major Activities for the week</h4>
<ol>
<div id="output"></div>
</ol>

<h4>Open items that I will look into, but won’t get finished this week</h4>
<ol>
<div id="output2"></div>
</ol>

<p>Let me know if you have any comments. Thank you!</p>
-<%=@user.name.capitalize%>
<p>Sent via <a href="#">Translucent</a></p>

<% elsif thurs_through_sat %>

<div class="form-container">
<p><b>Fill in the following fields to autogenerate an email about what you already completed this week. </b></p>

<p><b>Once you hit send, the email will be sent to your boss. </b></p>
<b>Once you hit send, the email will be sent to your boss. </b>
</p>

<%= form_for @email, url: {action: "create"}, html: {class: "email_form"} do |f| %>
<p>Email Recipient: <%= f.text_field :addressee_email, :value => @user.coworkers.first.email, :id => 'boss-email', :onkeyup => "bossEmailKeyPress()", :onkeypress => "bossEmailKeyPress()" %></p>
<p>Email Subject Line: <%= f.text_field :subject_line_end_week, :value => "Completed tasks and progress this week", :id => 'subject-line', :onkeyup => "subjectLineKeyPress()", :onkeypress => "subjectLineKeyPress()" %></p>
<%= form_for @email, url: {action: "create"}, html: {class: "form_horizontal"} do |f| %>
<div class="form-group">
<%= f.label :addressee_email, "Open Projects (separate by comma+space):", class: "col-md-4 control-label" %>
<p>Email Recipient: <%= f.text_field :addressee_email, :value => @user.coworkers.first.email, :id => 'boss-email', :onkeyup => "bossEmailKeyPress()", :onkeypress => "bossEmailKeyPress()" %></p>
</div>
<div class="form-group">
<p>Email Subject Line: <%= f.text_field :subject_line_end_week, :value => "Completed tasks and progress this week", :id => 'subject-line', :onkeyup => "subjectLineKeyPress()", :onkeypress => "subjectLineKeyPress()" %></p>
</div>
<div class="form-group">
<p>Recipient name: <%= f.text_field :addressee_name, :value => @user.coworkers.first.first_name, :id => 'boss-name', :onkeyup => "bossNameKeyPress()", :onkeypress => "bossNameKeyPress()" %></p>
<p>COMPLETED Projects (separate by comma): <%= f.text_field :major_projects, :id => 'text' %></p>
<p>OPEN Projects (separate by comma): <%= f.text_field :open_projects, :id => 'text2' %></p>
</div>
<div class="form-group">
<p>COMPLETED Projects (separate by comma): <%= f.text_field :major_projects, :id => 'text' %></p>
</div>
<div class="form-group">
<p>OPEN Projects (separate by comma): <%= f.text_field :open_projects, :id => 'text2' %></p>
</div>

<p>
<%= f.submit "Send email" %>
<%= f.submit "Send email", class: "btn btn-default" %>
</p>
<% end %>
</div>
Expand Down

0 comments on commit 6201820

Please sign in to comment.