wip twitter channel

This commit is contained in:
Felix Niklas 2015-11-19 10:32:31 +01:00
parent 9a7413503b
commit b031baee10
4 changed files with 165 additions and 31 deletions

View file

@ -1,15 +1,93 @@
class App.ChannelTwitter extends App.Controller class Index extends App.ControllerContent
events:
'click .js-new': 'new'
'click .js-edit': 'edit'
'click .js-delete': 'delete'
constructor: -> constructor: ->
super super
@title 'Twitter' # check authentication
return if !@authenticate()
# render page
@render() @render()
render: -> #@interval(@load, 60000)
@html App.view('channel/twitter')( #@load()
head: 'some header'
load: =>
# @startLoading()
# @ajax(
# id: 'twitter_index'
# type: 'GET'
# url: @apiPath + '/twitter'
# processData: true
# success: (data, status, xhr) =>
# App.Collection.loadAssets(data.assets)
# @stopLoading()
# @render(data)
# )
render: =>
# accounts = App.Twitter.search(
# sortBy: 'name'
# )
# # show description button, only if content exists
# showDescription = false
# if App.Twitter.description
# if !_.isEmpty(accounts)
# showDescription = true
# else
# description = marked(App.Twitter.description)
@html App.view('twitter/index')()
# accounts: accounts
# showDescription: showDescription
# description: description
new: (e) ->
# e.preventDefault()
# new App.ControllerGenericNew(
# pageData:
# title: 'SLAs'
# object: 'Sla'
# objects: 'SLAs'
# genericObject: 'Sla'
# container: @el.closest('.content')
# callback: @load
# large: true
# )
edit: (e) ->
# e.preventDefault()
# id = $(e.target).closest('.action').data('id')
# new App.ControllerGenericEdit(
# id: id
# pageData:
# title: 'SLAs'
# object: 'Sla'
# objects: 'SLAs'
# genericObject: 'Sla'
# callback: @load
# container: @el.closest('.content')
# large: true
# )
delete: (e) =>
# e.preventDefault()
# id = $(e.target).closest('.action').data('id')
# item = App.Twitter.find(id)
# new App.ControllerGenericDestroyConfirm(
# item: item
# container: @el.closest('.content')
# callback: @load
# )
description: (e) =>
new App.ControllerGenericDescription(
description: App.Twitter.description
container: @el.closest('.content')
) )
App.Config.set( 'Twitter', { prio: 5000, name: 'Twitter', parent: '#channels', target: '#channels/twitter', controller: App.ChannelTwitter, role: ['Admin'] }, 'NavBarAdmin' ) App.Config.set( 'Twitter', { prio: 2900, name: 'Twitter', parent: '#channels', target: '#channels/twitter', controller: Index, role: ['Admin'] }, 'NavBarAdmin' )

View file

@ -0,0 +1,19 @@
class App.Twitter extends App.Model
@configure 'Twitter', 'name', 'channels'
@extend Spine.Model.Ajax
@url: @apiPath + '/twitter'
@configure_attributes = [
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false }
]
@configure_delete = true
@configure_overview = [
'name',
]
@description = '''
**Twitter Accounts**, abgekürzt **SLAs**, unterstützen Sie gegenüber Kunden gewisse zeitliche Reaktionen einzuhalten. Somit können Sie z. B. sagen Kunden sollen immer nach spätestens 8 Stunden eine Reaktion von Ihnen bekommen. Falls es zu einer drohenden Unterschreitung oder einer Unterschreitung kommt, weißt Zammad Sie auf solche Ereignisse hin.
Es können **Reaktionszeit** (Zeit zwischen Erstellung eines Tickets und erster Reaktion eines Agenten), **Aktualisierungszeit** (Zeit zwischen Nachfrage eines Kunden und Reaktion eines Agenten) und **Lösungszeit** (Zeit zwischen Erstellung und schließen eines Tickets) definiert werden.
Drohenden Unterschreitungen oder Unterschreitungen werden in einer eigenen Ansicht in den Übersichten angezeigt. Zudem können **E-Mail Benachrichtigungen** konfiguriert werden.
'''

View file

@ -1,24 +0,0 @@
<ul class="nav nav-tabs">
<li class="active"><a href="#">Accounts</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="">
<table class="table table-striped">
<tr>
<th>Name</th>
<th>Active</th>
<th>Delete</th>
</tr>
<tr>
<td>lalal.example.com</td>
<td>true</td>
<td>x</td>
</tr>
<tr>
<td>wpt23dd4rwr</td>
<td>true</td>
<td>x</td>
</tr>
</table>
</div>
</div>

View file

@ -0,0 +1,61 @@
<div class="page-header">
<div class="page-header-title">
<h1><%- @T('Twitter') %> <small><%- @T('Accounts') %></small></h1>
</div>
<div class="page-header-meta">
<!--<a class="btn js-config"><%- @T('Configure App') %></a>
<a class="btn btn--success js-new"><%- @T('Add Account') %></a>-->
</div>
</div>
<div class="page-content">
<div class="page-description">
<p>
Lorem ipsum Consequat ex dolore ullamco dolor ut eu eiusmod voluptate. Lorem ipsum Non aliquip Ut veniam cupidatat velit deserunt. Lorem ipsum Id reprehenderit deserunt esse eiusmod exercitation. Lorem ipsum Voluptate mollit sed Ut nulla consequat enim. Lorem ipsum Adipisicing ullamco dolor elit officia pariatur ex ea laboris Ut exercitation proident sed. Lorem ipsum In officia reprehenderit sed nulla incididunt aute incididunt ad quis tempor. Lorem ipsum Dolore est id minim dolore et labore incididunt commodo. Lorem ipsum Excepteur non consectetur anim ut nostrud amet et. Lorem ipsum Sunt nostrud nulla officia aute laborum enim in pariatur sit enim et.
</p>
<div class="btn btn--success js-create-app"><%- @T('Connect Twitter App') %></div>
</div>
<!--<div class="action">
<div class="action-block action-row">
<h2>Zammad Community <span class="text-muted">@zammad_community</span></h2>
</div>
<div class="action-flow action-flow--row">
<div class="action-block">
<h3><%- @T('Search Terms') %></h3>
zammad
</div>
<%- @Icon('arrow-right', 'action-flow-icon') %>
<div class="action-block">
<h3><%- @T('Group') %></h3>
social network
</div>
</div>
<div class="action-flow action-flow--row">
<div class="action-block">
<h3><%- @T('Mentions') %></h3>
@zammad_community
</div>
<%- @Icon('arrow-right', 'action-flow-icon') %>
<div class="action-block">
<h3><%- @T('Group') %></h3>
social network
</div>
</div>
<div class="action-flow action-flow--row">
<div class="action-block">
<h3><%- @T('Direct Messages') %></h3>
@zammad_community
</div>
<%- @Icon('arrow-right', 'action-flow-icon') %>
<div class="action-block">
<h3><%- @T('Group') %></h3>
social network
</div>
</div>
<div class="action-controls">
<div class="sla-toggle btn btn--danger btn--secondary js-delete"><%- @T('Delete') %></div>
<div class="sla-edit btn js-edit"><%- @T('Edit') %></div>
</div>
</div>-->
</div>