Skip to content
This repository has been archived by the owner on Nov 14, 2018. It is now read-only.

Commit

Permalink
minor cleanup, working on adding multiple calendar support
Browse files Browse the repository at this point in the history
  • Loading branch information
danmayer committed May 12, 2013
1 parent 6fbb0db commit e6e8c9d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
1 change: 0 additions & 1 deletion app/controllers/marks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def sync
else
render :json => "must be logged in to sync", status => 401
end

end

end
5 changes: 0 additions & 5 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
module ApplicationHelper

def content_given?(name)
content = instance_variable_get("@content_for_#{name}")
! content.nil?
end

end
5 changes: 1 addition & 4 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
</div>

<%= render :partial => "shared/notice_messages" %>
<%= render :partial => "shared/calendar_picker" %>

</div>

Expand All @@ -68,10 +69,6 @@
</div>
</div>

<% if Rails.env.development? %>
<script>document.write('<script src="http://' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1"></' + 'script>')</script>
<% end %>

<script src="/javascripts/jquery.pjax.js"></script>
<script src="/javascripts/scroll-startstop.events.jquery.js"></script>
<script src="/javascripts/all.js"></script>
Expand Down
8 changes: 8 additions & 0 deletions app/views/shared/_calendar_picker.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="calendar_picker" id="calendar_picker" style="display:none">
<form action="demo_form.asp" id="calendar_picker">
Currently Tracking <select name="calendar">
<option value="default">Default</option>
<option value="create">Add New Calendar</option>
</select>
</form>
</div>
2 changes: 1 addition & 1 deletion app/views/shared/_notice_messages.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<span class="notice"></span>
<span class="alert"></span>
<span class="error"></span>
</div>
</div>
4 changes: 3 additions & 1 deletion public/javascripts/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ var prev_click = function() {
console.log(data);
var user = data['user'];
if(user && user['email'] && user['id']) {
$('#calendar_picker').slideDown();
var template = "<span class='logged-in-info'>Logged in as <a href='/users/{{to_param}}'>{{email}}</a></span><br/><a href='/users/edit'>Edit Account</a> | Not you? <a id='logout' href='/users/sign_out'>Sign out</a>";
logged_in = true;
} else {
Expand Down Expand Up @@ -280,8 +281,9 @@ var prev_click = function() {

var displayNotice = function(message, type) {
$("#messages ."+type).html(message);
$('#calendar_picker').slideUp();
$("#messages").slideDown();
setTimeout("$('#messages').slideUp();", 15000)
setTimeout("$('#messages').slideUp(); $('#calendar_picker').slideDown();", 15000)
}

var notices = ['notice', 'alert', 'error'];
Expand Down

0 comments on commit e6e8c9d

Please sign in to comment.