Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added github repository and contribution information to Settings page #10

Merged
merged 1 commit into from
Jun 12, 2023
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
12 changes: 12 additions & 0 deletions src/Gpt.Labs/Helpers/Extensions/PackageVersionExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Windows.ApplicationModel;

namespace Gpt.Labs.Helpers.Extensions
{
public static class PackageVersionExtensions
{
public static string GetStringVersion(this PackageVersion version)
{
return $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
}
}
}
63 changes: 63 additions & 0 deletions src/Gpt.Labs/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,69 @@

</StackPanel>
</controls:TitledContentPanel>

<controls:TitledContentPanel x:Uid="AboutCaption" Title="About" HorizontalContentAlignment="Stretch">

<StackPanel Spacing="4">

<TextBlock Style="{StaticResource LabelStyle}" Margin="0">
<Run Text="GPT Labs" FontWeight="Bold"></Run><Run Text=" v" Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}"></Run><Run x:Name="ApplicationVersion" Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}"></Run>
</TextBlock>

<TextBlock Style="{StaticResource LabelStyle}">
<Run x:Uid="AboutDescription1"></Run><Hyperlink NavigateUri="https://github.com/mnikonov/gpt-labs"><Run x:Uid="AboutDescription2"/></Hyperlink><Run x:Uid="AboutDescription3"></Run>
</TextBlock>

<TextBlock x:Uid="ContributionDescription" Style="{StaticResource LabelStyle}" Foreground="{ThemeResource SystemControlForegroundBaseMediumHighBrush}">
</TextBlock>

<Grid Margin="0 18 0 0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<TextBlock x:Uid="SuggesNewLabel" Text="Sugges new" Grid.Column="0" Grid.Row="0" TextLineBounds="Tight" Margin="0 12 0 0"/>

<Button x:Name="FeatureButton" Grid.Column="1" Grid.Row="0"
Click="OnFeatureButtonClick">
<StackPanel Orientation="Horizontal" Spacing="12">
<FontIcon Glyph="&#xe771;" FontSize="14" Foreground="{StaticResource GreenBrush}" />
<TextBlock x:Uid="FeatureLabel" Text="Feature" />
</StackPanel>
</Button>


<TextBlock x:Uid="ReportLabel" Text="Report" Grid.Column="0" Grid.Row="1" TextLineBounds="Tight" Margin="0 24 0 0"/>

<Button x:Name="BugButton" Grid.Column="1" Grid.Row="1" Margin="0 12 0 0"
Click="OnBugButtonClick">
<StackPanel Orientation="Horizontal" Spacing="12">
<FontIcon Glyph="&#xebe8;" FontSize="14" Foreground="{StaticResource OrangeBrush}" />
<TextBlock x:Uid="BugLabel" Text="Bug" />
</StackPanel>
</Button>


<TextBlock x:Uid="BecomeLabel" Text="Become" Grid.Column="0" Grid.Row="2" TextLineBounds="Tight" Margin="0 24 0 0"/>

<Button x:Name="SponsorButton" Grid.Column="1" Grid.Row="2" Margin="0 12 0 0"
Click="OnSponsorButtonClick">
<StackPanel Orientation="Horizontal" Spacing="12">
<FontIcon Glyph="&#xeb51;" FontSize="14" Foreground="{StaticResource PinkBrush}"/>
<TextBlock x:Uid="SponsorLabel" Text="Sponsor" />
</StackPanel>
</Button>

</Grid>

</StackPanel>
</controls:TitledContentPanel>
</StackPanel>
</ScrollViewer>
</Grid>
Expand Down
23 changes: 22 additions & 1 deletion src/Gpt.Labs/SettingsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
using Microsoft.UI.Xaml;
using System;
using Gpt.Labs.Controls.Dialogs;
using Gpt.Labs.Helpers.Extensions;
using Windows.ApplicationModel;
using Windows.System;

