Merge branch 'master' into desktop

* master: (57 commits)
  Add translations
  Add mobile version in site settings
  Add mobile but remove news in it
  Remove mysql
  Fix album widget options
  Fix link for ad_banner Add missing helper for web_link_category Show design's js in front-end
  Add link to default widget (temporary)
  Ika's fix for width
  Ika's fix for width
  Gallery i18n
  Ika's changes for css default widgets
  Ika's changes for css default widgets
  change bulletin object to bulletin title
  fixing default widget error when needs image
  make default widget works without init
  Fix order in structure
  Fix old tags
  correct pic file format
  complete page error handler logic
  change sub_menu to header in site setting
  ...
This commit is contained in:
Rueshyna committed 2013-01-07 16:44:05 +08:00
commit a34da20e48
144 files changed
+8148 -583

No files matched your search

@@ -11,4 +11,8 @@ $("#ad_banner-tab-content").children(".tab-pane").removeClass("active");
$('#post-body-content').find(".nav.nav-tabs").children('li[id!="new_ad_banner_tab_but"]').last().addClass("active");
$("#ad_banner-tab-content").children(".tab-pane").last().addClass("active");
<% if params[:action] && params[:action] =='create'%>
var trigger = $("#ad_banner-tab-content").children(".tab-pane").last().find(".preview_trigger");
new_url = trigger.attr("href").replace(/\/admin\/ad_banners\/.*\/preview/gi,"/admin/ad_banners/<%= @ad_banner.id %>/preview");
trigger.attr("href",new_url);
<% end %>
@@ -3,4 +3,4 @@
</ol>
<script type="text/javascript">
bindTreeDragHandle();
</script>
</script>
+1 -1
View File
@@ -14,4 +14,4 @@
<p>
<%= f.submit t(:update_) %> <%= link_back %>
</p>
<% end %>
<% end %>
@@ -46,7 +46,6 @@
<%#= select_tag "page_part[widget_field][]", options_for_select(@module_app.widget_fields.collect{|widget_field| [widget_field.humanize, widget_field]}, @part.widget_field.collect{|widget_field| widget_field}), {:multiple => :multiple, :size => 6} %>
</span>
<div id="widget_data_count">
<%= f.label :widget_data_count %>
<%= f.text_field :widget_data_count %>
</div>
<span id="widget_options">
<%= render 'widget_options' %>
</span>
@@ -1,4 +1,3 @@
<% if (@module_app && @module_app.widget_fields) %>
<%= label_tag('widget_field') %>
@@ -9,4 +8,6 @@
<%= select_tag "page_part[widget_field_type][]", options_for_select(LIST[:widget_field_type].collect{|widget_field| [widget_field.humanize, widget_field]}, (@part[:widget_field][i][1] if (@part && !@part[:widget_field].blank? && !@part[:widget_field][i].blank?)) ), :include_blank => true %> <br />
<% end %>
<%= label_tag :widget_data_count %>
<%= text_field_tag :widget_data_count,@part.widget_data_count %>
<% end %>
@@ -0,0 +1,17 @@
<% if (@module_app && @module_app.widget_options) %>
<%= label_tag('widget_options') %>
<% if @module_app.key.eql?('gallery') %>
<%= t('gallery.gallery') %>
<%= select_tag "page_part[widget_options][album_id]", options_from_collection_for_select(@albums, :id, :name, :selected => (@part.widget_options[key] rescue nil)) %>
<% end %>
<% if @module_app.widget_options.has_key? @part.widget_path%>
<% @module_app.widget_options[@part.widget_path].each do |key,options| %>
<%= label_tag(t(@module_app.widget_options_fields_i18n[@part.widget_path][key]))%>
<%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)) %>
<!-- (@part[:widget_field][i][0] if (@part && !@part[:widget_field].blank? && !@part[:widget_field][i].blank?)) ) -->
<% end %>
<% end %>
<% end %>
@@ -2,4 +2,6 @@ $('#widget_list select').html("<%= j options_for_select(@module_app.widgets.coll
$('#widget_style_list').html("<%= escape_javascript(select 'page_part', 'widget_style', @module_app.widgets[@widget_path]) if !@widget_path.blank? %>");
$('#widget_field').html("<%= j render 'widget_fields' %>");
$('#widget_category').html("<%= j render 'widget_categories' %>");
$('#widget_tag').html("<%= j render 'widget_tags' %>");
$('#widget_tag').html("<%= j render 'widget_tags' %>");
$("#widget_options").html("<%= j render 'widget_options'%>");
+114 -104
View File
@@ -1,112 +1,122 @@
<% # encoding: utf-8 %>
<% content_for :side_bar do %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
<%= render :partial => 'layouts/side_bar', :locals => {:link_name => t('site.settings'), :link_url => admin_site_site_info_path(@site), :icon => 'icons-cog', :side_bar_content => 'admin/sites/side_bar'} %>
<% end %>
<div id="poststuff">
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "clear"} do |f| %>
<div id="post-body">
<div id="post-body-content" class="clear">
<ul class="nav nav-tabs">
<% @site_valid_locales.each do |locale|%>
<%#= raise @site_valid_locales.inspect %>
<%= content_tag :li, link_to(I18nVariable.from_locale(locale), ".#{locale}", :data => {:toggle => "tab"}), :class => (active_when_current_locale_eq locale) %>
<% end %>
</ul>
<div class="tab-content form-horizontal">
<div class="control-group" style="margin-bottom: 0;">
<div class="controls">
<label class="checkbox">
<%= f.check_box :title_always_on %> <%= t :always_display_title %>
</label>
</div>
</div>
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group">
<label class="control-label"><%= t 'site.title' %></label>
<div class="controls">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-xxlarge", :value => (@site.title_translations[locale] rescue nil) %>
<% end %>
<p class="help-block"><%= (t 'site.title_help').html_safe %></p>
</div>
</div>
<% end %>
<% end %>
<div class="control-group">
<label class="control-label"><%= t 'site.search' %></label>
<div class="controls">
<%= text_field_tag 'site[search][domains]',(@site.search["domains"] rescue nil), {:class => "input-xxlarge" ,:placeholder => t("search.domains") }%>
<%= text_field_tag 'site[search][sitesearch]',(@site.search["sitesearch"] rescue nil),{ :class => "input-xxlarge" ,:placeholder => t("search.sitesearch") }%>
<p class="help-block"><%= (t 'site.search_help').html_safe %></p>
</div>
</div>
<%= form_for @site, :url => admin_site_path(@site), :html => {:class => "clear"} do |f| %>
<div id="post-body">
<div id="post-body-content" class="clear">
<ul class="nav nav-tabs">
<% @site_valid_locales.each do |locale|%>
<%#= raise @site_valid_locales.inspect %>
<%= content_tag :li, link_to(I18nVariable.from_locale(locale), ".#{locale}", :data => {:toggle => "tab"}), :class => (active_when_current_locale_eq locale) %>
<% end %>
</ul>
<div class="tab-content form-horizontal">
<div class="control-group" style="margin-bottom: 0;">
<div class="controls">
<label class="checkbox">
<%= f.check_box :title_always_on %> <%= t :always_display_title %>
</label>
</div>
</div>
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group">
<label class="control-label"><%= t 'site.title' %></label>
<div class="controls">
<%= f.fields_for :title_translations do |f| %>
<%= f.text_field locale, :class => "input-xxlarge", :value => (@site.title_translations[locale] rescue nil) %>
<% end %>
<p class="help-block"><%= (t 'site.title_help').html_safe %></p>
</div>
</div>
<% end %>
<% end %>
<div class="control-group">
<label class="control-label"><%= t 'site.search' %></label>
<div class="controls">
<%= text_field_tag 'site[search][domains]',(@site.search["domains"] rescue nil), {:class => "input-xxlarge" ,:placeholder => t("search.domains") }%>
<%= text_field_tag 'site[search][sitesearch]',(@site.search["sitesearch"] rescue nil),{ :class => "input-xxlarge" ,:placeholder => t("search.sitesearch") }%>
<p class="help-block"><%= (t 'site.search_help').html_safe %></p>
</div>
</div>
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group">
<label class="control-label"><%= t 'site.keywords' %></label>
<div class="controls">
<%= f.fields_for :keywords do |f| %>
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s", :value => (@site.keywords(locale) rescue nil) %>
<% end %>
<p class="help-block"><%= (t 'site.keywords_help').html_safe %></p>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'site.description' %></label>
<div class="controls">
<%= f.fields_for :description do |f| %>
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s", :value => (@site.description(locale) rescue nil) %>
<% end %>
<p class="help-block"><%= (t 'site.description_help').html_safe %></p>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'site.footer' %></label>
<div class="controls">
<%= f.fields_for :footer_translations do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge", :value => (@site.footer_translations[locale] rescue nil) %>
<% end %>
<p class="help-block"><%= (t 'site.footer_help').html_safe %></p>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'site.sub_menu' %></label>
<div class="controls">
<%= f.fields_for :sub_menu_translations do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge", :value => (@site.sub_menu_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'site.default_image' %></label>
<div class="controls">
<%= f.file_field :default_image, :id => "input-upload", :class => 'upload', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>
<span id='fu' class="file-name"></span>
<!--請程式務必將圖片尺寸加入到行內裡-->
<% if @site.default_image %>
<%= image_tag( @site.default_image, :size=>"120x120") rescue ''%>
<% else %>
<img class="pull-left upload-picture" src="/assets/default-img.png" />
<% end %>
<br>
<% if @site.default_image.file %>
<%= f.check_box :remove_default_image %>
<%= t('刪除已上傳檔案') %>
<% end %>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
<div class="form-actions">
<%= f.submit t("submit"), :class => "btn btn-primary" %>
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
</div>
<% end %>
<% @site_valid_locales.each do |locale|%>
<%= content_tag :div, :class => "tab-pane fade #{active_when_current_locale_eq locale} #{locale}" do %>
<div class="control-group">
<label class="control-label"><%= t 'site.keywords' %></label>
<div class="controls">
<%= f.fields_for :keywords do |f| %>
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s", :value => (@site.keywords(locale) rescue nil) %>
<% end %>
<p class="help-block"><%= (t 'site.keywords_help').html_safe %></p>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'site.description' %></label>
<div class="controls">
<%= f.fields_for :description do |f| %>
<%= f.text_area locale, :class => "input-xxlarge textarea-height-s", :value => (@site.description(locale) rescue nil) %>
<% end %>
<p class="help-block"><%= (t 'site.description_help').html_safe %></p>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'site.header' %></label>
<div class="controls">
<%= f.fields_for :sub_menu_translations do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge", :value => (@site.sub_menu_translations[locale] rescue nil) %>
<% end %>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'site.footer' %></label>
<div class="controls">
<%= f.fields_for :footer_translations do |f| %>
<%= f.text_area locale, :class => "tinymce_textarea input-xxlarge", :value => (@site.footer_translations[locale] rescue nil) %>
<% end %>
<p class="help-block"><%= (t 'site.footer_help').html_safe %></p>
</div>
</div>
<div class="control-group">
<label class="control-label"><%= t 'site.default_image' %></label>
<div class="controls">
<%= f.file_field :default_image, :id => "input-upload", :class => 'upload', :onchange => "document.getElementById('fu').innerHTML = this.form.fu.value = this.value;" %>
<span id='fu' class="file-name"></span>
<!--請程式務必將圖片尺寸加入到行內裡-->
<% if @site.default_image %>
<%= image_tag( @site.default_image, :size=>"120x120") rescue ''%>
<% else %>
<img class="pull-left upload-picture" src="/assets/default-img.png" />
<% end %>
<br>
<% if @site.default_image.file %>
<label class="checkbox">
<%= check_box_tag 'site[remove_default_image]' %>
<%= t('delete') %>
</label>
<% end %>
</div>
</div>
<% end %>
<% end %>
<div class="control-group" style="margin-bottom: 0;">
<label class="control-label"><%= t 'site.mobile_version' %></label>
<div class="controls">
<label class="checkbox">
<%= f.check_box :mobile_on %>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="form-actions">
<%= f.submit t("submit"), :class => "btn btn-primary" %>
<%= f.submit t("cancel"), :class => "btn ", :type => 'reset' %>
</div>
<% end %>
</div>
+25
View File
@@ -0,0 +1,25 @@
<%= content_tag :div,:class=>@tag_class do%>
<div class="defulat_widget_type_A">
<table class="defulat_widget_tb" border="0" cellpadding="0" cellspacing="0" >
<thead>
<tr>
<% @fields.each do |field|%>
<th><%= content_tag(:span,field[0],:class=>field[1])%></th>
<% end %>
</tr>
</thead>
<% @data.each do |row_data| %>
<tr>
<% @fields.each do |field|%>
<% if field[0] == "bulletin_category"%>
<td><%= content_tag(:span,row_data.send(field[0]).title,:class=>field[1])%></td>
<% elsif field[0] == "title" %>
<td><%= content_tag(:span, link_to(row_data.send(field[0]), panel_announcement_front_end_bulletin_path(row_data)), :class=>field[1]) %></td>
<% else %>
<td><%= content_tag(:span,row_data.send(field[0]),:class=>field[1])%></td>
<% end %>
<% end %>
</tr>
<% end %>
</table>
<% end %>
+23
View File
@@ -0,0 +1,23 @@
<%= content_tag :div,:class=>@tag_class do%>
<ul class="defulat_widget_list">
<% @data.each do |row_data| %>
<%= content_tag(:li) do %>
<div class="img app-pic">
<%= image_tag row_data.send(@widget_image_field)%>
</div>
<div class="wrap">
<% @fields.each do |field|%>
<% if field[0] == "bulletin_category"%>
<%= content_tag(:span,row_data.send(field[0]).title,:class=>field[1])%>
<% elsif field[0] == "title" %>
<%= content_tag(:span, link_to(row_data.send(field[0]), panel_announcement_front_end_bulletin_path(row_data)), :class=>field[1]) %>
<% else %>
<%= content_tag(:span,row_data.send(field[0]),:class=>field[1])%>
<% end %>
<% end %>
</div>
<% end %>
<% end %>
</ul>
<div class="more">more</div>
<% end %>
+21
View File
@@ -0,0 +1,21 @@
<%= content_tag :div,:class=>@tag_class do%>
<div class="img app-pic">
<%= image_tag @data.first.send(@widget_image_field)%>
</div>
<ul class="defulat_widget_list">
<% @data.each do |row_data| %>
<%= content_tag(:li) do %>
<% @fields.each do |field|%>
<% if field[0] == "bulletin_category"%>
<%= content_tag(:span,row_data.send(field[0]).title,:class=>field[1])%>
<% elsif field[0] == "title" %>
<%= content_tag(:span, link_to(row_data.send(field[0]), panel_announcement_front_end_bulletin_path(row_data)), :class=>field[1]) %>
<% else %>
<%= content_tag(:span,row_data.send(field[0]),:class=>field[1])%>
<% end %>
<% end %>
<% end %>
<% end %>
</ul>
<div class="more">more</div>
<% end %>
+1 -1
View File
@@ -19,7 +19,7 @@
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>
<% (images = @ad_banner.ad_images).shuffle.each do |ad_image| %>
<% if ad_image.display? %>
<img src='<%= ad_image.file %>' alt='<%= ad_image.title || ' ' %>' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= (ad_image.direct_to_after_click? ? ad_image.out_link : ad_image.context) || ' ' %>' link_url='<%= (ad_image.out_link) %>' style=' <%= 'cursor:pointer;' if !ad_image.out_link.blank? %>'/>
<img src='<%= ad_image.file %>' alt='<%= ad_image.title || ' ' %>' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= (ad_image.out_link) %>' style=' <%= 'cursor:pointer;' if !ad_image.out_link.blank? %>'/>
<% end %>
<% end %>
</div>
+1 -1
View File
@@ -1,7 +1,7 @@
<% if @menu_page && @menu_page.visible_children.size > 0 %>
<div class='category_list'>
<h3 class='h3'><%= @menu_page.title %></h3>
<ul class='list'>"
<ul class='list'>
<% @menu_page.visible_children.each do |child| %>
<li class="<%= @page_id.eql?(child.id) ? 'active' : nil %>">
<a href="<%= (child.class.to_s.eql?('Page') ? '/' + child.path : child.url) %>"><%= child.title %></a>
+11
View File
@@ -0,0 +1,11 @@
<%# Link to the "First" page
- available local variables
url: url to the first page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="first">
<%= link_to_unless current_page.first?, "«", url, :remote => remote %>
</li>
+8
View File
@@ -0,0 +1,8 @@
<%# Non-link tag that stands for skipped pages...
- available local variables
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<!-- <li class="page gap"><%= raw(t 'views.pagination.truncate') %></li> -->
+11
View File
@@ -0,0 +1,11 @@
<%# Link to the "Last" page
- available local variables
url: url to the last page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="last">
<%= link_to_unless current_page.last?, "»", url, {:remote => remote} %>
</li>
+11
View File
@@ -0,0 +1,11 @@
<%# Link to the "Next" page
- available local variables
url: url to the next page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="next">
<%= link_to_unless current_page.last?, '›', url, :rel => 'next', :remote => remote %>
</li>
+16
View File
@@ -0,0 +1,16 @@
<%# Link showing page number
- available local variables
page: a page object for "this" page
url: url to this page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="page<%= ' active' if page.current? %>">
<% if page.current? %>
<a><%= page %></a>
<% else %>
<%= link_to page, url, opts = {:remote => remote, :rel => page.next? ? '›' : page.prev? ? '‹' : nil} %>
<% end %>
</li>
+25
View File
@@ -0,0 +1,25 @@
<%# The container tag
- available local variables
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
paginator: the paginator that renders the pagination tags inside
-%>
<%= paginator.render do -%>
<div class="pagination">
<ul>
<%= first_page_tag unless current_page.first? %>
<%= prev_page_tag unless current_page.first? %>
<% each_page do |page| -%>
<% if page.left_outer? || page.right_outer? || page.inside_window? -%>
<%= page_tag page %>
<% elsif !page.was_truncated? -%>
<%= gap_tag %>
<% end -%>
<% end -%>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</ul>
</div>
<% end -%>
+11
View File
@@ -0,0 +1,11 @@
<%# Link to the "Previous" page
- available local variables
url: url to the previous page
current_page: a page object for the currently displayed page
num_pages: total number of pages
per_page: number of items to fetch per page
remote: data-remote
-%>
<li class="prev">
<%= link_to_unless current_page.first?, '‹', url, :rel => 'prev', :remote => remote %>
</li>
+78 -78
View File
@@ -1,83 +1,83 @@
<header id="orbit-bar" class="navbar">
<div class="navbar-inner">
<div class="container clear">
<div class="dropdown orbit-logo pull-left">
<% if !current_user.nil? %>
<%= render :partial=>"layouts/member_orbit_menu"%>
<% else %>
<%= render :partial=>"layouts/guest_orbit_menu"%>
<% end -%>
</div>
<ul class="nav">
<li><%= link_to '', root_path, {'data-icon' => 'house'} %></li>
<!-- <li><%= link_to '', desktop_path, {'data-icon' => 'desktop'} %></li> -->
</ul>
<ul class="nav pull-right">
<li class="dropdown language">
<a class="dropdown-toggle" href="#" data-toggle="dropdown" data-icon="earth"></a>
<ul class="dropdown-menu language-menu">
<% @site_in_use_locales.each do |locale| %>
<%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil) %>
<% end %>
</ul>
<div class="navbar-inner">
<div class="container clear">
<div class="dropdown orbit-logo pull-left">
<% if !current_user.nil? %>
<%= render :partial=>"layouts/member_orbit_menu"%>
<% else %>
<%= render :partial=>"layouts/guest_orbit_menu"%>
<% end -%>
</div>
<ul class="nav">
<li><%= link_to '', root_path, {'data-icon' => 'house'} %></li>
<!-- <li><%= link_to '', desktop_path, {'data-icon' => 'desktop'} %></li> -->
</ul>
<ul class="nav pull-right">
<li class="dropdown language">
<a class="dropdown-toggle" href="#" data-toggle="dropdown" data-icon="earth"></a>
<ul class="dropdown-menu language-menu">
<% @site_in_use_locales.each do |locale| %>
<%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil) %>
<% end %>
</ul>
</li>
<li class="search clear" title="<%= t :search_google %>">
<a class="orbit-bar-search" href="#" data-icon="search"></a>
<form class="navbar-search" method="get" action="http://www.google.com/custom">
<input type="hidden" name="client" value="pub-&amp" />
<input type="hidden" name="ie" id="ie" value="utf-8" />
<input type="hidden" name="oe" id="oe" value="utf-8" />
<input type="hidden" name="cof" id="cof" value="AH:center;AWFID:03de271f1940eea3;" />
<input type='hidden' name='domains' value='<%= @site.search["domains"] rescue ''%>'>
<input type='hidden' name='sitesearch' value='<%= @site.search["sitesearch"] rescue '' %>'>
<%= text_field_tag 'q','',{:class => "search-query span3",:placeholder=> t(:search_google) ,:disabled=> ((@site.search["sitesearch"] || @site.search["domains"] ).blank? rescue true)}%>
</form>
</li>
<% if user_signed_in? %>
<li class="dropdown active">
<a class="orbit-bar-account" href="#" data-toggle="dropdown">
<img class="member-img" src="/assets/person.png" />
<%#= image_tag current_user.avatar.thumb.url, :class => 'member-img' %>
<span class="member-name"><%= current_user.name %></span>
</a>
<ul class="dropdown-menu account-menu">
<!-- <li><%= link_to content_tag(:i, nil, :class => 'icons-tools') + ' ' + t(:account_setting), desktop_path+"#settings-account" %></li> -->
<!-- <li><%= link_to content_tag(:i, nil, :class => 'icons-desktop') + ' ' + t(:desktop), desktop_path %></li> -->
<li><%= link_to content_tag(:i, nil, :class => 'icons-outlog') + ' ' + t(:logout), destroy_user_session_path %></li>
<li class="divider"></li>
<li>
<a href="#">
<i class="icons-help"></i>
<%= t(:help) %>
</a>
</li>
</ul>
</li>
<li class="search clear" title="<%= t :search_google %>">
<a class="orbit-bar-search" href="#" data-icon="search"></a>
<form class="navbar-search" method="get" action="http://www.google.com/custom">
<input type="hidden" name="client" value="pub-&amp" />
<input type="hidden" name="ie" id="ie" value="utf-8" />
<input type="hidden" name="oe" id="oe" value="utf-8" />
<input type="hidden" name="cof" id="cof" value="AH:center;AWFID:03de271f1940eea3;" />
<input type='hidden' name='domains' value='<%= @site.search["domains"] rescue ''%>'>
<input type='hidden' name='sitesearch' value='<%= @site.search["sitesearch"] rescue '' %>'>
<%= text_field_tag 'q','',{:class => "search-query span3",:placeholder=> t(:search_nccu) ,:disabled=> ((@site.search["sitesearch"] || @site.search["domains"] ).blank? rescue true)}%>
</form>
</li>
<% if user_signed_in? %>
<li class="dropdown active">
<a class="orbit-bar-account" href="#" data-toggle="dropdown">
<img class="member-img" src="/assets/person.png" />
<%#= image_tag current_user.avatar.thumb.url, :class => 'member-img' %>
<span class="member-name"><%= current_user.name %></span>
</a>
<ul class="dropdown-menu account-menu">
<!-- <li><%= link_to content_tag(:i, nil, :class => 'icons-tools') + ' ' + t(:account_setting), desktop_path+"#settings-account" %></li> -->
<!-- <li><%= link_to content_tag(:i, nil, :class => 'icons-desktop') + ' ' + t(:desktop), desktop_path %></li> -->
<li><%= link_to content_tag(:i, nil, :class => 'icons-outlog') + ' ' + t(:logout), destroy_user_session_path %></li>
<li class="divider"></li>
<li>
<a href="#">
<i class="icons-help"></i>
<%= t(:help) %>
</a>
</li>
</ul>
</li>
<% else %>
<li class="dropdown bar-login">
<a class="dropdown-toggle orbit-bar-member" href="#" data-icon="inlog"></a>
<div class="dropdown-menu">
<ul class="log">
<li class="title hide"></li>
<%= form_for :user, :url => user_session_path do |f| %>
<li>
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<%= f.text_field :email, :class => 'span2', :placeholder => t(:email), :size => 16 %>
</div>
</li>
<li>
<div class="input-prepend">
<span class="add-on"><i class="icon-lock"></i></span>
<%= f.password_field :password, :class => 'span2', :placeholder => t(:password), :size => 16 %>
</div>
</li>
<li class="clear hide">
<%= link_to t(:forgot_password), new_user_password_path, :class => 'forgot' %>
</li>
<li>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
<% else %>
<li class="dropdown bar-login">
<a class="dropdown-toggle orbit-bar-member" href="#" data-icon="inlog"></a>
<div class="dropdown-menu">
<ul class="log">
<li class="title hide"></li>
<%= form_for :user, :url => user_session_path do |f| %>
<li>
<div class="input-prepend">
<span class="add-on"><i class="icon-user"></i></span>
<%= f.text_field :email, :class => 'span2', :placeholder => t(:email), :size => 16 %>
</div>
</li>
<li>
<div class="input-prepend">
<span class="add-on"><i class="icon-lock"></i></span>
<%= f.password_field :password, :class => 'span2', :placeholder => t(:password), :size => 16 %>
</div>
</li>
<li class="clear hide">
<%= link_to t(:forgot_password), new_user_password_path, :class => 'forgot' %>
</li>
<li>
<%= content_tag :button, t(:login), :type => :submit, :class => 'btn btn-primary' %>
</li>
<li class="divider hide"><span><%= t(:or_lower) %></span></li>
+65
View File
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<base href=<%= "#{request.protocol}#{request.host_with_port}/mobile/"%>>
<title><%= @site.title %><%= (' - ' + @page_title) if @page_title %></title>
<%= stylesheet_link_tag "mobile" %>
<%= javascript_include_tag "mobile" %>
<%= javascript_include_tag "http://maps.google.com/maps/api/js?sensor=false&libraries=places" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- <meta name="apple-itunes-app" content="app-id=342792525, app-argument=imdb:///?src=mdot"> -->
<meta name="description" content="">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0">
<!-- iPhone -->
<link href="<%= asset_path 'mobile/apple-startup-iPhone.png' %>" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPhone (Retina) -->
<link href="<%= asset_path 'mobile/apple-startup-iPhone-RETINA.png' %>" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPhone 5 -->
<link href="<%= asset_path 'mobile/apple-startup-iPhone-Tall-RETINA.png' %>" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPad Portrait -->
<link href="<%= asset_path 'mobile/apple-startup-iPad-Portrait.png' %>" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPad Landscape -->
<link href="<%= asset_path 'mobile/apple-startup-iPad-Landscape.png' %>" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" rel="apple-touch-startup-image">
<!-- iPad Portrait (Retina) -->
<link href="<%= asset_path 'mobile/apple-startup-iPad-RETINA-Portrait.png' %>" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPad Landscape (Retina) -->
<link href="<%= asset_path 'mobile/apple-startup-iPad-RETINA-Landscape.png' %>" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" rel="apple-touch-startup-image">
<!-- iPhone icon -->
<link rel="apple-touch-icon-precomposed" href="<%= asset_path 'mobile/apple-touch-icon.png' %>">
<!-- iPhone icon (Retina) -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<%= asset_path 'mobile/apple-touch-icon@2x.png' %>">
<!-- iPad icon -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<%= asset_path 'mobile/apple-touch-icon-ipad.png' %>">
<!-- iPad icon (Retina) -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<%= asset_path 'mobile/apple-touch-icon-ipad@2x.png' %>">
</head>
<body>
<div data-role="page" data-url="<%= request.fullpath %>" id="<%= params[:action] %>" data-add-back-btn="<%= params[:action].eql?('index')? nil : 'true' %>">
<section class="global">
<% if !(yield :header).blank? %>
<%= yield :header %>
<% else %>
<%= render 'header' %>
<% end unless @no_header %>
<%= render 'menu' unless @no_menu %>
<section class="content">
<%= yield %>
</section>
<%= render 'footer' unless @no_footer %>
</section>
</div>
</body>
</html>
+24
View File
@@ -0,0 +1,24 @@
<footer class="footer" data-role="footer" data-position="fixed">
<div data-role="navbar">
<ul>
<li>
<%= link_to mobile_dialog_copyright_path, {"data-transition" => "flip", "data-rel" => "dialog", "data-inline" => "true"} do %>
<i class="icons-information"></i>
<%= t('mobile.copyright') %>
<% end %>
</li>
<li>
<%= link_to mobile_map_path, {"data-transition" => "flip"} do %>
<i class="icons-location"></i>
<%= t('mobile.location') %>
<% end %>
</li>
<li>
<%= link_to mobile_dialog_contact_path, {"data-rel" => "dialog"} do %>
<i class="icons-phone"></i>
<%= t('mobile.contact') %>
<% end %>
</li>
</ul>
</div>
</footer>
+9
View File
@@ -0,0 +1,9 @@
<header class="header" data-role="header">
<h1 class="openmenu">
<%= image_tag asset_path('mobile/logo.png') %>
</h1>
<i class="openmenu icons-arrow-bottom-e"></i>
<%= link_to mobile_dialog_language_path, {:class => "ui-btn-right language", "data-iconpos" => "notext", "data-icon" => "search", "data-rel" => "dialog"} do %>
<i class="icons-earth"></i>
<% end %>
</header>
@@ -0,0 +1,3 @@
<header data-role="header" data-theme="d">
<h1><%= t('mobile.contact') %></h1>
</header>
@@ -0,0 +1,3 @@
<header data-role="header" data-theme="d">
<h1><%= t('mobile.copyright') %></h1>
</header>
@@ -0,0 +1,3 @@
<div data-role="header" data-theme="c">
<h3><%= t('mobile.language') %></h3>
</div>
+3
View File
@@ -0,0 +1,3 @@
<div data-role="header">
<h1><%= t('mobile.location') %></h1>
</div>
@@ -0,0 +1,9 @@
<div data-role="dialog" id="language_select">
<div data-role="content" data-theme="c">
<h3><%= t('mobile.language') %></h3>
<% @site_in_use_locales.each do |locale| %>
<%= link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale), {"data-role" => "button", "data-theme" => "b", "data-shadow" => "true"} %>
<% end %>
<a href="#" data-role="button" data-mini="true" data-rel="back" data-theme="a"><%= t('mobile.cancel') %></a>
</div>
</div>
+7
View File
@@ -0,0 +1,7 @@
<section class="main-menu">
<ul class="clear">
<li><%= link_to content_tag(:i, nil, :class => "icons-house") + content_tag(:span, t('mobile.home')), mobile_path %></li>
<li><%= link_to content_tag(:i, nil, :class => "icons-megaphone") + content_tag(:span, t('mobile.bulletin')), mobile_announcement_path %></li>
<li><%= link_to content_tag(:i, nil, :class => "icons-page") + content_tag(:span, t('mobile.page')), mobile_page_path %></li>
</ul>
</section>
+13
View File
@@ -0,0 +1,13 @@
<ul data-role="listview" class="list">
<% @bulletins.each do |bulletin| %>
<li data-corners="false" data-shadow="false" data-iconshadow="true" data-wrapperels="div" data-icon="arrow-r" data-iconpos="right" data-theme="c">
<%= link_to mobile_announcement_content_path(bulletin), :class => "ui-link-inherit" do %>
<%= image_tag bulletin.image.url, :class => "ui-li-thumb" %>
<h3><%= bulletin.title %></h3>
<p class="ui-li-aside ui-li-desc"><%= display_date(bulletin.postdate) %></p>
<div class="ui-li-desc"><%= bulletin.subtitle %></div>
<% end %>
</li>
<% end %>
</ul>
<%= paginate @bulletins, :param_name => :page_main, :window => 2 %>
@@ -0,0 +1,6 @@
<div class="newpic">
<%= image_tag @bulletin.image.url %>
</div>
<h3 class="newstitle"><%= @bulletin.title %></h3>
<p class="newsDate"><%= display_date_time(@bulletin.postdate) %></p>
<div class="newsummary"><%= @bulletin.text.html_safe rescue '' %></div>
@@ -0,0 +1,11 @@
<%= content_for :header do %>
<%= render 'header_dialog_contact' %>
<% end %>
<ul>
<li>總機電話:<a href="tel:+886229393091">02-29393091</a></li>
<li>傳真:02-29379611</li>
<li>緊急重大事件通聯窗口:校內分機 66119、66110</li>
<li>總值日室:<a href="tel:+88229387132">02-29387132</a></li>
<li>駐警衛室:<a href="tel:+88229387129">02-29387129</a></li>
</ul>
@@ -0,0 +1,6 @@
<%= content_for :header do %>
<%= render 'header_dialog_copyright' %>
<% end %>
<p>本網站著作權屬於國立政治大學。</p>
<p>RulingDigital 銳綸數位建置</p>
@@ -0,0 +1,7 @@
<%= content_for :header do %>
<%= render 'header_dialog_language' %>
<% end %>
<% @site_in_use_locales.each do |locale| %>
<%= link_to t(:_locale, :locale => locale), add_locale(remove_locale((request.referer rescue request.fullpath)), locale), {"data-role" => "button", "data-theme" => "b", "data-shadow" => "true"} %>
<% end %>
+19
View File
@@ -0,0 +1,19 @@
<div class="slideshow">
<% @ad_banner.ad_images.each do |image| %>
<div class="slidebanner"><%= image_tag image.file.url, :class => 'slideImg' %></div>
<% end %>
</div>
<div class="newlist clear">
<% @bulletins.each do |bulletin| %>
<div class="newitem">
<div class="newpic">
<%= image_tag bulletin.image.url %>
</div>
<h3 class="newstitle">
<%= link_to bulletin.title, mobile_announcement_content_path(bulletin) %>
</h3>
<p class="newsDate"><%= display_date(bulletin.postdate) %></p>
<div class="newsummary"><%= bulletin.subtitle %></div>
</div>
<% end %>
</div>
+5
View File
@@ -0,0 +1,5 @@
<%= content_for :header do %>
<%= render 'header_map' %>
<% end %>
<div id='map_canvas'></div>
+10
View File
@@ -0,0 +1,10 @@
<ul data-role="listview" class="list">
<% @page_contexts.each do |page_context| %>
<li>
<%= link_to mobile_page_content_path(page_context) do %>
<h3><%= page_context.page.title %></h3>
<% end %>
</li>
<% end %>
</ul>
<%= paginate @page_contexts, :param_name => :page_main, :window => 2 %>
+2
View File
@@ -0,0 +1,2 @@
<h3 class="newstitle"><%= @page_context.page.title %></h3>
<div class="newsummary"><%= @page_context.context.html_safe rescue '' %></div>