Skip to content

Commit

Permalink
Merge pull request awesome-academy#202 from ngocvnn/refactorcode
Browse files Browse the repository at this point in the history
refactorcode
  • Loading branch information
dieunb committed Jun 25, 2015
2 parents 2e52464 + 891db90 commit 8dc418c
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 12 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gem "rails_config"
gem "ransack"
gem "carrierwave"
gem "mini_magick"
gem "fog"
gem "deep_cloneable", "~> 2.1.1"
gem "kaminari"
gem "kaminari-bootstrap"
Expand Down
105 changes: 105 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ GIT
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (2.3.1)
actionmailer (4.2.0)
actionpack (= 4.2.0)
actionview (= 4.2.0)
Expand Down Expand Up @@ -98,6 +99,7 @@ GEM
eventmachine (>= 1.0.0.beta.1)
erubis (2.7.0)
eventmachine (1.0.7)
excon (0.45.3)
execjs (2.5.2)
factory_girl (4.5.0)
activesupport (>= 3.0.0)
Expand All @@ -109,8 +111,105 @@ GEM
faye-websocket (0.9.2)
eventmachine (>= 0.12.0)
websocket-driver (>= 0.5.1)
fission (0.5.0)
CFPropertyList (~> 2.2)
fog (1.30.0)
fog-atmos
fog-aws (~> 0.0)
fog-brightbox (~> 0.4)
fog-core (~> 1.27, >= 1.27.4)
fog-ecloud
fog-google (>= 0.0.2)
fog-json
fog-local
fog-powerdns (>= 0.1.1)
fog-profitbricks
fog-radosgw (>= 0.0.2)
fog-riakcs
fog-sakuracloud (>= 0.0.4)
fog-serverlove
fog-softlayer
fog-storm_on_demand
fog-terremark
fog-vmfusion
fog-voxel
fog-xml (~> 0.1.1)
ipaddress (~> 0.5)
nokogiri (~> 1.5, >= 1.5.11)
fog-atmos (0.1.0)
fog-core
fog-xml
fog-aws (0.3.0)
fog-core (~> 1.27)
fog-json (~> 1.0)
fog-xml (~> 0.1)
ipaddress (~> 0.8)
fog-brightbox (0.7.1)
fog-core (~> 1.22)
fog-json
inflecto (~> 0.0.2)
fog-core (1.30.0)
builder
excon (~> 0.45)
formatador (~> 0.2)
mime-types
net-scp (~> 1.1)
net-ssh (>= 2.1.3)
fog-ecloud (0.1.1)
fog-core
fog-xml
fog-google (0.0.5)
fog-core
fog-json
fog-xml
fog-json (1.0.1)
fog-core (~> 1.0)
multi_json (~> 1.0)
fog-local (0.2.1)
fog-core (~> 1.27)
fog-powerdns (0.1.1)
fog-core (~> 1.27)
fog-json (~> 1.0)
fog-xml (~> 0.1)
fog-profitbricks (0.0.2)
fog-core
fog-xml
nokogiri
fog-radosgw (0.0.4)
fog-core (>= 1.21.0)
fog-json
fog-xml (>= 0.0.1)
fog-riakcs (0.1.0)
fog-core
fog-json
fog-xml
fog-sakuracloud (1.0.1)
fog-core
fog-json
fog-serverlove (0.1.2)
fog-core
fog-json
fog-softlayer (0.4.6)
fog-core
fog-json
fog-storm_on_demand (0.1.1)
fog-core
fog-json
fog-terremark (0.1.0)
fog-core
fog-xml
fog-vmfusion (0.1.0)
fission
fog-core
fog-voxel (0.1.0)
fog-core
fog-xml
fog-xml (0.1.2)
fog-core
nokogiri (~> 1.5, >= 1.5.11)
font-awesome-rails (4.3.0.0)
railties (>= 3.2, < 5.0)
formatador (0.2.5)
fullcalendar-rails (2.3.1.0)
jquery-rails (>= 3.1.1, < 5.0.0)
momentjs-rails (~> 2.8, >= 2.8.4)
Expand All @@ -121,6 +220,8 @@ GEM
hiredis (0.6.0)
hitimes (1.2.2)
i18n (0.7.0)
inflecto (0.0.2)
ipaddress (0.8.0)
jbuilder (2.3.0)
activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2)
Expand Down Expand Up @@ -159,6 +260,9 @@ GEM
multi_json (1.11.1)
mysql2 (0.3.18)
nested_form (0.3.2)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
orm_adapter (0.5.0)
Expand Down Expand Up @@ -320,6 +424,7 @@ DEPENDENCIES
devise
factory_girl_rails
faker (= 1.4.2)
fog
fullcalendar-rails
jbuilder (~> 2.0)
jquery-rails
Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/calendar/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ $(document).ready(function() {
content: $(".form-popover").html(),
});
};

$("body").on("click", function (e) {
if($(".fc-more-popover").length == 1){
localStorage.setItem("flag", true);
Expand All @@ -208,6 +209,7 @@ $(document).ready(function() {
$(this).hide();
});
});

$('.fc-content').click(function(){
$(".popover").hide();
});
Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/calendar/time-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ $(document).on("click", ".coll", function() {
icon.removeClass("glyphicon-minus-sign");
$(".s-detail").slideUp();
});

5 changes: 3 additions & 2 deletions app/assets/javascripts/share/countdown_time.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function showRemaining() {
var minutes = Math.floor((distance % _hour) / _minute);
var seconds = Math.floor((distance % _minute) / _second);

dayString = days > 0 ? days + " day " : "";
ds = days > 1 ? " days, " : " day, ";
dayString = days > 0 ? days + ds : "";
hoursString = hours > 0 ? hours + " hour " : "";
minuteString = minutes > 0 ? minutes + " minute " : "";

Expand All @@ -33,4 +34,4 @@ function showRemaining() {
document.getElementById("countdown").innerHTML = fulltime;
}

timer = setInterval(showRemaining, 1000);
timer = setInterval(showRemaining, 1000);
2 changes: 1 addition & 1 deletion app/assets/stylesheets/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ h3 {
font-size: 1em;
background-color: $lighter-gray;
}
#other_dropdown .dropdown-menu{
#other_dropdown .dropdown-menu {
min-width: 80px;
left: -9px;
li {
Expand Down
8 changes: 2 additions & 6 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
module ApplicationHelper
def full_title page_title
base_title = "Conferences Room Book"
if page_title.blank?
base_title
else
"#{page_title} | #{base_title}"
end
base_title = t("crb")
page_title.blank? ? base_title : "#{page_title} | #{base_title}"
end

def bootstrap_class_for flash_type
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/schedules/_schedule.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
<% end %>
</div>
</td>
</tr>
</tr>
2 changes: 1 addition & 1 deletion app/views/admin/schedules/update.js.erb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$("#schedule_state_<%= @schedule.id %>").html("<div class='<%= @schedule.state %>-event'><%= @schedule.state %><div>");
$("#schedule_state_<%= @schedule.id %>").html("<div class='<%= @schedule.state %>-event'><%= @schedule.state %><div>");
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,4 @@ en:

valid:
room: There are any event with same your time!
crb: Conferences Room Book

0 comments on commit 8dc418c

Please sign in to comment.