Skip to content

Commit

Permalink
Merge branch 'develop' into create-tools-container
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodiegoss committed Nov 21, 2024
2 parents b880356 + e35cd38 commit 8532542
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 52 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,8 @@ vim /etc/resolv.conf
```
nameserver 172.21.176.1
```
- Access the localhost using this IP (e.g.: 172.21.176.1:8000)
- Access the localhost using this IP (e.g.: 172.21.176.1:8000)

### Prototype

The Jandig platform count with a High-Fidelity Prototype which aims the development and documentation of improvements related to usability. To acess and contribute with the prototype, follow the instructions in [Prototype Documentation](/docs/prototype.md).
Binary file added docs/images/figma-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/figma-login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/figma-save-local.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/figma-upload-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/open-prototype.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/project-figma.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/prototype-file-downhold.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/save-file.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions docs/prototype.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Prototype
The Jandig platform prototype is a graphical representation of the platform developed using Figma [Figma](https://www.figma.com/downloads/) tool, it has the purpose of improving Jandig ARte platform's interface and user experience aspects. Thus, the High Fidelity Prototype is a representation of the platforms containing general usability improvements, used to arise activities to implement the suggested modifications.


## Accessing the Prototype
The prototype must be accessed using Figma platform, follow the steps below to access the prototype:

1 - Login or Register on [Figma](https://www.figma.com/login) platform;

![figma-login](./images/figma-save-local.PNG)

2 - Download the [prototype file](https://github.com/memeLab/Jandig/blob/develop/docs/jandig_prototype.fig) to your computer;

![prototype-file-downhold](./images/prototype-file-downhold.png)

3 - Select the "import file" option on figma's main screen and select the previously downloaded file;

![figma-home](./images/figma-home.png)

![figma-upload-file](./images/figma-upload-file.png)

5 - Access the prototype by clicking on the project.

![open-prototype](./images/open-prototype.png)


## Contributing to the Prototype

1 - Access the prototype using Figma platform as written in the tutorial described in the previous section;

2 - Open an Issue describing changes to be made to the prototype or select an existing issue and contribute to the issue. In order to do this follow the [contribution guide](https://github.com/memeLab/ARte/blob/master/.github/CONTRIBUTING.md);

3 - After making changes to the prototype following the guidelines of the chosen or created issue, upload the file following the steps below:

- 1 - Download the new version of the prototype onto your computer using your [Figma](https://www.figma.com/login);

![project-figma](./images/project-figma.PNG)

![figma-save-local](./images/figma-save-local.PNG)

![save-file](./images/save-file.PNG)

- 2 - Upload the file "jadig_prototype.fig" replacing the existing file with the updated version.

40 changes: 21 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 18 additions & 31 deletions src/users/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,45 +143,32 @@ def __init__(self, *args, **kwargs):
self.fields["username"].widget.attrs["placeholder"] = _("username / email")
self.fields["password"].widget.attrs["placeholder"] = _("password")

def clean_username(self):
username_or_email = self.cleaned_data.get("username")
def clean(self):
cleaned_data = super(LoginForm, self).clean()

username_or_email = cleaned_data.get("username", "")
search_by = {}

if "@" in username_or_email:
if not User.objects.filter(email=username_or_email).exists():
raise forms.ValidationError(_("Username/email not found"))
user = User.objects.get(email=username_or_email)
if user:
return user.username
search_by["email"] = username_or_email
else:
if not User.objects.filter(username=username_or_email).exists():
raise forms.ValidationError(_("Username/email not found"))
search_by["username"] = username_or_email

# Already is a valid username
return username_or_email
user = User.objects.get(**search_by)
if not user:
raise forms.ValidationError(_("Username/email not found"))

def clean_password(self):
password = self.cleaned_data.get("password")
username_or_email = self.cleaned_data.get("username")
user = None
username_or_email_wrong = False
cleaned_data["username"] = user.username

if "@" in username_or_email:
if User.objects.filter(email=username_or_email).exists():
username = User.objects.get(email=username_or_email).username
user = authenticate(username=username, password=password)
else:
username_or_email_wrong = True
# raise forms.ValidationError(_('Email Wrong!'))
else:
if User.objects.filter(username=username_or_email).exists():
user = authenticate(username=username_or_email, password=password)
else:
username_or_email_wrong = True
# raise forms.ValidationError(_('Username Wrong!'))
password = cleaned_data.get("password")

if not user and not username_or_email_wrong:
logged_user = authenticate(username=user.username, password=password)
if not logged_user:
raise forms.ValidationError(_("Wrong password!"))

return password
self.confirm_login_allowed(logged_user)

return cleaned_data


class RecoverPasswordForm(forms.Form):
Expand Down
8 changes: 7 additions & 1 deletion src/users/jinja2/users/login.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@
<p class="login-field {{field.name}}">
{{ field }}
</p>
<h4 style="color:red">{{ field.errors }}</h4>
{% endfor%}
{% if form.non_field_errors() %}
<ul class="errorlist">
{% for error in form.non_field_errors() %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
<div class="form-options">
<p>
<input id="remember-me-chk" type="checkbox" name="remember" value="1">
Expand Down

0 comments on commit 8532542

Please sign in to comment.