Permalink
Browse files

Added jQuery-ui and some better chart analysis stuff.

  • Loading branch information...
1 parent 154de38 commit ca7ee389d78ca47eee0b8b2576bf5e917095b73d @tylergannon committed Jun 13, 2012
Showing with 738 additions and 100 deletions.
  1. +69 −0 app/assets/javascripts/jquery-ui-1.8.21.custom.min.js
  2. +25 −6 app/assets/javascripts/people.js.coffee
  3. +9 −2 app/assets/stylesheets/charts.css.scss
  4. +25 −1 app/assets/stylesheets/people/people.css.scss
  5. BIN app/assets/stylesheets/pepper-grinder/images/ui-bg_diagonal-maze_20_6e4f1c_10x10.png
  6. BIN app/assets/stylesheets/pepper-grinder/images/ui-bg_diagonal-maze_40_000000_10x10.png
  7. BIN app/assets/stylesheets/pepper-grinder/images/ui-bg_fine-grain_10_eceadf_60x60.png
  8. BIN app/assets/stylesheets/pepper-grinder/images/ui-bg_fine-grain_10_f8f7f6_60x60.png
  9. BIN app/assets/stylesheets/pepper-grinder/images/ui-bg_fine-grain_15_eceadf_60x60.png
  10. BIN app/assets/stylesheets/pepper-grinder/images/ui-bg_fine-grain_15_f7f3de_60x60.png
  11. BIN app/assets/stylesheets/pepper-grinder/images/ui-bg_fine-grain_15_ffffff_60x60.png
  12. BIN app/assets/stylesheets/pepper-grinder/images/ui-bg_fine-grain_65_654b24_60x60.png
  13. BIN app/assets/stylesheets/pepper-grinder/images/ui-bg_fine-grain_68_b83400_60x60.png
  14. BIN app/assets/stylesheets/pepper-grinder/images/ui-icons_222222_256x240.png
  15. BIN app/assets/stylesheets/pepper-grinder/images/ui-icons_3572ac_256x240.png
  16. BIN app/assets/stylesheets/pepper-grinder/images/ui-icons_8c291d_256x240.png
  17. BIN app/assets/stylesheets/pepper-grinder/images/ui-icons_b83400_256x240.png
  18. BIN app/assets/stylesheets/pepper-grinder/images/ui-icons_fbdb93_256x240.png
  19. BIN app/assets/stylesheets/pepper-grinder/images/ui-icons_ffffff_256x240.png
  20. +565 −0 app/assets/stylesheets/pepper-grinder/jquery-ui-1.8.21.custom.css
  21. +1 −1 app/controllers/comments_controller.rb
  22. +3 −0 app/models/palace.rb
  23. +1 −2 app/views/people/_star.html.haml
  24. +40 −88 app/views/people/show.html.haml

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -2,9 +2,28 @@
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
$ ->
- $('.star').each (idx, el) ->
- $el = $(el)
- $el.qtip
- content:
- text: $el.find('.star_auspices')
-
+ $('.star_auspices').each (idx, el) ->
+ $(el).dialog
+ autoOpen: false
+ # $('#chart_analysis_tabs').dialog
+ # width: '600px',
+ # height: '800px'
+ $('.chart_palace').each (idx, el) ->
+ $(el).accordion
+ collapsible: true,
+ active: false
+ $('.chart_palace_star').each (idx, el) ->
+ $(el).accordion
+ collapsible: true,
+ clearStyle: true,
+ active: false
+ $('#chart_analysis_tabs').tabs()
+ $('.chart').tabs()
+ # $('.chart_analysis_accordion').accordion
+ # collapsible: true
+ # $('.star').each (idx, el) ->
+ # $el = $(el)
+ # star = $el.data('star')
+ # $el.click ->
+ # $('#' + star + '_auspices').dialog('open')
+ #
@@ -31,8 +31,12 @@ $radius: 12px;
height: 20px;
}
- h3 {
- height: 14px;
+ .center {
+ h3 {
+ height: 14px;
+ padding: 10px;
+ margin: 0;
+ }
}
width: ($palace-width + $border-width)*4;
@@ -171,5 +175,8 @@ $radius: 12px;
right: 0;
margin-right: 8px;
}
+ table.elemental_scores {
+ font-size: 12pt;
+ }
}
@@ -2,6 +2,30 @@
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
+//.ui-dialog-titlebar {
+// height: 7px;
+//
+// .ui-dialog-titlebar-close {
+// display: block;
+// position: absolute;
+// top: 0;
+// right: 0;
+// }
+//}
+
+.chart > .ui-tabs-nav {
+ position: absolute;
+ top: -45px;
+ left: 544px;
+// line-height: 10px;
+}
+
+#chart_analysis_tabs {
+// .ui-tabs-nav {
+// line-height: 0;
+// }
+}
+
.star_auspices {
- display: none;
+// display: none;
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,6 +1,6 @@
class CommentsController < InheritedResources::Base
respond_to :html, :js
- belongs_to :element, :branch, :star, :pillar, :star_palace, :polymorphic => true
+ belongs_to :element, :branch, :star, :pillar, :star_palace, :chart_star, :polymorphic => true
before_filter :parent
before_filter :load_comment, :only => [:show, :edit, :update, :destroy]
helper_method :comments
View
@@ -1,4 +1,7 @@
class Palace < ActiveRecord::Base
+ def friendly_id
+ name.underscore.gsub(/\//, '-dash-')
+ end
def self.reseed
destroy_all
NAMES.each_with_index do |name, index|
@@ -1,6 +1,6 @@
.star{class: "rank#{star.rank} #{star_class}", data: {star: star.friendly_id}}
= "#{star.pinyin} / #{star.english}"
- .star_auspices
+ .star_auspices{id: "#{star.friendly_id}_auspices"}
- star_comments = star.my_comments(current_member)
.star_comments
%h4= star.pinyin
@@ -17,4 +17,3 @@
.comment!= RedCloth.new(comment.comments).to_html
- else
No comments for this star in this palace.
-
@@ -1,92 +1,44 @@
-
.chart
- - (1..12).map{|t| Branch[t]}.each do |branch|
- - palace = @chart.palaces[branch]
- .palace{class: branch.animal}
- %h3= "#{palace.ordinal}. #{palace.name}"
- .major_stars
- - if palace.major_stars.empty?
- = render partial: 'star', collection: borrowed_stars(palace), locals: {star_class: 'borrowed_star', chart_palace: palace}
- - else
- = render partial: 'star', collection: major_stars(palace), locals: {star_class: 'major_star', chart_palace: palace}
- .minor_stars
- = render partial: 'star', collection: minor_stars(palace), locals: {star_class: 'minor_star', chart_palace: palace}
- - if @person
- %span.small_limits= palace.small_limits(@chart, @person) + " (#{palace.great_limit(@chart, @person)})"
- %span.palace_location #{palace.location.char} #{palace.location.pinyin} #{palace.location.animal}
- .center
- %h2= @name
- .data= (@person ? @person.dob : @chart.solar_date).strftime '%Y %B %d, %I %p'
- .data= "#{numeric(@chart.lunar_month)} month / #{numeric(@chart.day_of_month)} day".html_safe
- .data= "Inner Element: #{@chart.inner_element.titleize}"
- %table
- %tr
- - for name, pillar in {'Year' => @chart.year, 'Month' => @chart.month, 'Day' => @chart.day, 'Hour' => @chart.hour}
- %td
- %h3= name
- .something= pillar.chinese
- .something= pillar.pinyin
- .something= pillar.name
- .title Elemental Score:
- %table.elemental_scores
- %tr
- %td Wood: #{@chart.wood_score}
- %td Fire: #{@chart.fire_score}
- %td Earth: #{@chart.earth_score}
- %td Metal: #{@chart.metal_score}
- %td Water: #{@chart.water_score}
-
-.chart_analysis
- .analyzing_four_pillars
- %h3 Analyzing the Four Pillars:
- %ol
- %li
- %p
- The Earthly Branch of the Year is #{@chart.year.branch.animal.titleize}.
- = render :partial => 'show_comments', :object => @chart.year.branch
-
- %li
- %p
- The Heavenly Stem of the Year is #{@chart.year.stem.name}. How does this relate to the Earthly Branch?
- %ul.list_stuff
- %li
- The native element of #{@chart.year.branch.animal.titleize} is #{@chart.year.native_element.name.titleize}.
- #{@chart.year.native_element.related_to(Element.by_name(@chart.year.stem.element))}.
- = render :partial => 'show_comments', :object => @chart.year.stem._element
- = render :partial => 'show_comments', :object => @chart.year
- %li
- %p
- The Earthly Branch of the Hour is #{@chart.hour.branch.animal.titleize}.
- = render :partial => 'show_comments', :object => @chart.hour.branch
- %li
- %p
- The Heavenly Stem of the Hour is #{@chart.hour.stem.name}. How does this relate to the Earthly Branch?
- %ul.list_stuff
- %li
- The native element of #{@chart.hour.branch.animal.titleize} is #{@chart.hour.native_element.name.titleize}.
- #{@chart.hour.native_element.related_to(Element.by_name(@chart.hour.stem.element))}.
- = render :partial => 'show_comments', :object => @chart.hour.stem._element
- = render :partial => 'show_comments', :object => @chart.hour
- %li
- %p Now synthesize a picture of the character based on these four steps, remembering the precedence of the first ones over the later ones.
-
-
- .inner_to_outer
- %h3
- Inner Element (#{@chart.inner_element.titleize}) and Year Stem (#{@chart.year.stem.element.titleize}):
- #{Element.by_name(@chart.year.stem.element).related_to(Element.by_name(@chart.inner_element))}
- .stars
- - @chart.palaces.each do |chart_palace|
- .chart_palace
- %h3= chart_palace.palace.name
- - chart_palace.stars.each do |star|
- .chart_palace_star
- %h4= star.pinyin
- - star.my_comments(current_member).each do |comment|
- .comment!= RedCloth.new(comment.comments).to_html
- - star.star_palace(chart_palace.palace).my_comments(current_member).each do |comment|
- .comment!= RedCloth.new(comment.comments).to_html
-
+ %ul
+ %li= link_to 'Chart', '#chart'
+ %li= link_to 'Analysis', '#chart_analysis_tabs'
+ #chart
+ - (1..12).map{|t| Branch[t]}.each do |branch|
+ - palace = @chart.palaces[branch]
+ .palace{class: branch.animal}
+ %h3= "#{palace.ordinal}. #{palace.name}"
+ .major_stars
+ - if palace.major_stars.empty?
+ = render partial: 'star', collection: borrowed_stars(palace), locals: {star_class: 'borrowed_star', chart_palace: palace}
+ - else
+ = render partial: 'star', collection: major_stars(palace), locals: {star_class: 'major_star', chart_palace: palace}
+ .minor_stars
+ = render partial: 'star', collection: minor_stars(palace), locals: {star_class: 'minor_star', chart_palace: palace}
+ - if @person
+ %span.small_limits= palace.small_limits(@chart, @person) + " (#{palace.great_limit(@chart, @person)})"
+ %span.palace_location #{palace.location.char} #{palace.location.pinyin} #{palace.location.animal}
+ .center
+ %h2= @name
+ .data= (@person ? @person.dob : @chart.solar_date).strftime '%Y %B %d, %I %p'
+ .data= "#{numeric(@chart.lunar_month)} month / #{numeric(@chart.day_of_month)} day".html_safe
+ .data= "Inner Element: #{@chart.inner_element.titleize}"
+ %table
+ %tr
+ - for name, pillar in {'Year' => @chart.year, 'Month' => @chart.month, 'Day' => @chart.day, 'Hour' => @chart.hour}
+ %td
+ %h3= name
+ .something= pillar.chinese
+ .something= pillar.pinyin
+ .something= pillar.name
+ .title Elemental Score:
+ %table.elemental_scores
+ %tr
+ %td Wood: #{@chart.wood_score}
+ %td Fire: #{@chart.fire_score}
+ %td Earth: #{@chart.earth_score}
+ %td Metal: #{@chart.metal_score}
+ %td Water: #{@chart.water_score}
+ = render partial: 'chart_analysis_tabs'
- if @person

0 comments on commit ca7ee38

Please sign in to comment.