Permalink
Browse files

Merge branch 'master' of git@github.com:yzhang/Confforge

  • Loading branch information...
Zhang Yuanyi Zhang Yuanyi
Zhang Yuanyi authored and Zhang Yuanyi committed Sep 9, 2010
2 parents 9ff03ad + ab23008 commit cfb8ca3188a3fda74cb8a6757d40690a62000cf6
@@ -27,6 +27,9 @@ def pagenav_tab(name, options)
def recommand_link(form)
form.recommanded ? link_to('取消推荐',recommand_admin_form_path(form,:mark => 0),:method => :put) : link_to('推荐',recommand_admin_form_path(form,:mark => 1),:method => :put)
end
-
+
+ def random_color
+ ['194E84','1F242A','60BB22','F2BABB','FFC200','FF5B00','B80028','84002E','4AC0F2'][rand(8)]
+ end
end
@@ -1,37 +1,41 @@
<% if field.multi? %>
-<div class='span-16 prepend-top last'>
- <h4 style="text-align:left"><%= field.name %></h4>
- <section class="span-16 last">
- <% data = field.options.map {|o| @form.klass.count({"f#{field.id}" => Regexp.new('(\s|^)' + o.value + '(\s|$)')})} %>
- <img src="<%= Gchart.pie(:size => '580x200',
- :data => data, :labels => field.options.map(&:value), :theme => :thirty7signals) %>" />
- </section>
+<div class='span-18 prepend-top last'>
+ <h3 style='text-align:left;'><%= field.name %></h3>
+ <section class="span-10">
+ <% data = field.options.map {|o| @form.klass.count({"f#{field.id}" => Regexp.new('(\s|^)' + o.value + '(\s|$)')})} %>
+ <% if field.options.length >= 5 %>
+ <img src="<%= Gchart.bar(:data => data,:axis_with_labels => 'x,y',:axis_labels => [[0,data.max],field.options.map{|f| truncate(f.value,:length => 14)}.reverse],:orientation => 'horizontal',:bar_colors => random_color,:height => field.options.length*30) %>" />
+ <% else %>
+ <img src="<%= Gchart.pie(
+ :data => data, :labels => field.options.map(&:value),:bar_colors => random_color ) %>" />
+ <% end %>
+ </section>
- <section class="span-16 last">
+ <section class="span-8 last">
<table class='grid' id='huizong' cellspacing="0" cellpadding="0">
- <col width='40%'>
+ <col width='80%'>
<col width='20%'>
- <col width='40%'>
<thead>
<tr>
<th>选项</th>
- <th>数量</th>
- <th>百分比</th>
+ <th>数量</th>
</tr>
</thead>
<tbody>
<% field.options.each do |option| %>
- <% option_count = @form.klass.count({"f#{field.id}" => Regexp.new('(\s|^)' + option.value + '(\s|$)')}) %>
+ <% option_count = @form.klass.count({"f#{field.id}" => Regexp.new('(\s|^)' + option.value + '(\s|$)')}) %>
<% percentage = option_count * 100 / @form.rows_count %>
<tr>
- <td><%= option.value %></td>
+ <td style='text-align:left;'><%=option.value%><%#=link_to option.value,chart_form_path(@form,:filter => option) %></td>
<td><%= option_count %></td>
+ <% if false %>
<td style="text-align:left;">
<span class="percentage" style="width:<%= percentage*2 %>px;">&nbsp;</span>
<%= percentage %>%
- </td>
+ </td>
+ <% end %>
</tr>
- <% end %>
+ <% end %>
<tbody>
</table>
</section>
@@ -2,7 +2,7 @@
<span class='title'>小提示</span><br />
需要组织活动,销售门票?<br />
<a href="http://www.51qiangzuo.com">试试我们新的抢座网吧!</a>
-</div>
+</div>
<div class='box'>
抢答所有的服务都是免费的,如果您觉的抢答对您有所帮助,请告诉你的朋友,帮助推广抢答!
<ul class='share'>
@@ -21,4 +21,4 @@
<% content_for :sidebar do %>
<%= render :partial => '/rows/answer_sidebar' %>
-<% end %>
+<% end %>
@@ -8,7 +8,7 @@
<% end -%>
-<div class='span-18'>
+<div class='span-19 last'>
<div class='section_nav'>
<div class='section_title'>
<%= t(:all_surveys) %>
@@ -48,8 +48,8 @@
</div>
</div>
-<% content_for :sidebar do %>
- <%= render :partial => t(:sidebar) %>
+<% content_for :sidebar do %>
+ <%= render :partial => t(:sidebar) %>
<% end %>
<%= content_for :pagenav do -%>
@@ -6,8 +6,8 @@
</style>
<% end %>
<div class='intro span-24 last'>
- <div class='guide span-12'>
- <div class='words span-7'>
+ <div class='guide span-8'>
+ <div class='words span-7 prepend-3'>
<h3><%= t(:simplest_online_survey) %></h3>
<p>
<ul>
@@ -17,14 +17,14 @@
<li><%= t(:password_protect) %></li>
<li><%= t(:easy_export) %></li>
</ul>
- </p>
+ </p>
<p>&nbsp;</p>
<p><a href='/demo' class='btn'><%= t(:try_with_demo) %></a></p>
<p><%= t(:have_an_account) %> <%= link_to t(:login), login_path ,:class => 'ag' %></p>
- </div>
+ </div>
</div>
- <div class='span-10 last'>
+ <div class='span-8 prepend-2 last'>
<%=image_tag 'form.jpg',:class=>'haibao'%>
</div>
-</div>
+</div>
@@ -2,12 +2,18 @@
<%= stylesheet_link_tag 'page' %>
<% end %>
-<%= content_for :pagenav do -%>
<div id="page_nav">
<span><%=@page.title%></span>
</div>
-<% end %>
<div id='page'>
<%= raw(@page.body) %>
</div>
+
+<% content_for :sidebar do %>
+ <ul class='sidebar_nav'>
+ <% Page.all.each do |page| %>
+ <li><%=link_to page.title,"/#{page.slug}"%></li>
+ <% end %>
+ </ul>
+<% end %>
@@ -1,5 +1,5 @@
<div class='box'>
- <ul class='sidebar_nav'>
+ <ul class='sidebar_nav'>
<li class="<%= 'current' if @tab == 'answers' %>"><%=link_to t(:answers), form_rows_path(@form, :edit_key => @form.edit_key) %> </li>
<li class="<%= 'current' if @tab == 'chart' %>"><%= link_to t(:report), chart_form_path(@form)%></li>
<li class="<%= 'current' if @tab == 'stats' %>"><%= link_to t(:visits), stats_form_path(@form) %></li>
@@ -13,4 +13,8 @@
<%=raw t(:sandsroad) %>
</span>
</div>
-
+<div style='text-align:center;'>
+ <%= link_to 'English', lang_path(:locale => 'en'), :method => 'put' %> |
+ <%= link_to '简体', lang_path(:locale => 'zh-CN'), :method => 'put' %> |
+ <%= link_to '繁体', lang_path(:locale => 'zh-TW'), :method => 'put' %>
+</div>
@@ -33,11 +33,6 @@
<% end %>
</div>
<% end %>
- <p>
- <%= link_to 'English', lang_path(:locale => 'en'), :method => 'put' %> |
- <%= link_to '简体', lang_path(:locale => 'zh-CN'), :method => 'put' %> |
- <%= link_to '繁体', lang_path(:locale => 'zh-TW'), :method => 'put' %>
- </p>
<%= render :partial => '/shared/notice' %>
</div>
</div>
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -77,8 +77,8 @@ div.question p{
height:20px;
padding:5px 10px 15px 0px;
*padding:5px 10px 0px 0px;
- margin:10px 0px 15px;
- border-bottom:1px solid #ccc;
+ margin:0px 0px 15px;
+ border-bottom:1px solid #efefef;
}
#page_nav span{
@@ -183,7 +183,6 @@ form.login_form{
padding:10px;
}
-.words{padding-left:110px;}
.words,.words h1,.words p{
text-align:center;
line-height:200%;
@@ -264,7 +263,7 @@ form.login_form{
.nav{
height:30px;
clear:both;
- border-bottom:1px solid #ccc;
+ border-bottom:1px solid #efefef;
}
.nav ul{
@@ -502,6 +501,7 @@ table.grid tr.highlighted{
background:#EFEFEF;
color:#666;
line-height:21px;
+ padding:10px;
}
h4.tip{
@@ -541,6 +541,7 @@ h4.tip{
/* -- home -- */
.intro{
line-height:0px;
+ margin-bottom:20px;
}
#logos{
@@ -597,22 +598,26 @@ input.btn, button.btn {
/* -- page ---*/
#page p{
- line-height:25px;
+ line-height:150%;
color:#666;
- font-size:13px;
+ font-size:12px;
}
#page h3,h4,h2{
- font-family:'微软雅黑' arial '宋体';
clear:both;
color:#666;
padding: 0 10px;
}
#page h3{
- padding:10px;
+ padding:10px 0;
font-size:18px;
- border-bottom:1px solid #ccc;
+ border-bottom:1px solid #efefef;
+}
+
+#page h4{
+ padding:10px 0;
+ font-size:12px;
}
#page .haibao{
@@ -629,7 +634,7 @@ input.btn, button.btn {
/* -- section ----*/
.section_nav{
height:27px;
- margin-bottom:10px;
+ margin:20px;
border-bottom:2px solid #efefef;
}
@@ -649,7 +654,8 @@ input.btn, button.btn {
.sidebar_nav li a{
border-bottom:1px solid #efefef;
display:block;
- padding:2px 10px;
+ padding:0px 10px;
+ margin:10px 0px 0px;
}
.sidebar_nav li a:hover, .sidebar_nav li.current a{

0 comments on commit cfb8ca3

Please sign in to comment.