-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use mobile-fu to separate the mobile and computer webpage
- Loading branch information
1 parent
3ecbf9a
commit fe084c7
Showing
11 changed files
with
50 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1 @@ | ||
<div> | ||
<!--Display Page--> | ||
<div data-role="page" data-theme="b" id="page"> | ||
<!--Image Gallery --> | ||
<div data-role="content" id="content"> | ||
<div id="display"> | ||
<% @items.each do |item| %> | ||
<%= image_tag item.photo.url, class: 'item-image' %> | ||
<% end %> | ||
</div> | ||
<div id="imginfo"> | ||
<% @items.each do |item| %> | ||
<div> | ||
<p class="title">名称:<%= item.title %></p> | ||
<p class="price">价格:<%= item.price %>元</p> | ||
<p class="desc"><%= item.description %></p> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
请使用手机浏览器访问 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div> | ||
<!--Display Page--> | ||
<div data-role="page" data-theme="b" id="page"> | ||
<!--Image Gallery --> | ||
<div data-role="header"> | ||
<%= link_to "首页", items_path, :rel => "external" %> | ||
</div> | ||
<div data-role="content" id="content"> | ||
<div id="display"> | ||
<% @items.each do |item| %> | ||
<%= image_tag item.photo.url, class: 'item-image' %> | ||
<% end %> | ||
</div> | ||
<div id="imginfo"> | ||
<% @items.each do |item| %> | ||
<div> | ||
<p class="title">名称:<%= item.title %></p> | ||
<p class="price">价格:<%= item.price %>元</p> | ||
<p class="desc"><%= item.description %></p> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
app/views/layouts/computer.html.erb → app/views/layouts/application.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
app/views/layouts/mobile.html.erb → app/views/layouts/application.mobile.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>ItemDisplaying</title> | ||
<title>服装</title> | ||
<%= stylesheet_link_tag "mobile", media: "all", "data-turbolinks-track" => true %> | ||
<%= javascript_include_tag "mobile", "data-turbolinks-track" => true %> | ||
<%= csrf_meta_tags %> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
<body> | ||
<%= yield %> | ||
<%= yield %> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
这个gem挺新的,而且好像不是很出名(star数只有1个?)……不过能work就行。如果之后这个功能点出现问题,记得研究下是不是这个gem导致的。
我个人觉得用mobile fu就可以了……也有针对jquery mobile的workaround: brendanlim/mobile-fu#17 不过这个无所谓啦 XD