Skip to content
Merged
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
4 changes: 4 additions & 0 deletions app/assets/variables.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:root {
--pos-color-button-primary-background: #008000;
--pos-color-button-primary-hover-background: #00a000;
}
3 changes: 2 additions & 1 deletion app/pos-modules.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"modules": {
"core": "1.5.2"
"core": "1.5.2",
"common-styling": "1.29.0"
}
}
3 changes: 2 additions & 1 deletion app/pos-modules.lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"modules": {
"core": "1.5.2"
"core": "1.5.2",
"common-styling": "1.29.0"
}
}
19 changes: 19 additions & 0 deletions app/views/layouts/application.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en" class="pos-app">
<head>
<meta charset="utf-8">
<meta name="description" content="Contact Us form">
<title>Contact Us Form</title>

{% render 'modules/common-styling/init', reset: true %}
<link rel="stylesheet" href="{{ 'variables.css' | asset_url }}">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=yes">
</head>
<body>
{{ content_for_layout }}

{% liquid
theme_render_rc 'modules/common-styling/toasts'
%}
</body>
</html>
40 changes: 21 additions & 19 deletions app/views/partials/contacts/form.liquid
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<h2>Contact Us</h2>
<form action="/contacts/create" method="post">
<input type="hidden" name="authenticity_token" value="{{ context.authenticity_token }}"</input>
<div>
<label for="email">Email</label>
<input type="text" name="contact[email]" id="email" value="{{ contact.email }}">
{% if contact.errors.email != blank %}
<p>{{ contact.errors.email | join: ', ' }}</p>
{% endif %}
</div>
<div>
<textarea name="contact[body]">{{ contact.body }}</textarea>
{% if contact.errors.body != blank %}
<p>{{ contact.errors.body | join: ', ' }}</p>
{% endif %}
</div>
<input type="submit" value="Send">
</form>

<h2 class="pos-heading-2">Contact Us</h2>

<form class="pos-form pos-form-simple" action="/contacts/create" method="post">
<input type="hidden" name="authenticity_token" value="{{ context.authenticity_token }}">

<fieldset>
<label for="email">Email</label>
<input id="email" name="contact[email]" type="email" value="{{ contact.email }}" required>
{% render 'modules/common-styling/forms/error_list', name: 'email', errors: contact.errors.email %}
</fieldset>

<fieldset>
<label for="message">Message</label>
<textarea id="message" name="contact[body]" rows="6" required>{{ contact.body }}</textarea>
{% render 'modules/common-styling/forms/error_list', name: 'body', errors: contact.errors.body %}
</fieldset>

<fieldset>
<button type="submit" class="pos-button pos-button-primary">Send</button>
</fieldset>
</form>
32 changes: 32 additions & 0 deletions modules/common-styling/public/assets/js/pos-debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
initializes pos modules
*/



// purpose: debuging method that outputs data into the console
// arguments: should the function run (bool)
// id of the module for which the debug data is printed (string)
// textual information about what is happening (string)
// optional data printed and parsed in the console (any)
// ------------------------------------------------------------------------
pos.modules.debug = (active, moduleId, information, data = '') => {
if(active || pos.debug){

if(moduleId === 'event'){
console.log(`%c⚑%c${information}`, 'padding: .2em .5em; background-color: #000; color: #fff; border-radius: 4px;', 'margin-inline-start: .5em; padding: .2em .5em; background-color: #000; color: #fff; border-radius: 4px;', data);
} else {

const stringToColor = (string, saturation = 100, lightness = 80) => {
let hash = 0;
for (let i = 0; i < string.length; i++) {
hash = string.charCodeAt(i) + ((hash << 5) - hash);
hash = (hash & hash) * 100;
}
return `hsl(${(hash % 360)}, ${saturation}%, ${lightness}%)`;
}

console.log(`%c${moduleId}%c ${information}`, `padding: .2em .5em; background-color: ${stringToColor(moduleId)}; border-radius: 4px;`, 'all: revert;', data);
}
}
};
Loading