Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# MinWageCalc
For calculating the minimum wage

# Useful Links

* Municipal Code: https://www.municode.com/library/wa/seattle/codes/municipal_code?nodeId=TIT14HURI_CH14.19MIWAMICORAEMPEWOSE
* Definitions: https://www.municode.com/library/wa/seattle/codes/municipal_code?nodeId=TIT14HURI_CH14.19MIWAMICORAEMPEWOSE_14.19.010DE
* PDF of the Ordinance: http://www.seattle.gov/council/issues/minimumwage/attachments/Ord_124490.pdf
* Mayor Murray's summary: http://murray.seattle.gov/minimumwage/
* City Council Committee's summary: http://www.seattle.gov/council/issues/MinimumWage/default.html

# Building Releases

## Android
Expand Down
Binary file modified platforms/browser/build/package.zip
Binary file not shown.
55 changes: 52 additions & 3 deletions platforms/browser/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<script id="home-tpl" type="text/template">
<div class="content-padded">
<h1 class="center app-title">Minimum Wage Calculator</h1>
<a href="#question/work-seattle" class="btn btn-block start-survey">Start</a>
<a href="#question/work-seattle" class="btn btn-block start-survey">Start Survey</a>
<a href="https://www.municode.com/library/wa/seattle/codes/municipal_code?nodeId=TIT14HURI_CH14.19MIWAMICORAEMPEWOSE_14.19.020EMSEEMSCDE" class="btn btn-block btn-contrast">Full Text of the Ordinance</a>
<h5 class="center">Presented By:</h5>
<a href="http://workingwa.org"><img class="working-wa-logo center" src="img/working-wa-logo.png"></img></a>
</div>
Expand All @@ -28,10 +29,21 @@ <h1 class="title">{{summary}}</h1>
<a href="#" class="icon icon-refresh pull-right"></a>
</header>
<div class="content">
<div class="question-prompt">{{prompt}}</div>
<div class="question-prompt">{{{prompt}}}</div>
{{#each choices}}
<a href="{{next}}" class="btn btn-block answer" data-question-id="{{../id}}" data-value="{{value}}">{{text}}</a>
{{/each}}
<div class="definitions"></div>
<div id="hourly-minimum-compensation" class="modal">
<header class="bar bar-nav">
<a class="icon icon-close pull-right" href="#hourly-minimum-compensation"></a>
<h1 class="title">hourly minimum compensation</h1>
</header>

<div class="content">
<p class="content-padded">hourly minimum compensation</p>
</div>
</div>
</div>
</script>

Expand All @@ -52,8 +64,41 @@ <h1 class="title">What should your hourly wage be?</h1>
{{/each}}
</ul>
<div class="center question-prompt">Are you making less than this per hour? You may be a victim of wage theft. Please take action and:</div>
<a href="http://www.seattle.gov/civilrights/labor-standards/wage-theft" class="btn btn-block btn-contrast-red">Report It!</a>
<a href="http://www.seattle.gov/civilrights/labor-standards/wage-theft" class="btn btn-block btn-negative">Report It!</a>
<div class="center question-prompt">Further Reading:</div>
<a href="https://www.municode.com/library/wa/seattle/codes/municipal_code?nodeId=TIT14HURI_CH14.19MIWAMICORAEMPEWOSE" class="btn btn-block btn-contrast">Full Text of the Ordinance</a>
<a href="http://www.seattle.gov/civilrights/labor-standards" class="btn btn-block btn-contrast">Office of Labor Standards</a>
</div>
</script>

<script id="note-tpl" type="text/template">
<header class="bar bar-nav">
<h1 class="title">{{title}}</h1>
<a href="#" class="icon icon-refresh pull-right"></a>
</header>
<div class="content">
{{#each text}}
<p>{{this}}</p>
{{/each}}
<a href="{{next}}" class="btn btn-block btn-contrast">Continue Survey</a>
<div class="center question-prompt">Want to read the relevant part of the ordinance yourself? Check out section {{ordinance.section}} of:</div>
<a href="{{ordinance.href}}" class="btn btn-block btn-contrast">This Part of The Ordinance</a>
</div>
</script>

<script id="definitions-tpl" type="text/template">
{{#each this}}
<div id="{{id}}" class="modal">
<header class="bar bar-nav">
<a class="icon icon-close pull-right" href="#{{id}}"></a>
<h1 class="title">{{text}}</h1>
</header>

<div class="content">
<p class="content-padded">{{text}}</p>
</div>
</div>
{{/each}}
</script>

<script src="cordova.js"></script>
Expand All @@ -69,6 +114,10 @@ <h1 class="title">What should your hourly wage be?</h1>
<script src="js/services/memory/QuestionService.js"></script>
<script src="js/services/memory/AnswerService.js"></script>
<script src="js/services/memory/WageService.js"></script>
<script src="js/services/memory/DefinitionService.js"></script>
<script src="js/services/memory/NoteService.js"></script>
<script src="js/NoteView.js"></script>
<script src="js/DefinitionsView.js"></script>
<script src="js/HomeView.js"></script>
<script src="js/QuestionView.js"></script>
<script src="js/ResultView.js"></script>
Expand Down
20 changes: 20 additions & 0 deletions platforms/browser/www/js/DefinitionsView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
var DefinitionsView = function (definitionService) {
this.initialize = function () {
// Define a div wrapper for the view (used to attach events)
this.$el = $('<div/>');
this.render();
};

this.render = function() {
var definitions = definitionService.getDefinitions();
for(var i in definitions){
definitions[i].id = i.replace(/\s/g,"-");
definitions[i].text = i;
}
this.$el.html(this.template(definitions));
return this;
};

this.initialize();
}

14 changes: 14 additions & 0 deletions platforms/browser/www/js/NoteView.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var NoteView = function(note) {
this.initialize = function() {
this.$el = $('<div/>');
this.render();
};

this.render = function() {
this.$el.html(this.template(note));
return this;
};

this.initialize();
}

6 changes: 5 additions & 1 deletion platforms/browser/www/js/QuestionView.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
var QuestionView = function(question, answerService) {
var QuestionView = function(question, answerService, definitionService) {
var definitionsView;

this.initialize = function() {
this.$el = $('<div/>');
definitionsView = new DefinitionsView(definitionService);
this.$el.on('click', '.answer', this.saveAnswer);
this.render();
};

this.saveAnswer = function(event) {
Expand All @@ -14,6 +17,7 @@ var QuestionView = function(question, answerService) {

this.render = function() {
this.$el.html(this.template(question));
$('.definitions', this.$el).html(definitionsView.$el);
return this;
};

Expand Down
14 changes: 12 additions & 2 deletions platforms/browser/www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@
HomeView.prototype.template = Handlebars.compile($("#home-tpl").html());
QuestionView.prototype.template = Handlebars.compile($("#question-tpl").html());
ResultView.prototype.template = Handlebars.compile($("#result-tpl").html());
DefinitionsView.prototype.template = Handlebars.compile($('#definitions-tpl').html());
NoteView.prototype.template = Handlebars.compile($('#note-tpl').html());

var slider = new PageSlider($('body'));

var questionService = new QuestionService();
var answerService = new AnswerService();
var wageService = new WageService();
var definitionService = new DefinitionService();
var noteService = new NoteService();

$.when([questionService.initialize(), answerService.initialize(), wageService.initialize()]).done(function() {
$.when([questionService.initialize(), answerService.initialize(), wageService.initialize(), definitionService.initialize(), noteService.initialize()]).done(function() {
router.addRoute('', function() {
slider.slidePage(new HomeView(answerService).render().$el);
});
Expand All @@ -32,7 +36,13 @@

router.addRoute('question/:id', function(id) {
questionService.findById(id).done(function(question) {
slider.slidePage(new QuestionView(question, answerService).render().$el);
slider.slidePage(new QuestionView(question, answerService, definitionService).render().$el);
});
});

router.addRoute('note/:id', function(id) {
noteService.findById(id).done(function(note) {
slider.slidePage(new NoteView(note).render().$el);
});
});

Expand Down
93 changes: 93 additions & 0 deletions platforms/browser/www/js/services/memory/DefinitionService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
var DefinitionService = function() {
this.initialize = function() {
// No Initialization required
var deferred = $.Deferred();
deferred.resolve();
return deferred.promise();
}

this.findByWord = function(word) {
return definitions[word.toLowerCase()];
}

this.getDefinitions = function() {
return definitions;
}

var definitions = {
"actuarial value": {
"text": "the percentage of total average costs for covered benefits that a health benefits package will cover;"
},
"bonuses": {
"text": "non-discretionary payments in addition to hourly, salary, commission, or piece-rate payments paid under an agreement between the employer and employee;"
},
"commissions": {
"text": "a sum of money paid to an employee upon completion of a task, usually selling a certain amount of goods or services;"
},
"department": {
"text": "the Department of Finance and Administrative Services;"
},
"director": {
"text": "the Director of the Department of Finance and Administrative Services, or his or her designee;"
},
"employ": {
"text": "to permit to work;"
},
"employee": {
"text": "\"employee,\" as defined under <a href=\"\" data-chunk-id=\"TIT12ACRCO_SUBTITLE_ICRCO_CH12A.28MIOF_12A.28.200DE\" class=\"section-link\" data-product-id=\"13857\"> Section 12A.28.200<\/a> . Employee does not include individuals performing services under a work study agreement;"
},
"employer": {
"text": "any individual, partnership, association, corporation, business trust, or any person or group of persons acting directly or indirectly in the interest of an employer in relation to an employee;"
},
"franchise": {
"text": "a written agreement by which:",
"children": [
{"text": "A person is granted the right to engage in the business of offering, selling, or distributing goods or services under a marketing plan prescribed or suggested in substantial part by the grantor or its affiliate;"},
{"text": "The operation of the business is substantially associated with a trademark, service mark, trade name, advertising, or other commercial symbol; designating, owned by, or licensed by the grantor or its affiliate; and"},
{"text": "The person pays, agrees to pay, or is required to pay, directly or indirectly, a franchise fee;"}
]
},
"franchisee": {
"text": "a person to whom a franchise is offered or granted;"
},
"franchisor": {
"text": "a person who grants a franchise to another person;"
},
"hearing Examiner": {
"text": "the official appointed by the Council and designated as the Hearing Examiner, or that person's designee (Deputy Hearing Examiner, Hearing Examiner Pro Tem, etc.);"
},
"hourly minimum compensation": {
"text": "the minimum compensation due to an employee for each hour worked during a pay period;"
},
"hourly minimum wage": {
"text": "the minimum wage due to an employee for each hour worked during a pay period;"
},
"medical benefits plan": {
"text": "a silver or higher level essential health benefits package, as defined in 42 U.S.C. \u00a7 18022, or an equivalent plan that is designed to provide benefits that are actuarially equivalent to 70 percent of the full actuarial value of the benefits provided under the plan, whichever is greater;"
},
"minimum compensation": {
"text": "the minimum wage in addition to tips actually received by the employee and reported to the Internal Revenue Service, and money paid by the employer towards an individual employee's medical benefits plan;"
},
"minimum wage": {
"text": "all wages, commissions, piece-rate, and bonuses actually received by the employee and reported to the Internal Revenue Service;"
},
"piece-rate": {
"text": "a price paid per unit of work;"
},
"rate of inflation": {
"text": "the Consumer Price Index annual percent change for urban wage earners and clerical workers, termed CPI-W, or a successor index, for the twelve months prior to each September 1st as calculated by the United States Department of Labor;"
},
"schedule 1 employer": {
"text": "all employers that employ more than 500 employees in the United States, regardless of where those employees are employed in the United States, and all franchisees associated with a franchisor or a network of franchises with franchisees that employ more than 500 employees in aggregate in the United States;"
},
"schedule 2 employer": {
"text": "all employers that employ 500 or fewer employees regardless of where those employees are employed in the United States. Schedule 2 employers do not include franchisees associated with a franchisor or a network of franchises with franchisees that employ more than 500 employees in aggregate in the United States;"
},
"tips": {
"text": "a verifiable sum to be presented by a customer as a gift or gratuity in recognition of some service performed for the customer by the employee receiving the tip;"
},
"wage": {
"text": "compensation due to an employee by reason of employment, payable in legal tender of the United States or checks on banks convertible into cash on demand at full face value, subject to such deductions, charges, or allowances as may be permitted by rules of the Director. Commissions, piece-rate, and bonuses are included in wages. Tips and employer payments toward a medical benefits plan do not constitute wages for purposes of this Chapter."
},
}
};
48 changes: 48 additions & 0 deletions platforms/browser/www/js/services/memory/NoteService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
var NoteService = function() {

this.initialize = function() {
// No Initialization required
var deferred = $.Deferred();
deferred.resolve();
return deferred.promise();
}

this.findById = function(id) {
var deferred = $.Deferred();
var note = null;
var l = notes.length;
for (var i=0; i < l; i++) {
if (notes[i].id == id) {
note = notes[i];
break;
}
}
deferred.resolve(note);
return deferred.promise();
}

var notes = [
{
"id": "part-time-seattle",
"title":"Part Time in Seattle",
"text": ["Employees should receive the minimum wage for each hour worked within the geographic boundaries of Seattle, provided that an employee who performs work in Seattle on an occasional basis should receive the appropriate minimum wage in a two-week period only if the employee performs more than two hours of work for an employer within Seattle during that two-week period.","Time spent in Seattle solely for the purpose of travelling through Seattle from a point of origin outside Seattle to a destination outside Seattle, with no employment-related or commercial stops in Seattle except for refueling or the employee's personal meals or errands, are not included."],
"ordinance": { "section": "A", "href": "https://www.municode.com/library/wa/seattle/codes/municipal_code?nodeId=TIT14HURI_CH14.19MIWAMICORAEMPEWOSE_14.19.020EMSEEMSCDE" },
"next":"#question/number-employees",
"skip": function(answers) {
return false
}
},
{
"id": "minimum-compensation",
"title":"Minimum Compensation",
"text":["Employers can meet the applicable hourly minimum compensation requirement through wages (including applicable commissions, piece-rate, and bonuses), tips and money paid by an employer towards an individual employee's medical benefits plan, provided that the Schedule 2 employer also meets the applicable hourly minimum wage requirements."],
"ordinance": { "section":"B", "href": "https://www.municode.com/library/wa/seattle/codes/municipal_code?nodeId=TIT14HURI_CH14.19MIWAMICORAEMPEWOSE_14.19.050HOMICOCH2EM"},
"next":"#results",
"skip": function(answers) {
return answers["health-insurance"] == "yes" || answers["tips"] == "yes";
}
},
];

}

24 changes: 18 additions & 6 deletions platforms/browser/www/js/services/memory/QuestionService.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ var QuestionService = function() {
for (var i=0; i < l; i++) {
if (questions[i].id == id) {
question = questions[i];
console.log("Returning question: " + question);
break;
}
}
Expand All @@ -25,19 +24,32 @@ var QuestionService = function() {
var questions = [
{"id": "work-seattle", "summary":"Employed in Seattle", "prompt":"Is your place of employment located in Seattle?", choices:[
{"next": "#question/number-employees", "value": "yes", "text": "Yes"},
{"next": "#results", "value": "no", "text": "No"}
{"next": "#results", "value": "no", "text": "No"},
{"next": "#note/part-time-seattle", "value": "yes", "text": "Sometimes"},
{"next": "#question/methods-for-determining-in-seattle", "value": "", "text": "I Don't Know"}
]},
{"id": "methods-for-determining-in-seattle", "summary":"Employed in Seattle?", "prompt":"Choose one of these methods to determine if you are employed in Seattle?", choices:[
{"next": "#employer-determination/nearby", "text": "Choose from Nearest 20 Businesses"},
{"next": "#employer-determination/address", "text": "Enter The Address Where You Work"},
{"next": "#employer-determination/business-name", "text": "Enter Business Name"},
{"next": "#employer-determination/top-50", "text": "Choose From Top 50 Employers In The State"},
{"next": "#employer-determination/map", "text": "Indicate Where You Work On A Map"},
]},
{"id": "number-employees", "summary":"Number of Employees", "prompt":"How many people work at your employer across the USA?", choices:[
{"next": "#question/min-compensation", "value": "1-500", "text": "1 - 500"},
{"next": "#question/health-insurance", "value": "1-500", "text": "1 - 500"},
{"next": "#question/medical-benefits", "value": ">500", "text": "Over 500"}
]},
{"id": "medical-benefits", "summary":"Medical Benefits", "prompt":"Does your employer provide medical benefits to you?", choices:[
{"next": "#results", "value": "yes", "text": "Yes"},
{"next": "#results", "value": "no", "text": "No"}
]},
{"id": "min-compensation", "summary":"Minimum Compensation", "prompt":"Does your employer provide minimum compensation?", choices:[
{"next": "#results", "value": "yes", "text": "Yes"},
{"next": "#results", "value": "no", "text": "No"}
{"id": "health-insurance", "summary":"Health Insurance", "prompt":"Does your employer pay for any of your health insurance?", choices:[
{"next": "#question/tips", "value": "yes", "text": "Yes"},
{"next": "#question/tips", "value": "no", "text": "No"}
]},
{"id": "tips", "summary":"Tips", "prompt":"Do you receive tips?", choices:[
{"next": "#note/minimum-compensation", "value": "yes", "text": "Yes"},
{"next": "#note/minimum-compensation", "value": "no", "text": "No"}
]},
];

Expand Down
Loading