From b031baee105a4d97d943e331262d4e3b9d96b583 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Thu, 19 Nov 2015 10:32:31 +0100 Subject: [PATCH] wip twitter channel --- .../app/controllers/_channel/twitter.coffee | 92 +++++++++++++++++-- .../javascripts/app/models/twitter.coffee | 19 ++++ .../app/views/channel/twitter.jst.eco | 24 ----- .../app/views/twitter/index.jst.eco | 61 ++++++++++++ 4 files changed, 165 insertions(+), 31 deletions(-) create mode 100644 app/assets/javascripts/app/models/twitter.coffee delete mode 100644 app/assets/javascripts/app/views/channel/twitter.jst.eco create mode 100644 app/assets/javascripts/app/views/twitter/index.jst.eco diff --git a/app/assets/javascripts/app/controllers/_channel/twitter.coffee b/app/assets/javascripts/app/controllers/_channel/twitter.coffee index 38a4b53e3..4333c5c9f 100644 --- a/app/assets/javascripts/app/controllers/_channel/twitter.coffee +++ b/app/assets/javascripts/app/controllers/_channel/twitter.coffee @@ -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: -> super - @title 'Twitter' + # check authentication + return if !@authenticate() - # render page @render() - render: -> - @html App.view('channel/twitter')( - head: 'some header' + #@interval(@load, 60000) + #@load() + + 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' ) \ No newline at end of file diff --git a/app/assets/javascripts/app/models/twitter.coffee b/app/assets/javascripts/app/models/twitter.coffee new file mode 100644 index 000000000..738f54b31 --- /dev/null +++ b/app/assets/javascripts/app/models/twitter.coffee @@ -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. +''' \ No newline at end of file diff --git a/app/assets/javascripts/app/views/channel/twitter.jst.eco b/app/assets/javascripts/app/views/channel/twitter.jst.eco deleted file mode 100644 index b3489bb72..000000000 --- a/app/assets/javascripts/app/views/channel/twitter.jst.eco +++ /dev/null @@ -1,24 +0,0 @@ - -
-
- - - - - - - - - - - - - - - - -
NameActiveDelete
lalal.example.comtruex
wpt23dd4rwrtruex
-
-
diff --git a/app/assets/javascripts/app/views/twitter/index.jst.eco b/app/assets/javascripts/app/views/twitter/index.jst.eco new file mode 100644 index 000000000..ea9ee5999 --- /dev/null +++ b/app/assets/javascripts/app/views/twitter/index.jst.eco @@ -0,0 +1,61 @@ + + +
+
+

+ 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. +

+
<%- @T('Connect Twitter App') %>
+
+ +
\ No newline at end of file