Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Icons #34

Merged
merged 6 commits into from
Sep 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions media/icon-person.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/icon-tag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions media/icon-time.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/services/logic-readout-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var _ = require('lodash'),

/**
* Wrap logic groups in a div
*
* @param {string} content
* @return {string}
*/
Expand All @@ -23,8 +24,8 @@ function wrapUp(content) {
* @return {String}
*/
function createReadout(element, name, value) {
var logicIconSet = references.tpl.get('.space-logic-icon-set'),
iconSelector = `.${name.replace('logic', '').toLowerCase()}-icon`,
var logicIconSet = references.tpl.get('.clay-space-edit-icons'),
iconSelector = `.icon-${name.replace('logic', '').toLowerCase()}`,
icon = dom.find(logicIconSet, iconSelector);

return `<span class="logic-group">${icon.outerHTML} ${value}</span>`;
Expand All @@ -33,6 +34,7 @@ function createReadout(element, name, value) {
/**
* Iterate over all data attributes and create
* readouts for any prefixed with 'logic'
*
* @param {Element} element
* @return {String}
*/
Expand Down
2 changes: 1 addition & 1 deletion src/styleguide/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ $UI_BUTTON: #694C79;
vertical-align: text-top;
}

& > .logic-icon {
& > .readout-icon {
margin-right: 5px;
}
}
12 changes: 10 additions & 2 deletions template.nunjucks
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{% if locals.edit %}
<div data-uri="{{ _ref or _self }}" class="clay-space-edit">

{# styles #}
{# Styles #}
<style>
{{ ('node_modules/clay-space-edit/dist/clay-space-edit.css')| includeFile | safe }}
</style>

{# scripts #}
{# Scripts #}
<script>
{{ ('node_modules/clay-space-edit/dist/clay-space-edit.js')| includeFile | safe }}
</script>
Expand Down Expand Up @@ -34,5 +34,13 @@
</button>
</template>

{# Readout Icons #}
{# Need more icons? Submit a PR to https://github.com/nymag/clay-space-edit with the icon #}
<template class="clay-space-edit-icons">
<span class="readout-icon icon-tags">{% include 'public/media/components/clay-space-edit/icon-tag.svg' %}</span>
<span class="readout-icon icon-time">{% include 'public/media/components/clay-space-edit/icon-time.svg' %}</span>
<span class="readout-icon icon-person">{% include 'public/media/components/clay-space-edit/icon-person.svg' %}</span>
</template>

</div>
{% endif %}