namespace Gpt.Labs
{
Expand All @@ -12,8 +15,10 @@ public sealed partial class SettingsPage : BasePage
#region Constructors

public SettingsPage()
{
{
this.InitializeComponent();

ApplicationVersion.Text = Package.Current.Id.Version.GetStringVersion();
}

#endregion
Expand Down Expand Up @@ -47,6 +52,22 @@ private async void OnEditOpenAISettingsClick(object sender, RoutedEventArgs e)
}
}


private async void OnFeatureButtonClick(object sender, RoutedEventArgs e)
{
await Launcher.LaunchUriAsync(new Uri("https://github.com/mnikonov/gpt-labs/issues/new?assignees=mnikonov&labels=enhancement&projects=&template=feature_request.md&title=%5BFEATURE%5D+-+"));
}

private async void OnBugButtonClick(object sender, RoutedEventArgs e)
{
await Launcher.LaunchUriAsync(new Uri("https://github.com/mnikonov/gpt-labs/issues/new?assignees=mnikonov&labels=bug&projects=&template=bug_report.md&title=%5BBUG%5D+-+"));
}

private async void OnSponsorButtonClick(object sender, RoutedEventArgs e)
{
await Launcher.LaunchUriAsync(new Uri("https://github.com/sponsors/mnikonov"));
}

#endregion
}
}
37 changes: 37 additions & 0 deletions src/Gpt.Labs/Strings/en/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -549,4 +549,41 @@ Accepts a json object that maps tokens (specified by their token ID in the token
<data name="OpenAIOrganizationDescription3.Text" xml:space="preserve">
<value> page</value>
</data>
<data name="AboutCaption.Title" xml:space="preserve">
<value>About</value>
</data>
<data name="AboutDescription1.Text" xml:space="preserve">
<value>For detailed information about the project, please visit our </value>
</data>
<data name="AboutDescription2.Text" xml:space="preserve">
<value>GitHub repository</value>
</data>
<data name="AboutDescription3.Text" xml:space="preserve">
<value>. GPT Labs is open source, and we welcome contributions from the community.</value>
</data>
<data name="BecomeLabel.Text" xml:space="preserve">
<value>Become</value>
</data>
<data name="BugLabel.Text" xml:space="preserve">
<value>Bug</value>
</data>
<data name="ContributionDescription.Text" xml:space="preserve">
<value>Our team is always looking for talented developers and designers to join our community and contribute to building innovative solutions. Contributing to open-source projects like GPT Labs is an excellent way to build your profile and expand your skills.

Explore our repository, support with donations, suggest new features or suggest improvements, and help to take GPT Labs to the next level.

We understand the significance of community contributions, and we highly appreciate everyone who helps make GPT Labs the best open-source project. Whether you're a developer, designer, tester or making donations your contribution will play a key role. Join us today, and let's make a difference tomorow.</value>
</data>
<data name="FeatureLabel.Text" xml:space="preserve">
<value>Feature</value>
</data>
<data name="ReportLabel.Text" xml:space="preserve">
<value>Report</value>
</data>
<data name="SponsorLabel.Text" xml:space="preserve">
<value>Sponsor</value>
</data>
<data name="SuggesNewLabel.Text" xml:space="preserve">
<value>Sugges new</value>
</data>
</root>
1 change: 1 addition & 0 deletions src/Gpt.Labs/Styles/Colors.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<SolidColorBrush x:Key="GreenBrush" Color="#1BBF82"></SolidColorBrush>
<SolidColorBrush x:Key="OrangeBrush" Color="#F3A740"></SolidColorBrush>
<SolidColorBrush x:Key="VioletBrush" Color="#7A4FDF"></SolidColorBrush>
<SolidColorBrush x:Key="PinkBrush" Color="#db61a2"></SolidColorBrush>

<LinearGradientBrush x:Key="ChatUserMessageBrush" StartPoint="0,0" EndPoint="1,1" Opacity="0.5">
<GradientStop Color="#1BBF82" Offset="0"/>
Expand Down