Merge branch 'doc' into recurrent_events

This commit is contained in:
lesion
2019-07-14 01:50:39 +02:00
16 changed files with 495 additions and 0 deletions

3
docs/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
_site
.sass-cache
.jekyll-metadata

24
docs/404.html Normal file
View File

@@ -0,0 +1,24 @@
---
layout: default
---
<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>
<div class="container">
<h1>404</h1>
<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>

36
docs/Gemfile Normal file
View File

@@ -0,0 +1,36 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 3.8.6"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
#gem "minima", "~> 2.0"
gem "just-the-docs"
gem "jemoji"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.6"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
gem "tzinfo", "~> 1.2"
gem "tzinfo-data"
end
# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?

101
docs/Gemfile.lock Normal file
View File

@@ -0,0 +1,101 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.2.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
concurrent-ruby (1.1.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
ffi (1.11.1)
forwardable-extended (2.6.0)
gemoji (3.0.1)
html-pipeline (2.11.0)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.8.6)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 2.0)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-feed (0.12.1)
jekyll (>= 3.7, < 5.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.11.0)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0, < 5.0)
just-the-docs (0.2.5)
jekyll (~> 3.8.5)
jekyll-seo-tag (~> 2.0)
rake (~> 12.3.1)
kramdown (1.17.0)
liquid (4.0.3)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
mini_portile2 (2.4.0)
minitest (5.11.3)
nokogiri (1.10.3)
mini_portile2 (~> 2.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (3.1.1)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rouge (3.6.0)
ruby_dep (1.5.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
tzinfo-data (1.2019.2)
tzinfo (>= 1.0.0)
wdm (0.1.1)
PLATFORMS
ruby
DEPENDENCIES
jekyll (~> 3.8.6)
jekyll-feed (~> 0.6)
jemoji
just-the-docs
tzinfo (~> 1.2)
tzinfo-data
wdm (~> 0.1.0)
BUNDLED WITH
2.0.2

50
docs/_config.yml Normal file
View File

@@ -0,0 +1,50 @@
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: Gancio
email: gancio@cisti.org
description: >- # this means to ignore newlines until "baseurl:"
A shared agenda for local communities
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
#twitter_username: jekyllrb
#github_username: jekyll
# Build settings
markdown: kramdown
theme: "just-the-docs"
plugins:
- jekyll-feed
- jemoji
search_enabled: true
aux_links:
"Source":
- https://git.lattuga.net/cisti/gancio
#Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
# exclude:
# - Gemfile
# - Gemfile.lock
# - node_modules
# - vendor/bundle/
# - vendor/cache/
# - vendor/gems/
# - vendor/ruby/

19
docs/admin.md Normal file
View File

@@ -0,0 +1,19 @@
---
layout: default
title: Admin
permalink: /admin
nav_order: 5
---
# Admin
{: .no_toc }
1. TOC
{:toc}
## Basics
## Enable registration
## Confirm registration
## Confirm event

BIN
docs/assets/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

18
docs/contribute.md Normal file
View File

@@ -0,0 +1,18 @@
---
layout: default
title: Contribute
permalink: /contribute
nav_order: 6
---
# Contribute
{: .no_toc }
1. TOC
{:toc}
## Code
## Translate
## Design
## Documentation
## Share

33
docs/dev.md Normal file
View File

@@ -0,0 +1,33 @@
---
layout: default
title: Develop
permalink: /dev
nav_order: 5
---
### Development Stack
**Gancio** is built with following technologies:
- [Nuxt.js](https://nuxtjs.org/)
- Vue.js
- Express
- Sequelize
- Element.ui
### Testing on your own machine
2. Download source
```bash
git clone https://git.lattuga.net/cisti/gancio
```
3. Install dependencies
```bash
yarn
```
4. Hacking
```bash
yarn dev
```

26
docs/index.md Normal file
View File

@@ -0,0 +1,26 @@
---
layout: default
title: Home
nav_order: 1
description: "Gancio is a shared agenda for local communities."
permalink: /
---
# <img src='https://git.lattuga.net/repo-avatars/476' width="60px"/> Gancio
{: .fs-9 }
A shared agenda for local communities.
{: .fs-6 }
[Get started now](/setup){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 } [Demo](https://gancio.cisti.org){: .btn .btn-green .fs-5 .mb-4 .mb-md-0 }
[Source](https://git.lattuga.net/cisti/gancio){: .btn .fs-5 }
<iframe width="800" height="500" sandbox="allow-same-origin allow-scripts" src="https://spacepub.space/videos/embed/9745bffc-e1e8-416d-9b08-fbc5e4c803b3?muted=1&title=0" frameborder="0" allowfullscreen></iframe>
### About the project
Gancio is made with :heart: by [hacklab underscore](https://autistici.org/underscore)
### License
Gancio is distributed by an [AGPL-3.0 Licence](https://www.gnu.org/licenses/agpl-3.0.en.html).

43
docs/settings.md Normal file
View File

@@ -0,0 +1,43 @@
---
layout: default
title: Settings
permalink: /settings
nav_order: 3
---
# Settings
{: .no_toc }
1. TOC
{:toc}
## Default settings
```json
{
"title": "Gancio",
"description": "A shared agenda for local communities",
"baseurl": "http://localhost:13120",
"server": {
"host": "0.0.0.0",
"port": 13120
},
"db": {
"dialect": "sqlite",
"storage": "/tmp/db.sqlite"
},
"upload_path": "./",
"smtp": {
"auth": {
"user": "",
"pass": ""
},
"secure": true,
"host": ""
},
"admin": {
"email": "",
"password": ""
},
"secret": "notsosecret"
}
```

34
docs/setup/classic.md Normal file
View File

@@ -0,0 +1,34 @@
---
layout: default
title: Classic
permalink: /setup/classic
parent: Setup
---
## Classic setup
1. Install Node.js
```bash
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
```
<small>[source](https://github.com/nodesource/distributions/blob/master/README.md)</small>
2. Install Gancio
```bash
npm install --global gancio
```
3. Setup
```bash
gancio setup
```
4. Start
```bash
gancio start
```
5. Enjoy :tada:
Point your web browser to [http://localhost:3000](http://localhost:3000)

10
docs/setup/docker.md Normal file
View File

@@ -0,0 +1,10 @@
---
layout: default
title: Docker
permalink: /setup/docker
parent: Setup
---
## Install with docker

12
docs/setup/setup.md Normal file
View File

@@ -0,0 +1,12 @@
---
layout: default
title: Setup
permalink: /setup
has_children: true
nav_order: 2
---
# Setup
You would setup **Gancio** for different scenario
{: .fs-6 }

14
docs/usage.md Normal file
View File

@@ -0,0 +1,14 @@
---
layout: default
title: Usage
permalink: /usage
nav_order: 4
---
# Usage
## Add event
### Normal
### Multidate
### Recurrent

View File

@@ -59,7 +59,11 @@
el-radio-button(label="recurrent") <v-icon name='calendar-alt'/> {{$t('event.recurrent')}}
br
span {{$t(`event.${event.type}_description`)}}
<<<<<<< HEAD
el-select.ml-2(v-if='event.type==="recurrent"' v-model='event.recurrent.frequency' placeholder='Frequenza')
=======
el-select.ml-2(v-if='event.type==="recurrent"' v-model='event.rec_frequency' placeholder='Frequenza')
>>>>>>> doc
el-option(label='Tutti i giorni' value='1d' key='1d')
el-option(label='Ogni settimana' value='1w' key='1w')
el-option(label='Ogni due settimane' value='2w' key='2w')
@@ -78,10 +82,16 @@
)
div.text-center.mb-2(v-if='event.type === "recurrent"')
<<<<<<< HEAD
span {{event.recurrent.type}}
span(v-if='event.recurrent.frequency !== "1m" && event.recurrent.frequency !== "2m"') {{whenPatterns}}
el-radio-group(v-else v-model='event.recurrent.type')
el-radio-button(v-for='whenPattern in whenPatterns' :label='whenPattern.key' :key='whenPatterns.key')
=======
span(v-if='event.rec_frequency !== "1m" && event.rec_frequency !== "2m"') {{whenPatterns}}
el-radio-group(v-else v-model='event.rec_detail')
el-radio-button(v-for='whenPattern in whenPatterns' :label='whenPattern.label' :key='whenPatterns.key')
>>>>>>> doc
span {{whenPattern.label}}
el-form.text-center(inline)
@@ -134,8 +144,17 @@ export default {
type: 'normal',
place: { name: '', address: '' },
title: '', description: '', tags: [],
<<<<<<< HEAD
image: false,
recurrent: { frequency: '1w', days: [], type: 'weekday' },
=======
multidate: false,
image: false,
recurrent: false,
rec_frequency: '1w',
rec_when: null,
rec_ordinal: false,
>>>>>>> doc
},
page: { month, year},
fileList: [],
@@ -220,6 +239,7 @@ export default {
const dates = this.date
if (!dates || !dates.length) return
<<<<<<< HEAD
const freq = this.event.recurrent.frequency
const weekDays = uniq(map(dates, date => moment(date).format('dddd')))
if (freq === '1w' || freq === '2w') {
@@ -234,6 +254,22 @@ export default {
} else if (freq === '1d') {
return this.$t('event.recurrent_each_day')
}
=======
const freq = this.event.rec_frequency
const weekDays = uniq(map(dates, date => moment(date).format('dddd')))
if (freq === '1w' || freq === '2w') {
return this.$t(`event.recurrent_${freq}_days`, {days: weekDays.join(', ')})
}
if (freq === '1m' || freq === '2m') {
const days = uniq(map(dates, date => moment(date).date()))
const n = Math.floor((days[0]-1)/7)+1
return [
{ label: this.$tc(`event.recurrent_${freq}_days`, days.length, {days}) },
{ label: this.$tc(`event.recurrent_${freq}_ordinal`, days.length, {n: this.$t(`ordinal.${n}`), days: weekDays.join(', ')}) }
]
}
>>>>>>> doc
},
todayEvents () {
if (this.event.type === 'multidate') {
@@ -268,6 +304,7 @@ export default {
attributes = attributes.concat(this.filteredEvents
.filter(e => e.multidate)
.map( e => ({ key: e.id, highlight: {}, dates: {
<<<<<<< HEAD
start: new Date(e.start_datetime), end: new Date(e.end_datetime) }})))
if (this.event.type === 'recurrent' && this.event.recurrent.frequency && Array.isArray(this.date)) {
@@ -292,6 +329,29 @@ export default {
}
if (this.event.recurrent.frequency === '1d') {
recurrent.dailyInterval = 1
=======
start: new Date(e.start_datetime*1000), end: new Date(e.end_datetime*1000) }})))
if (this.event.type==='recurrent' && this.event.rec_frequency && Array.isArray(this.date)) {
const recurrent = {}
if (this.event.rec_frequency === '1w') {
recurrent.weekdays = this.date.map(d => moment(d).day()+1)
recurrent.weeklyInterval = 1
}
if (this.event.rec_frequency === '2w') {
recurrent.weekdays = this.date.map(d => moment(d).day()+1)
recurrent.weeklyInterval = 2
recurrent.start = new Date(this.date[0])
}
if (this.event.rec_frequency === '1m') {
// recurrent.weeks = 1
// recurrent.ordinalWeekdays = { 1: this.date.map(d => moment(d).day()+1) }
recurrent.days = this.date.map(d => moment(d).date())
recurrent.monthlyInterval = 1
recurrent.start = new Date(this.date[0])
}
if (this.event.rec_frequency === '2m') {
>>>>>>> doc
}
attributes.push({name: 'recurrent', dates: recurrent, dot: { color: 'red'}})
}
@@ -394,6 +454,18 @@ export default {
formData.append('start_datetime', start_datetime.unix())
formData.append('end_datetime', end_datetime.unix())
<<<<<<< HEAD
=======
if (this.event.type === 'recurrent') {
const recurrent = {
frequency: this.rec_frequency,
days: this.rec_when,
ordinal: this.rec_ordinal,
}
formData.append('recurrent', JSON.stringify(recurrent))
}
>>>>>>> doc
if (this.edit) {
formData.append('id', this.event.id)
}