Skip to content

Commit

Permalink
Merge branch 'master' into fixing-plugins-env-js
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattjoh authored Mar 13, 2018
2 parents 2cb8bf3 + ecb457f commit 6136884
Show file tree
Hide file tree
Showing 34 changed files with 743 additions and 32 deletions.
49 changes: 49 additions & 0 deletions bin/cli-users
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,59 @@ async function verifyUserEmail(userID, email) {
}
}

/**
* createUser will prompt the user for the user information when creating a
* local user.
*/
async function createUser() {
try {
const answers = await inquirer.prompt([
{
name: 'email',
message: 'Email',
},
{
name: 'username',
message: 'Username',
},
{
name: 'password',
message: 'Password',
type: 'password',
},
{
name: 'role',
message: 'Role',
type: 'list',
choices: USER_ROLES,
},
]);

const { email, username, password, role } = answers;

// Create the user.
const user = await UsersService.createLocalUser(email, password, username);

// Set the role.
await UsersService.setRole(user.id, role);

console.log(`Created User[${user.id}]`);
util.shutdown(0);
} catch (err) {
console.error(err);
util.shutdown(1);
}
}

//==============================================================================
// Setting up the program command line arguments.
//==============================================================================

program
.command('create')
.description('creates a local user')
.action(createUser);

program
.command('delete <userID>')
.description('delete a user')
Expand Down
5 changes: 5 additions & 0 deletions client/coral-framework/services/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import get from 'lodash/get';
import merge from 'lodash/merge';

import moment from 'moment';
import 'moment/locale/ar';
import 'moment/locale/da';
import 'moment/locale/de';
import 'moment/locale/es';
Expand All @@ -12,6 +13,7 @@ import 'moment/locale/pt-br';

import { createStorage } from 'coral-framework/services/storage';

import arTA from 'timeago.js/locales/ar';
import daTA from 'timeago.js/locales/da';
import deTA from 'timeago.js/locales/de';
import esTA from 'timeago.js/locales/es';
Expand All @@ -21,6 +23,7 @@ import zh_CNTA from 'timeago.js/locales/zh_CN';
import zh_TWTA from 'timeago.js/locales/zh_TW';
import nl from 'timeago.js/locales/nl';

import ar from '../../../locales/ar.yml';
import en from '../../../locales/en.yml';
import da from '../../../locales/da.yml';
import de from '../../../locales/de.yml';
Expand All @@ -33,6 +36,7 @@ import nl_NL from '../../../locales/nl_NL.yml';

