Skip to content

Commit

Permalink
Merge branch 'release/v1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
andyluss committed May 1, 2015
2 parents cc0f12e + 87df6db commit 2b4cdda
Show file tree
Hide file tree
Showing 54 changed files with 658 additions and 82 deletions.
3 changes: 2 additions & 1 deletion .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ meteorhacks:npm
manuel:reactivearray
http
iron:url
less
less
matteodem:easy-search
1 change: 1 addition & 0 deletions .meteor/versions
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ [email protected]
[email protected]
manuel:[email protected]
matb33:[email protected]
matteodem:[email protected]
mdg:[email protected]
[email protected]
[email protected]
Expand Down
2 changes: 1 addition & 1 deletion lib/common/both/helpers.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@pq = (context)-> context.params.query
@paramsQuery = (context)-> context.params.query

@gbl = -> Meteor.isClient and window or global

Expand Down
4 changes: 2 additions & 2 deletions lib/common/client/views/favorite_button.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template name="favoriteButtonChecked">
<button class="favorite-button button button-clear button-light pull-right" doc="{{_id}}"><i class="icon ion-ios-star"></i></button>
<button class="favorite-button button button-clear button-light pull-right {{class}}" doc="{{_id}}"><i class="icon ion-ios-star"></i></button>
</template>

<template name="favoriteButtonNotChecked">
<button class="favorite-button button button-clear button-light pull-right" doc="{{_id}}" category="{{category}}"><i class="icon ion-ios-star-outline"></i></button>
<button class="favorite-button button button-clear button-light pull-right {{class}}" doc="{{_id}}" category="{{category}}"><i class="icon ion-ios-star-outline"></i></button>
</template>
4 changes: 0 additions & 4 deletions lib/common/client/views/favorite_button.import.styl

This file was deleted.

8 changes: 5 additions & 3 deletions lib/common/client/views/image_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
{{/if}}
<div class="title-container">
<label class="title">{{title}}</label>
<label class="user">
<div class="banner">
<label class="user">
{{userName user}}
</label>
<label class="date">{{dateString date}}</label>
</label>
<label class="date">{{dateString date}}</label>
</div>
</div>
</div>

Expand Down
45 changes: 37 additions & 8 deletions lib/common/client/views/image_item.import.styl
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
.image-item
margin-bottom 10px
position relative
width 100%
height 240px
background-color #fff
box-shadow 0 2px 2px rgba(0,0,0,0.1)
z-index 1
.image-container
display flex
width 100%
height 205px
overflow hidden
img
margin auto
width 100%
.title-container
padding-top 0.35em
position absolute
left 0
bottom 0
size 100% 2em
background-color #a3ce5f
height 95px
background-color transparent
label
color white
position absolute
.title
left 1em
.user
right 7em
.date
right 1em
position relative
display block
padding 8px 5%
width 100%
height 60px
color #fff
font-size 20px
line-height 22px
background-color rgba(0,0,0,0.4)
.banner
height 35px
background-color #fff
color #CBCBCB
.user,.date
position relative
display block
padding 0 15%
height 35px
width 50%
float left
line-height 35px
3 changes: 2 additions & 1 deletion lib/common/client/views/layout_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
{{> yield}}
{{/ionNavView}}

{{>photoswipe}}
{{> yield 'popup'}}

{{/ionBody}}

</template>
3 changes: 2 additions & 1 deletion lib/common/client/views/tab_bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

