Skip to content
This repository has been archived by the owner on Jan 16, 2018. It is now read-only.

Commit

Permalink
[chore] make index works
Browse files Browse the repository at this point in the history
  • Loading branch information
Noëlie Andrieu committed Jan 18, 2017
1 parent e81bd94 commit 49ee571
Show file tree
Hide file tree
Showing 56 changed files with 55 additions and 1,047 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ results
node_modules
npm-debug.log

client/bower_components
client/public
client/app/locales/*.json
!client/app/locales/en.json
bower_components
public
app/locales/*.json
app/locales/en.json

picture.jpg
2 changes: 1 addition & 1 deletion app/application.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Application extends Mn.Application
search: (pattern, string) ->
filter = @model.get 'filter'
input = "`#{pattern}:#{string}`"
_pattern = require('config').search.pattern pattern
_pattern = require('const-config').search.pattern pattern
prev = filter?.match _pattern

if string
Expand Down
2 changes: 1 addition & 1 deletion app/collections/filtered.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ContactViewModel = require 'views/models/contact'

{indexes, search} = require 'config'
{indexes, search} = require 'const-config'

tagRegExp = search.pattern 'tag'
app = null
Expand Down
File renamed without changes.
15 changes: 13 additions & 2 deletions app/initialize.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Sets the browser environment to prepare it to launch the app, and then require
the application.
###


###
Logging
Expand Down Expand Up @@ -56,14 +55,26 @@ Starts
Trigger locale initilization and starts application singleton.
###
application = require './application'


# Temporary use a global variable to store the `t` helpers, waiting for
# Marionette allow to register global helpers.
# see https://github.com/marionettejs/backbone.marionette/issues/2164
window.t = require 'lib/i18n'

ColorHash.addScheme 'cozy', require('config').colorSet
ColorHash.addScheme 'cozy', require('const-config').colorSet
Mn.Behaviors.behaviorsLookup = require 'lib/behaviors'

document.addEventListener 'DOMContentLoaded', ->

# TODO: définir les globales JS
# imports et locales ici

# getImports (err, imports) ->
# return res.error 500, 'An error occured', err if err
# res.render "index",
# imports: JSON.stringify(imports)
# locale: imports.locale

initReporting()
application.start()
2 changes: 1 addition & 1 deletion app/views/app_layout.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ module.exports = class AppLayout extends Mn.LayoutView


error: (err) ->
{ERR} = require 'config'
{ERR} = require 'const-config'
if err is ERR.SEARCH_TOO_SHORT
@results.$el.attr 'aria-hidden', true
@ui.counter
Expand Down
2 changes: 1 addition & 1 deletion app/views/contacts/card.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TagsActionsView = require 'views/contacts/components/edit_tags'

t = require 'lib/i18n'

CONFIG = require('config').contact
CONFIG = require('const-config').contact

app = undefined

Expand Down
2 changes: 1 addition & 1 deletion app/views/contacts/components/data.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DatapointsView = require 'views/contacts/components/datapoints'
XtrasView = require 'views/contacts/components/xtras'
EditActionsView = require 'views/contacts/components/edit_actions'

CONFIG = require('config').contact
CONFIG = require('const-config').contact


module.exports = class DataView extends Mn.LayoutView
Expand Down
2 changes: 1 addition & 1 deletion app/views/contacts/components/datapoint.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG = require('config').contact
CONFIG = require('const-config').contact


module.exports = class ContactDatapointView extends Mn.ItemView
Expand Down
2 changes: 1 addition & 1 deletion app/views/contacts/components/datapoints.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ t = require 'lib/i18n'

ContactDatapointView = require 'views/contacts/components/datapoint'

CONFIG = require('config').contact
CONFIG = require('const-config').contact


module.exports = class ContactDatapointsView extends Mn.CompositeView
Expand Down
2 changes: 1 addition & 1 deletion app/views/contacts/components/xtras.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG = require('config').contact
CONFIG = require('const-config').contact


module.exports = class ContactXtrasView extends Mn.ItemView
Expand Down
2 changes: 1 addition & 1 deletion app/views/contacts/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Slugifier = require 'lib/slugifier'

Indexes = Backbone.Collection

{indexes} = require 'config'
{indexes} = require 'const-config'

filtered = undefined

Expand Down
2 changes: 1 addition & 1 deletion app/views/contacts/row.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PATTERN = require('config').search.pattern 'text'
PATTERN = require('const-config').search.pattern 'text'
Slugifier = require '../../lib/slugifier'

app = undefined
Expand Down
2 changes: 1 addition & 1 deletion app/views/duplicates/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Duplicates = require 'collections/duplicates'

t = require 'lib/i18n'

CONFIG = require('config').contact
CONFIG = require('const-config').contact


module.exports = class DuplicatesView extends Mn.CompositeView
Expand Down
7 changes: 4 additions & 3 deletions app/views/models/app.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MergeView = require 'views/contacts/merge'
MergeModel = require 'views/models/merge'
request = require 'lib/request'
CONFIG = require 'const-config'

app = undefined

Expand Down Expand Up @@ -31,7 +32,7 @@ module.exports = class AppViewModel extends Backbone.ViewModel
@set 'selected', []
@listenTo @, 'change:filter', (nil, value) ->
@unselectAll()
@set 'scored', require('config').search.pattern('text').test value
@set 'scored', CONFIG.search.pattern('text').test value


select: (id) ->
Expand Down Expand Up @@ -82,8 +83,8 @@ module.exports = class AppViewModel extends Backbone.ViewModel
@trigger 'bulk:delete:done'


# TODO: probably need to be revamped when doing it for the whole merge
# feature
# TODO: probably need to be revamped
# when doing it for the whole merge feature
bulkMerge: ->
candidates = app.contacts.filter (contact) =>
contact.id in @attributes.selected
Expand Down
2 changes: 1 addition & 1 deletion app/views/models/contact.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Filtered = BackboneProjections.Filtered

CONFIG = require('config').contact
CONFIG = require('const-config').contact
CH = require('lib/contact_helper')

app = null
Expand Down
2 changes: 1 addition & 1 deletion app/views/settings/index.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{settings} = require 'config'
{settings} = require 'const-config'

t = require 'lib/i18n'

Expand Down
2 changes: 1 addition & 1 deletion app/views/tools/search.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ERR} = require 'config'
{ERR} = require 'const-config'

app = null

Expand Down
Binary file removed build/client/public/fonts/adobeblank.woff
Binary file not shown.
Binary file removed build/client/public/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file removed build/client/public/fonts/fontawesome-webfont.woff2
Binary file not shown.
147 changes: 0 additions & 147 deletions build/client/public/fonts/fonts.css

This file was deleted.

Binary file removed build/client/public/fonts/mavenpro-bold.woff
Binary file not shown.
Binary file removed build/client/public/fonts/mavenpro-bold.woff2
Binary file not shown.
Binary file removed build/client/public/fonts/mavenpro-regular.woff
Binary file not shown.
Binary file removed build/client/public/fonts/mavenpro-regular.woff2
Binary file not shown.
Binary file removed build/client/public/fonts/sourcecodepro-bold.woff
Binary file not shown.
Binary file removed build/client/public/fonts/sourcecodepro-regular.woff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed build/client/public/fonts/sourcesanspro-bold.woff
Binary file not shown.
Binary file removed build/client/public/fonts/sourcesanspro-bold.woff2
Binary file not shown.
Binary file removed build/client/public/fonts/sourcesanspro-italic.woff
Binary file not shown.
Binary file removed build/client/public/fonts/sourcesanspro-italic.woff2
Binary file not shown.
Binary file removed build/client/public/fonts/sourcesanspro-regular.woff
Binary file not shown.
Binary file not shown.
7 changes: 0 additions & 7 deletions build/client/public/scripts/app.js

This file was deleted.

11 changes: 0 additions & 11 deletions build/client/public/scripts/vendor.js

This file was deleted.

1 change: 0 additions & 1 deletion build/client/public/stylesheets/app.css

This file was deleted.

34 changes: 0 additions & 34 deletions build/server.js

This file was deleted.

48 changes: 0 additions & 48 deletions build/server/config.js

This file was deleted.

80 changes: 0 additions & 80 deletions build/server/controllers/application.js

This file was deleted.

Loading

0 comments on commit 49ee571

Please sign in to comment.