const defaultLanguage = process.env.TALK_DEFAULT_LANG;
const translations = {
...ar,
...en,
...da,
...de,
Expand Down Expand Up @@ -88,6 +92,7 @@ export function setupTranslations() {
lang = defaultLanguage;
}

ta.register('ar', arTA);
ta.register('es', esTA);
ta.register('da', daTA);
ta.register('de', deTA);
Expand Down
10 changes: 3 additions & 7 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,12 @@ deploy:

sidebar:
top:
- title: Github
- title: GitHub
url: https://github.com/coralproject/
- title: Docker
url: https://hub.docker.com/r/coralproject/
- title: Roadmap
url: https://www.pivotaltracker.com/n/projects/1863625
- title: Google Group
url: https://groups.google.com/forum/#!forum/coral-talk-users
side:
- title: Installation
children:
Expand Down Expand Up @@ -142,10 +140,8 @@ sidebar:
url: /reference/server/
- title: GraphQL
url: /reference/graphql/
- title: FAQ
children:
- title: FAQ
url: /faq/
- title: Contact
url: /contact/
- title: Migrating
children:
- title: Migrating to v4.0.0
Expand Down
2 changes: 1 addition & 1 deletion docs/source/01-03-installation-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ permalink: /installation-from-source/
To install Talk from Source, ensure that you have Node version 8+.
Installing via source is the recommended method when developing as it give you
the best tooling. We release versions using semantic versioning, and do so to
our [Github Releases](https://github.com/coralproject/talk/releases) page.
our [GitHub Releases](https://github.com/coralproject/talk/releases) page.
There you can download archives of older versions or the latest release. The
examples following will download the latest code on our master branch.

Expand Down
8 changes: 4 additions & 4 deletions docs/source/05-01-faq.md → docs/source/contact.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: FAQ
permalink: /faq/
title: Contact
permalink: /contact/
---

## How can I get help integrating Talk into my newsroom?
Expand All @@ -10,8 +10,8 @@ We're here to help with newsrooms of all sizes. Email our Integration Engineer

## How do I request a feature or submit a bug?

The best way is to [submit a Github issue](https://github.com/coralproject/talk/issues). Make sure you give plenty of details, our Core Team can usually respond within a few hours on weekdays.
The best way is to [submit a GitHub issue](https://github.com/coralproject/talk/issues). Make sure you give plenty of details, our Core Team can usually respond within a few hours on weekdays.

## How can our dev team contribute to Talk?

We are lucky to work with newsroom dev teams and individual contributors who span the world, and come from newsrooms of all sizes. You can read our [Contribution Guide](https://github.com/coralproject/talk/blob/master/CONTRIBUTING.md) to get started, but feel free to reach out to us via Github, or get in touch directly with Jeff via [email protected].
We are lucky to work with newsroom dev teams and individual contributors who span the world, and come from newsrooms of all sizes. You can read our [Contribution Guide](https://github.com/coralproject/talk/blob/master/CONTRIBUTING.md) to get started, but feel free to reach out to us via GitHub, or get in touch directly with Jeff via [email protected].
4 changes: 2 additions & 2 deletions docs/source/integrating/translations-i18n.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ That would set the language to French.

To add a new Talk translation, simply translate the `en.yml` file (https://github.com/coralproject/talk/blob/master/locales/en.yml) into a new yml file with the language code of your choice. You can find supported language codes here: http://www.localeplanet.com/icu/iso639.html

If you are a developer contributing a new language, you'll need to add the required i18n support in the i18n files (or you can leave that to us if you like). If you're a non-developer, you can submit the translation via Github if you feel comfortable doing that, or feel free to email it to us via our Support: [email protected]
If you are a developer contributing a new language, you'll need to add the required i18n support in the i18n files (or you can leave that to us if you like). If you're a non-developer, you can submit the translation via GitHub if you feel comfortable doing that, or feel free to email it to us via our Support: [email protected]

If you want to suggest a new language or put a placeholder for a translation you’re working on, feel free to create a Github issue: https://github.com/coralproject/talk/issues/new
If you want to suggest a new language or put a placeholder for a translation you’re working on, feel free to create a GitHub issue: https://github.com/coralproject/talk/issues/new
26 changes: 16 additions & 10 deletions docs/themes/coral/layout/partial/sidebar.swig
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@
</a>
<ul class="sidebar__list">
{% for item in config.sidebar.side %}
<li class="sidebar__section{% for item in item.children %}{% if is_current(item.url) %} active toggled{% endif %}{% endfor %}">
<a href="#" class="sidebar__header">{{ item.title }}</a>
<ul class="sidebar__links">
{% for item in item.children %}
<li class="{% if is_current(item.url) %}active{% endif %}">
<a href="{% if !is_current(item.url) %}{{ url_for(item.url) }}{% else %}#{% endif %}">{{ item.title }}</a>
</li>
{% endfor %}
</ul>
</li>
{% if item.url %}
<li class="sidebar__section{% if is_current(item.url) %} active toggled{% endif %}">
<a href="{{ url_for(item.url) }}" class="sidebar__header sidebar__header__link">{{ item.title }}</a>
</li>
{% else %}
<li class="sidebar__section{% for item in item.children %}{% if is_current(item.url) %} active toggled{% endif %}{% endfor %}">
<a href="#" class="sidebar__header">{{ item.title }}</a>
<ul class="sidebar__links">
{% for item in item.children %}
<li class="{% if is_current(item.url) %}active{% endif %}">
<a href="{% if !is_current(item.url) %}{{ url_for(item.url) }}{% else %}#{% endif %}">{{ item.title }}</a>
</li>
{% endfor %}
</ul>
</li>
{% endif %}
{% endfor %}
</ul>

Expand Down
2 changes: 1 addition & 1 deletion docs/themes/coral/source/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $(document).ready(function() {
});

// Setup the menu controls.
$('a.sidebar__header').on('click', function(e) {
$('a.sidebar__header:not(.sidebar__header__link)').on('click', function(e) {
e.preventDefault();
$('.sidebar__section.toggled').removeClass('toggled');
$(this)
Expand Down
Loading

0 comments on commit 6136884

Please sign in to comment.