{{#unless user}}
<button class="add-button button button-clear">
{{>ionIcon icon='plus-circled'}}
{{>ionIcon icon='dive-plus'}}
发布
</button>
{{/unless}}

Expand Down
35 changes: 32 additions & 3 deletions lib/common/client/views/tab_bar.import.styl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,46 @@
.tabs
background #36618e
.tab-item
color #aadeff
.tab-item.active
opacity 1
color white
font-family SimHei
line-height 12px
.icon
height 34px
filter brightness(0) invert(1)
.ion-dive-note
background url(/images/icondive-note.svg) no-repeat center
background-size 30px 30px
.ion-dive-journey
background url(/images/icondive-journey.svg) no-repeat center
background-size 30px 30px
.ion-dive-product
background url(/images/icondive-product.svg) no-repeat center
background-size 30px 30px
.ion-dive-say
background url(/images/icondive-say.svg) no-repeat center
background-size 30px 30px
.tab-item.active
color #2E5C8D
background-color #81BEFF
.icon
filter none
.add-button
color #aadeff
position absolute
top 0
left 0
right 0
margin auto
padding 0
width 50px
font-size 12px
line-height 12px
color #fff
.ion-dive-plus
display block
margin 0 auto
height 34px
background url(/images/icondive-add.svg) no-repeat center
background-size 32px 32px
.icon:before
font-size 50px
4 changes: 2 additions & 2 deletions lib/post/both/collections.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@createPostCollection = (category, hasCategory2)->
gbl()[pcap category] = new Meteor.Collection plural category
Posts = gbl()[pcap category] = new Meteor.Collection plural category

moreSchema =
category:
Expand All @@ -25,7 +25,7 @@
autoform:
options: options

coln(category).attachSchema new SimpleSchema [PostSchema, moreSchema]
Posts.attachSchema new SimpleSchema [PostSchema, moreSchema]

@PostSchema = new SimpleSchema

Expand Down
2 changes: 1 addition & 1 deletion lib/post/both/configs.coffee
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@postConfigs =
autoFormOmitFields: ["category", "category2", "createdAt", "updatedAt", "user", "date", "images"]
autoFormOmitFields: ["category", "category2", "createdAt", "updatedAt", "user", "date", "images", "viewCount"]
3 changes: 3 additions & 0 deletions lib/post/both/helpers.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

@postCategoryLabel = (category)-> getConfigs(category).label or ''

@autoFormOmitFields = (category)->
omitFields = getConfigs(category).autoFormOmitFields
if omitFields
Expand Down
2 changes: 2 additions & 0 deletions lib/post/client/controllers.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
@PostUpdaterController = ContentController.extend
data: -> noTransition coln(pq(@).category).findOne({_id: pq(@).id})

pq = (context)-> paramsQuery context

getListItemTemplate = (selector)->
cfg = getConfigs selector.category
return cfg.itemTemplate[selector.category2] or cfg.itemTemplate
Expand Down
1 change: 1 addition & 0 deletions lib/post/client/helpers.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Template.registerHelper 'postCategoryLabel', (category)-> postCategoryLabel category
5 changes: 4 additions & 1 deletion lib/post/client/views/creator.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Template.postCreator.helpers
createAutoFormHooks = (data)->
hooks =
onSuccess: (formType, result)->
coln(data.category).update {_id: @docId}, {$set: {images: data.imagesToUpload.array()}}
coln(data.category).update {_id: @docId},
$set:
category2: data.category2
images: data.imagesToUpload.array()
back()
AutoForm.addHooks formId(data.category), hooks, true

6 changes: 5 additions & 1 deletion lib/post/client/views/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{{#contentFor "headerButtonRight"}}
{{#if currentUser}}
{{> favoriteButton _id=_id category=category}}
{{> favoriteButton _id=_id class='post-detail-favorite-button' category=category}}
{{/if}}
<button class="more-button button button-clear pull-right button-light ion-more icon" data-action="post-more"></button>
{{/contentFor}}
Expand All @@ -15,6 +15,10 @@
<h1 class="title">{{title}}</h1>
{{/contentFor}}

{{#contentFor "popup"}}
{{>photoswipe}}
{{/contentFor}}

{{#ionView}}
{{#ionContent}}

Expand Down
5 changes: 5 additions & 0 deletions lib/post/client/views/detail.import.styl
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@
opacity 0.6

@import '../../../lib/common/client/views/comment_box.import.styl'

.ionic-body
.nav-bar-block
.favorite-button.post-detail-favorite-button
right 2.5em
5 changes: 4 additions & 1 deletion lib/post/client/views/list.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ Template.ionNavBar.events
else
Router.go '/login?from=list'

'click [data-action=search]': (event, template)->
Router.go "/search?type=#{@category}"

'click [data-action=favoritesby]': (event, template)->
# setPostList 'favoritesby', myId()
Router.go(currentPath() + "&favoritesby=#{myId()}")

Template.postList.events
'click .category2': -> Router.go "/post/list?category=#{Template.parentData().category}&category2=#{@}"
'click .category2': -> Router.go "/post/list?category=#{Template.parentData().category}&category2=#{@}", {}, {replaceState: true}
3 changes: 3 additions & 0 deletions lib/post/client/views/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ <h1 class="title">{{title}}</h1>
{{/if}}

{{#contentFor "headerButtonRight"}}
<button class="button button-clear pull-right button-light" data-action="search">
{{> ionIcon icon='ios-search'}}
</button>
<button class="button button-clear pull-right button-light" data-action="my-data">
{{> ionIcon icon='ios-person-outline'}}
</button>
Expand Down
7 changes: 6 additions & 1 deletion lib/post/client/views/list.import.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@
color #FFF

@import '../../../lib/common/client/views/tab_bar.import.styl'
@import '../../../lib/post/client/views/list_loader.import.styl'
@import '../../../lib/post/client/views/list_loader.import.styl'

.ionic-body
.nav-bar-block
[data-action="search"]
right 2.5em
1 change: 1 addition & 0 deletions lib/post/client/views/list_loader.import.styl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.item-list
background-color #f7f7f7
@import '../../../lib/common/client/views/image_item.import.styl'
.loadmore-button
margin 0
Expand Down
1 change: 1 addition & 0 deletions main/client/helpers.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Template.registerHelper 'postCategories', -> _.values PostCategory
26 changes: 0 additions & 26 deletions main/client/views/main.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
<head>
<title>潜水吧</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

<!--<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png?v=2">-->
<!--<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png?v=2">-->
<!--<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png?v=2">-->
<!--<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png?v=2">-->
<!--<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png?v=2">-->
<!--<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png?v=2">-->
<!--<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png?v=2">-->
<!--<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png?v=2">-->
<!--<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png?v=2">-->
<!--<link rel="icon" type="image/png" href="/favicon-192x192.png?v=2" sizes="192x192">-->
<!--<link rel="icon" type="image/png" href="/favicon-160x160.png?v=2" sizes="160x160">-->
<!--<link rel="icon" type="image/png" href="/favicon-96x96.png?v=2" sizes="96x96">-->
<!--<link rel="icon" type="image/png" href="/favicon-16x16.png?v=2" sizes="16x16">-->
<!--<link rel="icon" type="image/png" href="/favicon-32x32.png?v=2" sizes="32x32">-->

<!--<meta name="msapplication-TileColor" content="#ffffff">-->
<!--<meta name="msapplication-TileImage" content="/mstile-144x144.png?v=2">-->

<!--<meta name="theme-color" content="#DE4F4F" />-->
<!--<meta name="mobile-web-app-capable" content="yes">-->

<!--<meta name="apple-mobile-web-app-capable" content="yes">-->
<!--<meta name="apple-mobile-web-app-title" content="Meteor Hunt">-->
<!--<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">-->

</head>

<body>
Expand Down
3 changes: 2 additions & 1 deletion main/client/views/main.styl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

@require '../../../modules/journey/client/views/main.import.styl'
@require '../../../modules/product/client/views/main.import.styl'
@require '../../../modules/say/client/views/main.import.styl'

@require '../../../lib/common/client/views/favorite_button.import.styl'
@require '../../../modules/search/client/views/main.import.styl'

a
color inherit
Expand Down
4 changes: 2 additions & 2 deletions modules/houston/server/houston.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Meteor.startup ->
Houston.add_collection Users
Houston.add_collection Houston._admins

Houston.add_collection Favorites
Houston.add_collection Comments._collection
global['Favorites'] and Houston.add_collection Favorites
global['Comments'] and Houston.add_collection Comments._collection

2 changes: 1 addition & 1 deletion modules/journey/both/lib/configs.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@journeyConfigs =
label: '行程'
icon: "plane"
icon: "dive-journey"
category2:
official: 'official'
user: 'user'
Expand Down
5 changes: 5 additions & 0 deletions modules/mongol/client/configs.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Session.set "Mongol",
'collections': ['Notes', 'Journeys', 'Products', 'Says']
'display': false
'opacity_normal': ".7"
'opacity_expand': ".9"
4 changes: 2 additions & 2 deletions modules/note/both/lib/configs.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@noteConfigs =
label: '游记'
label: '潜途'
itemTemplate: 'imageItem'
icon: "android-car"
icon: "dive-note"
Loading

0 comments on commit 2b4cdda

Please sign in to comment.