Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Merge branch 'feature/widget-values' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
snide committed Mar 25, 2014
2 parents d6b8ecd + 7940e68 commit 95609ec
Show file tree
Hide file tree
Showing 17 changed files with 51 additions and 7 deletions.
12 changes: 12 additions & 0 deletions app/helpers/truncate-string.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default Ember.Handlebars.makeBoundHelper(function(str,len) {
if (!str || !len) { return str; }
if (str.length > len && str.length > 0) {
var new_str = str + " ";
new_str = str.substr (0, len);
new_str = str.substr (0, new_str.lastIndexOf(" "));
new_str = (new_str.length > 0) ? new_str : str.substr (0, len);

return new Ember.Handlebars.SafeString ( new_str +'...' );
}
return str;
});
6 changes: 6 additions & 0 deletions app/styles/_app_content_list.sass
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@
margin: 0
line-height: 1
text-transform: capitalize

.wh-content td
&.gallery
img
border-radius: 50px
margin-right: $base-line-height / 4
2 changes: 1 addition & 1 deletion app/templates/wh/content/type/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
{{#each item in sortedCmsItems}}
{{#link-to 'wh.content.type.edit' contentTypeNav.id item.id tagName="tr"}}
{{#each item.cmsControls}}
<td>{{partial this.controlType.valuePartialPath}}</td>
<td {{ bind-attr class=this.controlType.widget }}>{{partial this.controlType.valuePartialPath}}</td>
{{/each}}
<td class="wy-table-actions">
{{#if item.lockedBy}}
Expand Down
6 changes: 6 additions & 0 deletions app/templates/widgets/value/_address.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{value.street1}}
{{value.street2}}
{{value.city}}
{{value.state}}
{{value.postal}}
{{value.country}}
3 changes: 3 additions & 0 deletions app/templates/widgets/value/_audio.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#if value.length}}
<span class="icon icon-music" data-toggle="tooltip" {{ bind-attr title=value }}></span>
{{/if}}
1 change: 1 addition & 0 deletions app/templates/widgets/value/_email.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{value}}
4 changes: 3 additions & 1 deletion app/templates/widgets/value/_embedly.hbs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
{{value.title}}
{{#if value.title.length}}
{{value.title}}
{{/if}}
4 changes: 4 additions & 0 deletions app/templates/widgets/value/_file.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{#if value.length}}
<span class="icon icon-paper-clip" data-toggle="tooltip" {{ bind-attr title=value }}></span>
{{/if}}

5 changes: 5 additions & 0 deletions app/templates/widgets/value/_gallery.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{#if value.length}}
{{resize-image value.0.url height="30" width="30" crop="true"}}
{{ value.length }} images
{{/if}}

2 changes: 1 addition & 1 deletion app/templates/widgets/value/_image.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{resize-image value height="50"}}
{{resize-image value height="30"}}
2 changes: 1 addition & 1 deletion app/templates/widgets/value/_markdown.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{value}}
{{truncate-string value 100}}
1 change: 1 addition & 0 deletions app/templates/widgets/value/_number.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{value}}
1 change: 1 addition & 0 deletions app/templates/widgets/value/_phone.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{value}}
2 changes: 1 addition & 1 deletion app/templates/widgets/value/_textarea.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{value}}
{{truncate-string value 100}}
3 changes: 3 additions & 0 deletions app/templates/widgets/value/_url.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#if value.length}}
{{#link-to value }}{{value}}{{/link-to}}
{{/if}}
2 changes: 1 addition & 1 deletion app/templates/widgets/value/_wysiwyg.hbs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<span class="icon icon-html5"> &lt;html&gt; content</span>
{{truncate-string value 100}}
2 changes: 1 addition & 1 deletion config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ window.ENV = {
name: 'Specifics',
controlTypes: [
{
name : 'Name',
name : 'Person',
widget : 'name',
valueType: 'object',
iconClass: 'icon-user'
Expand Down

0 comments on commit 95609ec

Please sign in to comment.